JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.naming
Class BindingWrapper

java.lang.Object
  |
  +--org.objectweb.jac.core.Wrapper
        |
        +--org.objectweb.jac.aspects.naming.BindingWrapper
All Implemented Interfaces:
Serializable

public class BindingWrapper
extends Wrapper

This wrapper class binds an object to the actual named object by forwarder.

BindingWrapper wraps the JAC object that that has not been resolved yet by the binding aspect. When a call is performed on the wrappee, the binder wrapper gets the actual JAC object that corresponds to the logical name by asking the name repository of the naming aspect. Then, it creates a forwarding wrapper to this object and replaces itself with it.

The binding aspect uses the naming aspect. Do not try to use it alone.

Author:
Renaud Pawlak
See Also:
ForwardingWrapper, Serialized Form

Field Summary
protected  String logicalName
          The name of the Jac object the binber must bind to.
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac
 
Constructor Summary
BindingWrapper(AspectComponent ac, String logicalName)
          Construct a new binding wrapper.
 
Method Summary
 Object bind(Interaction interaction)
          This wrapping method binds the wrappee.
 String getLogicalName()
          The getter method for the Jac object's name (role method).
 
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

logicalName

protected String logicalName
The name of the Jac object the binber must bind to.

Constructor Detail

BindingWrapper

public BindingWrapper(AspectComponent ac,
                      String logicalName)
Construct a new binding wrapper.

Parameters:
logicalName - the name of the wrappee within the naming aspect
Method Detail

getLogicalName

public String getLogicalName()
The getter method for the Jac object's name (role method).

Returns:
the name

bind

public Object bind(Interaction interaction)
            throws BindingErrorException
This wrapping method binds the wrappee.

Binds the wrappee to its actual location by creating a new forwarder wrapper to wrap it. This wrapping method is called only once since the binder wrapper unwraps itself once the new wrapper is created.

BindingErrorException
See Also:
ForwardingWrapper

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli