org.apache.wink.server.handlers
Class AbstractHandler

java.lang.Object
  extended by org.apache.wink.server.handlers.AbstractHandler
All Implemented Interfaces:
Handler, RequestHandler, ResponseHandler

public abstract class AbstractHandler
extends java.lang.Object
implements RequestHandler, ResponseHandler

Convenience class for implementing a handler that is unaware of the handlers chain. A handler may extend this class and implement any or all of init(Properties), handleRequest(MessageContext) and handleResponse(MessageContext)


Constructor Summary
AbstractHandler()
           
 
Method Summary
protected  void handleRequest(MessageContext context)
          Override this method to handle the request.
 void handleRequest(MessageContext context, HandlersChain chain)
           
protected  void handleResponse(MessageContext context)
          Override this method to handle the response.
 void handleResponse(MessageContext context, HandlersChain chain)
           
 void init(java.util.Properties props)
          Override this method if initialization functionality is required
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractHandler

public AbstractHandler()
Method Detail

handleRequest

public final void handleRequest(MessageContext context,
                                HandlersChain chain)
                         throws java.lang.Throwable
Specified by:
handleRequest in interface RequestHandler
Throws:
java.lang.Throwable

handleResponse

public final void handleResponse(MessageContext context,
                                 HandlersChain chain)
                          throws java.lang.Throwable
Specified by:
handleResponse in interface ResponseHandler
Throws:
java.lang.Throwable

init

public void init(java.util.Properties props)
Override this method if initialization functionality is required

Specified by:
init in interface Handler
See Also:
Handler#init(Properties)}

handleRequest

protected void handleRequest(MessageContext context)
                      throws java.lang.Throwable
Override this method to handle the request. This method releases the responsibility of the user to continue the chain, as it is done automatically at the end of the method invocation

Parameters:
context - the current message context
Throws:
java.lang.Throwable
See Also:
RequestHandler#handleRequest(MessageContext, HandlersChain)}

handleResponse

protected void handleResponse(MessageContext context)
                       throws java.lang.Throwable
Override this method to handle the response. This method releases the responsibility of the user to continue the chain, as it is done automatically at the end of the method invocation

Parameters:
context - the current message context
Throws:
java.lang.Throwable
See Also:
ResponseHandler#handleResponse(MessageContext, HandlersChain)}


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.