org.objectweb.jac.wrappers
Class ForwardingWrapper
java.lang.Object
|
+--org.objectweb.jac.core.Wrapper
|
+--org.objectweb.jac.wrappers.ForwardingWrapper
- All Implemented Interfaces:
- Advice, ConstructorInterceptor, Interceptor, MethodInterceptor, Serializable
- public class ForwardingWrapper
- extends Wrapper
This wrapper forwards the method calls that arrive on the wrappee
to another object. The wrapped methods should be supported both by
the wrappee and the forwardee. Otherwise, an exception is raised.
- Author:
- Renaud Pawlak
- See Also:
ForwardingException
,
Serialized Form
Fields inherited from class org.objectweb.jac.core.Wrapper |
ac, cr |
forwardee
protected Object forwardee
- The forwardee.
ForwardingWrapper
public ForwardingWrapper(AspectComponent ac,
Object forwardee)
- Construct a new forwarding wrapper.
- Parameters:
forwardee
- the object that receives the forwarded calls
getForwardee
public Object getForwardee()
- The getter method for the forwardee.
- Returns:
- the object to which the calls are forwarded
- See Also:
forward(Interaction)
forward
public Object forward(Interaction interaction)
throws ForwardingException
- Forwards all the incoming calls to the forwardee.
The forwardee class must support the wrapped method
prototype. Otherwise, an exception is raised.
- Returns:
- the result of the forwarded method call
ForwardingException
invoke
public Object invoke(MethodInvocation invocation)
throws Throwable
- Specified by:
invoke
in interface MethodInterceptor
- Overrides:
invoke
in class Wrapper
Throwable
construct
public Object construct(ConstructorInvocation invocation)
throws Throwable
- Specified by:
construct
in interface ConstructorInterceptor
- Overrides:
construct
in class Wrapper
Throwable