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, RequestIdHandler, RequestMetrics, RequestValidator

public abstract class RequestHandler extends AbstractHandler implements ApplicationHandler<RequestHandler>
A Handler of RequestEvents and ResponseEvents.

The handler participates in a pipeline 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 pipeline.

Author:
Fabio Simeoni, Luca Frosini (ISTI-CNR)
See Also:
  • Constructor Details

    • RequestHandler

      public RequestHandler()
  • Method Details

    • getName

      public abstract String getName()
    • isUnfiltrable

      public boolean isUnfiltrable()
    • 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:
      e - the request event
    • handleResponse

      public void handleResponse(ResponseEvent e)
      Invoked when a servlet of a managed app has produced a response to a request.
      Parameters:
      e - the response 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>>
      Parameters:
      e - the event to process
    • stop

      public void stop()
      Terminates the handler.