JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.wrappers
Class ForwardingWrapper

java.lang.Object
  |
  +--org.objectweb.jac.core.Wrapper
        |
        +--org.objectweb.jac.wrappers.ForwardingWrapper
All Implemented Interfaces:
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

Field Summary
protected  Object forwardee
          The forwardee.
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac
 
Constructor Summary
ForwardingWrapper(AspectComponent ac, Object forwardee)
          Construct a new forwarding wrapper.
 
Method Summary
 Object forward(Interaction interaction)
          Forwards all the incoming calls to the forwardee.
 Object getForwardee()
          The getter method for the forwardee.
 
Methods inherited from class org.objectweb.jac.core.Wrapper
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, setAspectComponent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

forwardee

protected Object forwardee
The forwardee.

Constructor Detail

ForwardingWrapper

public ForwardingWrapper(AspectComponent ac,
                         Object forwardee)
Construct a new forwarding wrapper.

Parameters:
forwardee - the object that receives the forwarded calls
Method Detail

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

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli