Top Description Fields Constructors Methods
org.mortbay.jetty.handler

public Class HandlerWrapper

extends AbstractHandlerContainer
Class Inheritance
Known Direct Subclasses
org.mortbay.jetty.handler.RequestLogHandler, org.mortbay.jetty.handler.StatisticsHandler, org.mortbay.jetty.servlet.SessionHandler, org.mortbay.jetty.Server, org.mortbay.jetty.handler.ContextHandler
Imports
java.io.IOException, javax.servlet.ServletException, javax.servlet.http.HttpServletRequest, .HttpServletResponse, org.mortbay.component.LifeCycle, org.mortbay.jetty.Handler, .HandlerContainer, .Server

A 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.
Author
gregw

Field Summary

Modifier and TypeField and Description
private Handler

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
protected void
protected void
protected Object
public Handler

Returns:

Returns the handlers.
getHandler
()

public void
handle(String
The target of the request - either a URI or a name.
target
,
HttpServletRequest
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.
request
,
HttpServletResponse
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.
response
,
int
The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR
dispatch
)

Implements org.mortbay.jetty.Handler.handle.

Handle a request.
public void
public void
setHandler(Handler
Set the Handler which should be wrapped.
handler
)

public void
Inherited from org.mortbay.jetty.handler.AbstractHandlerContainer:
expandHandlergetChildHandlerByClassgetChildHandlersgetChildHandlersByClass

Field Detail

_handlerback to summary
private Handler _handler

Constructor Detail

HandlerWrapperback to summary
public HandlerWrapper()

Method Detail

addHandlerback to summary
public void addHandler(Handler handler)

Implements org.mortbay.jetty.HandlerContainer.addHandler.

Add a handler. This implementation of addHandler calls setHandler with the passed handler. If this HandlerWrapper had a previous wrapped handler, then it is passed to a call to addHandler on the passed handler. Thus this call can add a handler in a chain of wrapped handlers.

doStartback to summary
protected void doStart() throws Exception

Overrides org.mortbay.jetty.handler.AbstractHandler.doStart.

doStopback to summary
protected void doStop() throws Exception

Overrides org.mortbay.jetty.handler.AbstractHandler.doStop.

expandChildrenback to summary
protected Object expandChildren(Object list, Class<T> byClass)

Overrides org.mortbay.jetty.handler.AbstractHandlerContainer.expandChildren.

getHandlerback to summary
public Handler getHandler()
Returns:Handler

Returns the handlers.

handleback to summary
public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException

Implements org.mortbay.jetty.Handler.handle.

Doc from org.mortbay.jetty.Handler.handle.

Handle a request.

Parameters
target:String

The target of the request - either a URI or a name.

request:HttpServletRequest

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:HttpServletResponse

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:int

The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR

removeHandlerback to summary
public void removeHandler(Handler handler)

Implements org.mortbay.jetty.HandlerContainer.removeHandler.

setHandlerback to summary
public void setHandler(Handler handler)
Parameters
handler:Handler

Set the Handler which should be wrapped.

setServerback to summary
public void setServer(Server server)

Overrides org.mortbay.jetty.handler.AbstractHandler.setServer.

Implements org.mortbay.jetty.Handler.setServer.