org.gcube.smartgears.handlers.application
Class RequestHandler

java.lang.Object
  extended by org.gcube.smartgears.handlers.AbstractHandler
      extended by org.gcube.smartgears.handlers.application.RequestHandler
All Implemented Interfaces:
ApplicationHandler<RequestHandler>, Handler<ApplicationEvent<RequestHandler>>
Direct Known Subclasses:
RequestValidator

public abstract class RequestHandler
extends AbstractHandler
implements ApplicationHandler<RequestHandler>

A Handler of RequestEvents and ResponseEvents.

The handler participates in a ApplicationPipeline of 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 the ApplicationPipeline ApplicationPipeline#forward(ApplicationEvent).

Author:
Fabio Simeoni
See Also:
RequestEvent, ResponseEvent, ApplicationPipeline

Constructor Summary
RequestHandler()
           
 
Method Summary
 void handleRequest(RequestEvent e)
          Invoked when the container receives a request for a servlet of a managed app.
 void handleResponse(ResponseEvent e)
          Invoked when a servlet of a managed app has produced a response to a request.
 void onEvent(ApplicationEvent<RequestHandler> e)
          Processes a given event.
 void start(ApplicationContext ctx)
          Initialises the handler.
 void stop()
          Terminates the handler.
 
Methods inherited from class org.gcube.smartgears.handlers.AbstractHandler
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequestHandler

public RequestHandler()
Method Detail

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 registered
e - 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 registered
e - the event

onEvent

public void onEvent(ApplicationEvent<RequestHandler> e)
Description copied from interface: Handler
Processes a given event.

Specified by:
onEvent in interface Handler<ApplicationEvent<RequestHandler>>

stop

public void stop()
Terminates the handler.



Copyright © 2014. All Rights Reserved.