net.sf.ooweb.http.pygmy
Class OowebHandler
java.lang.Object
pygmy.core.AbstractHandler
net.sf.ooweb.http.pygmy.OowebHandler
- All Implemented Interfaces:
- pygmy.core.Handler
public class OowebHandler
- extends pygmy.core.AbstractHandler
The implementation of the Pygmy httpd plugin interface. Delegates to the
ooweb request handler after converting all pygmy-specific API's to ooweb
ones.
- Since:
- 0.7
- Author:
- Darren Davison
Field Summary |
protected java.util.logging.Logger |
logger
|
static pygmy.core.ConfigOption |
SESSION_STRATEGY
value that pygmy will extract from the properties files for us |
static pygmy.core.ConfigOption |
SESSION_TIMEOUT
value that pygmy will extract from the properties files for us |
Fields inherited from class pygmy.core.AbstractHandler |
handlerName, server, URL_PREFIX_OPTION, urlPrefix |
Method Summary |
protected void |
createErrorResponse(pygmy.core.HttpResponse resp,
int err,
java.lang.Throwable e)
a basic error response when the application didn't define any custom handler
for the exception. |
protected void |
createRedirectResponse(pygmy.core.HttpResponse resp,
ResponseState state)
|
protected void |
createResponse(pygmy.core.HttpResponse resp,
int code,
ResponseState state)
|
protected boolean |
handleBody(pygmy.core.HttpRequest request,
pygmy.core.HttpResponse response)
delegates the request to a RequestHandler after converting Pygmy
specific API objects to OOWeb ones |
boolean |
initialize(java.lang.String handlerName,
pygmy.core.Server server)
|
protected boolean |
isRequestdForHandler(pygmy.core.HttpRequest request)
|
Methods inherited from class pygmy.core.AbstractHandler |
getMimeType, getName, getUrlPrefix, handle, shutdown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final java.util.logging.Logger logger
SESSION_TIMEOUT
public static final pygmy.core.ConfigOption SESSION_TIMEOUT
- value that pygmy will extract from the properties files for us
SESSION_STRATEGY
public static final pygmy.core.ConfigOption SESSION_STRATEGY
- value that pygmy will extract from the properties files for us
OowebHandler
public OowebHandler()
initialize
public boolean initialize(java.lang.String handlerName,
pygmy.core.Server server)
- Specified by:
initialize
in interface pygmy.core.Handler
- Overrides:
initialize
in class pygmy.core.AbstractHandler
- See Also:
AbstractHandler.initialize(java.lang.String, pygmy.core.Server)
isRequestdForHandler
protected boolean isRequestdForHandler(pygmy.core.HttpRequest request)
- Overrides:
isRequestdForHandler
in class pygmy.core.AbstractHandler
- Returns:
- true in all cases
- See Also:
AbstractHandler.isRequestdForHandler(pygmy.core.HttpRequest)
handleBody
protected boolean handleBody(pygmy.core.HttpRequest request,
pygmy.core.HttpResponse response)
throws java.io.IOException
- delegates the request to a
RequestHandler
after converting Pygmy
specific API objects to OOWeb ones
- Overrides:
handleBody
in class pygmy.core.AbstractHandler
- Throws:
java.io.IOException
- See Also:
AbstractHandler.handleBody(pygmy.core.HttpRequest, pygmy.core.HttpResponse)
createResponse
protected void createResponse(pygmy.core.HttpResponse resp,
int code,
ResponseState state)
throws java.io.IOException
- Parameters:
resp
- code
- state
-
- Throws:
java.io.IOException
createRedirectResponse
protected void createRedirectResponse(pygmy.core.HttpResponse resp,
ResponseState state)
throws java.io.IOException
- Parameters:
resp
- state
-
- Throws:
java.io.IOException
createErrorResponse
protected void createErrorResponse(pygmy.core.HttpResponse resp,
int err,
java.lang.Throwable e)
throws java.io.IOException
- a basic error response when the application didn't define any custom handler
for the exception. We build a trivial view here
- Parameters:
resp
- err
- the HTTP error codee
- the Throwable that we are creating the response for
- Throws:
java.io.IOException
Copyright (C) 2005-2007 OOWeb Authors.