Class RequestHandler
- java.lang.Object
-
- org.gcube.smartgears.handlers.AbstractHandler
-
- org.gcube.smartgears.handlers.application.RequestHandler
-
- All Implemented Interfaces:
ApplicationHandler<RequestHandler>,Handler<ApplicationEvent<RequestHandler>>
- Direct Known Subclasses:
RequestAccounting,RequestContextRetriever,RequestValidator
public abstract class RequestHandler extends AbstractHandler implements ApplicationHandler<RequestHandler>
AHandlerofRequestEvents andResponseEvents.The handler participates in a
ApplicationPipelineof other handlers registered for notification of the same events. After processing the event, it may or may not propagate the event to the handlers further down in theApplicationPipelineApplicationPipeline#forward(ApplicationEvent).- Author:
- Fabio Simeoni
- See Also:
RequestEvent,ResponseEvent,ApplicationPipeline
-
-
Constructor Summary
Constructors Constructor Description RequestHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringgetName()voidhandleRequest(RequestEvent e)Invoked when the container receives a request for a servlet of a managed app.voidhandleResponse(ResponseEvent e)Invoked when a servlet of a managed app has produced a response to a request.voidonEvent(ApplicationEvent<RequestHandler> e)Processes a given event.voidstart(ApplicationContext ctx)Initialises the handler.voidstop()Terminates the handler.-
Methods inherited from class org.gcube.smartgears.handlers.AbstractHandler
equals, toString
-
-
-
-
Method Detail
-
getName
public abstract String getName()
-
start
public void start(ApplicationContext ctx)
Initialises the handler.- Parameters:
ctx- the servlet context of the managed app.
-
handleRequest
public void handleRequest(RequestEvent e)
Invoked when the container receives a request for a servlet of a managed app.- Parameters:
pipeline- the pipeline in which this handler is registerede- the event
-
handleResponse
public void handleResponse(ResponseEvent e)
Invoked when a servlet of a managed app has produced a response to a request.- Parameters:
pipeline- the pipeline in which this handler is registerede- the event
-
onEvent
public void onEvent(ApplicationEvent<RequestHandler> e)
Description copied from interface:HandlerProcesses a given event.- Specified by:
onEventin interfaceHandler<ApplicationEvent<RequestHandler>>
-
stop
public void stop()
Terminates the handler.
-
-