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

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

public class ChainedProcessingInvocationHandler
extends Object
implements 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.

Version:
$Revision: $
Author:
ALR

Constructor Summary
ChainedProcessingInvocationHandler(Object delegate, ChainableProcessor processor)
           
ChainedProcessingInvocationHandler(Object delegate, ChainableProcessor[] handlerChain)
           
 
Method Summary
 Object getDelegate()
           
protected  ChainableProcessor[] getHandlerChain()
           
protected  int getNextHandlerIndex()
           
 Object invoke(Object proxy, Method method, Object[] args)
          Provides a base invocation mechanism under which the request is passed along to the delegate instance
 Object invokeNext(Object proxy, Method method, 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(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(Object delegate,
                                          ChainableProcessor processor)

ChainedProcessingInvocationHandler

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

invokeNext

public Object invokeNext(Object proxy,
                         Method method,
                         Object[] args)
                  throws 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:
Throwable

reset

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


invoke

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

Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

getDelegate

public Object getDelegate()

setDelegate

protected void setDelegate(Object delegate)

getHandlerChain

protected ChainableProcessor[] getHandlerChain()

setHandlerChain

protected void setHandlerChain(ChainableProcessor[] handlerChain)

getNextHandlerIndex

protected int getNextHandlerIndex()


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.