|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.core.AspectComponent | +--org.objectweb.jac.aspects.naming.NamingAC
Handles the naming aspect within the JAC system.
This aspect component automatically registers all the created
JAC object into the sole instance of NameRepository
.
NameRepository
,
Serialized FormField 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 | |
NamingAC()
Creates a naming aspect component. |
Method Summary | |
Map |
getNameCounters()
Returns the counters used to generate unique names |
String |
nameObject(Object object,
String name)
Name a single object by registering it in the name repository (see the NameRepository class).
|
void |
updateNameCounters(Map counters)
|
void |
whenRemoteInstantiation(Wrappee newInstance,
String name)
This method is upcalled when a new object is instanciated from a remote site. |
Wrappee |
whenSerialized(Wrappee orgObject,
SerializedJacObject finalObject)
Add the name to the SerializedJacObject structure
when serialized.
|
void |
whenUsingNewInstance(Interaction interaction)
Name a new instance using the nameObject() and
generateName() methods. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NamingAC()
It creates the name repository if it does not exist yet.
NameRepository
Method Detail |
public void whenUsingNewInstance(Interaction interaction)
nameObject()
and
generateName()
methods.
whenUsingNewInstance
in interface BaseProgramListener
whenUsingNewInstance
in class AspectComponent
nameObject(Object,String)
,
NameGenerator.generateName(String)
public void whenRemoteInstantiation(Wrappee newInstance, String name)
The name that is passed is the name of the remote reference that has been used to create the object. Thus, the default behavior of the naming aspect is to register the new object into the name repository.
whenRemoteInstantiation
in interface BaseProgramListener
whenRemoteInstantiation
in class AspectComponent
newInstance
- the remotly created new instancename
- the name that was forwarded from the creator hostNameRepository
,
Repository.register(String,Object)
public String nameObject(Object object, String name)
NameRepository
class).
If the repository does not exist, it is created.
object
- the object to namename
- the given name
NameRepository
,
Repository.register(String,Object)
public Map getNameCounters()
public void updateNameCounters(Map counters)
updateNameCounters
in class AspectComponent
public Wrappee whenSerialized(Wrappee orgObject, SerializedJacObject finalObject)
SerializedJacObject
structure
when serialized.
This allows the name to be serialized with a JAC object so
that the object can be named with the same name when deserialized
(see BindingAC
).
whenSerialized
in interface BaseProgramListener
whenSerialized
in class AspectComponent
finalObject
- the structure corresponding to the object
that is being serializedorgObject
- the object being serialized
BindingAC.whenDeserialized(SerializedJacObject,Wrappee)
,
SerializedJacObject.setACInfos(String,Object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |