org.apache.beehive.netui.pageflow.interceptor.request
Class RequestInterceptor

Object
  extended by AbstractInterceptor
      extended by RequestInterceptor
All Implemented Interfaces:
Serializable, Interceptor
Direct Known Subclasses:
AbstractClientRequestInterceptor, TreeCRI

public abstract class RequestInterceptor
extends AbstractInterceptor

A request interceptor, which can run before and/or after a request. Request interceptors are configured in the <request-interceptors> element of WEB-INF/beehive-netui-config.xml.

See Also:
Serialized Form

Constructor Summary
RequestInterceptor()
           
 
Method Summary
protected  void cancelRequest(RequestInterceptorContext context)
          Cancel the request.
 void postInvoke(InterceptorContext context, InterceptorChain chain)
          Callback invoked after the request is processed.
abstract  void postRequest(RequestInterceptorContext context, InterceptorChain chain)
          Callback invoked after the request is processed.
 void preInvoke(InterceptorContext context, InterceptorChain chain)
          Callback invoked before the request is processed.
abstract  void preRequest(RequestInterceptorContext context, InterceptorChain chain)
          Callback invoked before the request is processed.
 
Methods inherited from class AbstractInterceptor
getConfig, init
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestInterceptor

public RequestInterceptor()
Method Detail

preRequest

public abstract void preRequest(RequestInterceptorContext context,
                                InterceptorChain chain)
                         throws InterceptorException
Callback invoked before the request is processed. During this method, cancelRequest(org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptorContext) may be called to cancel further request processing. InterceptorChain.continueChain() is called to invoke the rest of the interceptor chain, anywhere within this method (e.g., at the end, or within a try/finally).

Throws:
InterceptorException

preInvoke

public void preInvoke(InterceptorContext context,
                      InterceptorChain chain)
               throws InterceptorException
Callback invoked before the request is processed. preRequest(org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain) may be used instead.

Parameters:
context - the interception context
chain - the chain of interceptors
Throws:
InterceptorException - an exception thrown when an error occurs during interception

postRequest

public abstract void postRequest(RequestInterceptorContext context,
                                 InterceptorChain chain)
                          throws InterceptorException
Callback invoked after the request is processed. InterceptorChain.continueChain() should be called to invoke the rest of the interceptor chain, anywhere within this method (e.g., at the end, or within a try/finally).

Throws:
InterceptorException

postInvoke

public void postInvoke(InterceptorContext context,
                       InterceptorChain chain)
                throws InterceptorException
Callback invoked after the request is processed. postRequest(org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain) may be used instead.

Parameters:
context - the interceptor context
chain - the chain of interceptors
Throws:
InterceptorException - an exception thrown when an error occurs during interception

cancelRequest

protected void cancelRequest(RequestInterceptorContext context)
Cancel the request. After this is called, no further processing will happen in the request.

Parameters:
context - the current RequestInterceptorContext.