org.jboss.ejb3.common.proxy.spi
Class ChainedProcessingInvocationHandler

java.lang.Object
  extended by org.jboss.ejb3.common.proxy.spi.ChainedProcessingInvocationHandler
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class ChainedProcessingInvocationHandler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

ChainedProcessingInvocationHandler A Chain of Processors which may be invoked in succession. At the end of the chain is an underlying delegate instance to be invoked via reflection.


Constructor Summary
ChainedProcessingInvocationHandler(java.lang.Object delegate, ChainableProcessor processor)
           
ChainedProcessingInvocationHandler(java.lang.Object delegate, ChainableProcessor[] handlerChain)
           
 
Method Summary
 java.lang.Object getDelegate()
           
protected  ChainableProcessor[] getHandlerChain()
           
protected  int getNextHandlerIndex()
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Provides a base invocation mechanism under which the request is passed along to the delegate instance
 java.lang.Object invokeNext(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Invokes the next processor in the chain with the specified arguments.
 void reset()
          Resets the internal counter for the next processor in the chain
protected  void setDelegate(java.lang.Object delegate)
           
protected  void setHandlerChain(ChainableProcessor[] handlerChain)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainedProcessingInvocationHandler

public ChainedProcessingInvocationHandler(java.lang.Object delegate,
                                          ChainableProcessor processor)

ChainedProcessingInvocationHandler

public ChainedProcessingInvocationHandler(java.lang.Object delegate,
                                          ChainableProcessor[] handlerChain)
Method Detail

invokeNext

public java.lang.Object invokeNext(java.lang.Object proxy,
                                   java.lang.reflect.Method method,
                                   java.lang.Object[] args)
                            throws java.lang.Throwable
Invokes the next processor in the chain with the specified arguments. In the event we've reached the end of the chain, the underlying delegate will be invoked via reflection

Parameters:
proxy -
method -
args -
Returns:
Throws:
java.lang.Throwable

reset

public void reset()
Resets the internal counter for the next processor in the chain


invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Provides a base invocation mechanism under which the request is passed along to the delegate instance

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

getDelegate

public java.lang.Object getDelegate()

setDelegate

protected void setDelegate(java.lang.Object delegate)

getHandlerChain

protected ChainableProcessor[] getHandlerChain()

setHandlerChain

protected void setHandlerChain(ChainableProcessor[] handlerChain)

getNextHandlerIndex

protected int getNextHandlerIndex()