com.continuuity.http
Interface HandlerHook

All Known Implementing Classes:
AbstractHandlerHook

public interface HandlerHook

Interface that needs to be implemented to intercept handler method calls.


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.
 

Method Detail

preCall

boolean preCall(org.jboss.netty.handler.codec.http.HttpRequest request,
                HttpResponder responder,
                HandlerInfo handlerInfo)
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.

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

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. 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.

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