public class HandlerWrapper extends AbstractHandlerContainer
HandlerWrapper acts as a Handler but delegates the handle method and
life cycle events to a delegate. This is primarily used to implement the Decorator pattern._string| Constructor and Description |
|---|
HandlerWrapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(Handler handler)
Add a handler.
|
protected void |
doStart() |
protected void |
doStop() |
protected Object |
expandChildren(Object list,
Class byClass) |
Handler |
getHandler() |
void |
handle(String target,
HttpServletRequest request,
HttpServletResponse response,
int dispatch)
Handle a request.
|
void |
removeHandler(Handler handler) |
void |
setHandler(Handler handler) |
void |
setServer(Server server) |
expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClassdestroy, getServer, toStringaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic Handler getHandler()
public void setHandler(Handler handler)
handler - Set the Handler which should be wrapped.public void addHandler(Handler handler)
handler - public void removeHandler(Handler handler)
protected void doStart()
throws Exception
doStart in class AbstractHandlerExceptionprotected void doStop()
throws Exception
doStop in class AbstractHandlerExceptionpublic void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException
Handlertarget - The target of the request - either a URI or a name.request - The request either as the Request
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Request object if required.response - The response as the Response
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Response object if required.dispatch - The dispatch mode: Handler.REQUEST, Handler.FORWARD, Handler.INCLUDE, Handler.ERRORIOExceptionServletExceptionpublic void setServer(Server server)
setServer in interface HandlersetServer in class AbstractHandlerprotected Object expandChildren(Object list, Class byClass)
expandChildren in class AbstractHandlerContainerCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.