org.objectweb.jac.aspects.naming
Class BindingAC

java.lang.Object
  |
  +--org.objectweb.jac.core.AspectComponent
        |
        +--org.objectweb.jac.aspects.naming.BindingAC
All Implemented Interfaces:
BaseProgramListener, Serializable

public class BindingAC
extends AspectComponent

This aspect component implements the default binding policy for the JAC system.

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

See Also:
NamingAC, Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jac.core.AspectComponent
application, blockKeywords, cr, currentConfigMethod, currentImports, firstCall, NOT_SHARED, SHARED, startWeavingCCount, startWeavingCount, startWeavingMethod, startWeavingType, systemListener, wrappers
 
Fields inherited from interface org.objectweb.jac.core.BaseProgramListener
FOUND_OBJECT
 
Constructor Summary
BindingAC()
           
 
Method Summary
 Wrappee whenDeserialized(SerializedJacObject orgObject, Wrappee finalObject)
          Bind a deserialized JAC object.
 void whenObjectMiss(String name)
          This method is upcalled by JAC when an object was seeked into the name repository and was not found.
 Wrappee whenSerialized(Wrappee orgObject, SerializedJacObject finalObject)
          Add the name to the SerializedJacObject when an object that is wrapped by a BindingWrapper serialized.
 
Methods inherited from class org.objectweb.jac.core.AspectComponent
addWrapper, afterApplicationStarted, afterRunningWrapper, afterWrap, afterWrappeeInit, attr, attrdef, beforeConfiguration, beforeReload, beforeRunningWrapper, beforeWrappeeInit, configure, defines, defineTimer, doRegister, doUnregister, error, getAC, getApplication, getBlockKeywords, getConfigurationMethods, getConfigurationMethodsName, getConfigurationMethodsName, getDefaultConfigs, getName, getNameCounters, getWrappers, init, isConfigurationMethod, isSystemListener, onExit, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, setApplication, setAttribute, setAttribute, setAttribute, setSystemListener, simulateUsingNewInstance, unweave, unwrapAll, updateNameCounters, warning, weave, whenClone, whenCloseDisplay, whenConfigured, whenDeleted, whenFree, whenGetObjects, whenNameObject, whenReload, whenRemoteInstantiation, whenTopologyChanged, whenUsingNewClass, whenUsingNewInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindingAC

public BindingAC()
Method Detail

whenDeserialized

public Wrappee whenDeserialized(SerializedJacObject orgObject,
                                Wrappee finalObject)
Bind a deserialized JAC object.

This method takes the name filled by the naming aspect within the serialized infos and wraps the final object by a BindingWrapper so that it can be resolved later on. If the forwarding is disabled for this object, the new object is registered within the repository and is not wrapped by a binding wrapper.

Specified by:
whenDeserialized in interface BaseProgramListener
Overrides:
whenDeserialized in class AspectComponent
Parameters:
orgObject - the JAC object that is being deserialized.
finalObject - the object being deserialized
Returns:
the object being deserialized (usually finalObject but not necessarily)
See Also:
Repository.register(String,Object), NamingAC.whenSerialized(Wrappee,SerializedJacObject), whenDeserialized(SerializedJacObject,Wrappee), SerializedJacObject.getACInfos(String), BindingWrapper

whenSerialized

public Wrappee whenSerialized(Wrappee orgObject,
                              SerializedJacObject finalObject)
Add the name to the SerializedJacObject when an object that is wrapped by a BindingWrapper serialized.

Specified by:
whenSerialized in interface BaseProgramListener
Overrides:
whenSerialized in class AspectComponent
Parameters:
finalObject - the corresponding serialized structure.
orgObject - the object being serialized
Returns:
the object being serialized (usually orgObject, but not necessarily).
See Also:
whenDeserialized(SerializedJacObject,Wrappee), SerializedJacObject.setACInfos(String,Object), BindingWrapper

whenObjectMiss

public void whenObjectMiss(String name)
Description copied from class: AspectComponent
This method is upcalled by JAC when an object was seeked into the name repository and was not found.

The reason of this miss can be multiple. For instance, the persistence aspect may have not already load the object from the storage, or the distribution aspect may need to bind to a remote object. Thus, this method allows the aspects to resolve the object.

By default, this method does nothing.

The final choosen name is a contextual attribute called FOUND_OBJECT.

Specified by:
whenObjectMiss in interface BaseProgramListener
Overrides:
whenObjectMiss in class AspectComponent
Parameters:
name - the name of the object
See Also:
BaseProgramListener.FOUND_OBJECT