org.sape.carbon.core.component.proxy
Class ProxyInvoker

java.lang.Object
  |
  +--org.sape.carbon.core.component.proxy.ProxyInvoker
All Implemented Interfaces:
Decorator, Interceptor

public class ProxyInvoker
extends Object
implements Interceptor

This class provides the final invocation on the targe class. This class or something similar should always be at the end of interceptor chains that are configured to execute the supplied invocations.

Copyright 2003 Sapient

Since:
carbon 2.0
Version:
$Revision: 1.6 $($Author: ghinkl $ / $Date: 2003/10/14 16:40:35 $)
Author:
Greg Hinkle, March 2003

Constructor Summary
ProxyInvoker()
           
 
Method Summary
 Class[] getExposedInterfaces()
          This should return the list of interfaces that a decorator wishes to expose through the component proxy.
 Object invoke(Invocation invocation)
          Handles the delegation to the target of the component call.
 void setComponentReference(Component component)
          Called after creation to pass a reference to the component to each of its decorators.
 void setNextInterceptor(Interceptor interceptor)
          This method sets the next interceptor as the next in the chain from the current interceptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyInvoker

public ProxyInvoker()
Method Detail

setNextInterceptor

public void setNextInterceptor(Interceptor interceptor)
This method sets the next interceptor as the next in the chain from the current interceptor.

Specified by:
setNextInterceptor in interface Interceptor
Parameters:
interceptor - the next interceptor in the chain

invoke

public Object invoke(Invocation invocation)
              throws Throwable
Handles the delegation to the target of the component call. The target will either be the Functional Implementation object or one of the interceptors (delegates).

Specified by:
invoke in interface Interceptor
Parameters:
invocation - the invocation to execute
Returns:
the results of the invocation's execution
Throws:
Throwable - indicates an error in the invokation chain

getExposedInterfaces

public Class[] getExposedInterfaces()
This should return the list of interfaces that a decorator wishes to expose through the component proxy. This is used by the component factory to determine what interfaces the component proxy will implement.

Specified by:
getExposedInterfaces in interface Decorator
Returns:
Class[] an array of interfaces

setComponentReference

public void setComponentReference(Component component)
Called after creation to pass a reference to the component to each of its decorators. The component reference should not be used within this method because not all other interceptors have this reference yet and they may rely on this reference thus leading to null pointer exceptions.

Specified by:
setComponentReference in interface Decorator
Parameters:
component - a reference to the component that this interceptor is assisting


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.