com.continuuity.http
Class AbstractHandlerHook

java.lang.Object
  extended by com.continuuity.http.AbstractHandlerHook
All Implemented Interfaces:
HandlerHook

public abstract class AbstractHandlerHook
extends Object
implements HandlerHook

A base implementation of HandlerHook that provides no-op for both HandlerHook.preCall(org.jboss.netty.handler.codec.http.HttpRequest, HttpResponder, HandlerInfo) and HandlerHook.postCall(org.jboss.netty.handler.codec.http.HttpRequest, org.jboss.netty.handler.codec.http.HttpResponseStatus, HandlerInfo) methods.


Constructor Summary
AbstractHandlerHook()
           
 
Method Summary
 void postCall(org.jboss.netty.handler.codec.http.HttpRequest request, org.jboss.netty.handler.codec.http.HttpResponseStatus status, HandlerInfo handlerInfo)
          postCall is run after a handler method call is made.
 boolean preCall(org.jboss.netty.handler.codec.http.HttpRequest request, HttpResponder responder, HandlerInfo handlerInfo)
          preCall is run before a handler method call is made.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractHandlerHook

public AbstractHandlerHook()
Method Detail

preCall

public boolean preCall(org.jboss.netty.handler.codec.http.HttpRequest request,
                       HttpResponder responder,
                       HandlerInfo handlerInfo)
Description copied from interface: HandlerHook
preCall is run before a handler method call is made. If any of the preCalls throw exception or return false then no other subsequent preCalls will be called and the request processing will be terminated, also no postCall hooks will be called.

Specified by:
preCall in interface HandlerHook
Parameters:
request - HttpRequest being processed.
responder - HttpResponder to send response.
handlerInfo - Info on handler method that will be called.
Returns:
true if the request processing can continue, otherwise the hook should send response and return false to stop further processing.

postCall

public void postCall(org.jboss.netty.handler.codec.http.HttpRequest request,
                     org.jboss.netty.handler.codec.http.HttpResponseStatus status,
                     HandlerInfo handlerInfo)
Description copied from interface: HandlerHook
postCall is run after a handler method call is made. If any of the postCalls throw and exception then the remaining postCalls will still be called. If the handler method was not called then postCall hooks will not be called.

Specified by:
postCall in interface HandlerHook
Parameters:
request - HttpRequest being processed.
status - Http status returned to the client.
handlerInfo - Info on handler method that was called.


Copyright 2013 Continuuity, Inc. Licensed under the Apache License, Version 2.0