|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectweb.jonathan.libs.kernel.decoders.JAlias
The alias runtime component implementation.
| Field Summary | |
protected Element |
alias
the referenced element |
protected Name |
alias_name
|
protected Element |
reference
|
| Constructor Summary | |
JAlias(Name _alias_name)
|
|
JAlias(java.lang.String _alias_name,
char separator)
|
|
| Method Summary | |
Component |
fork()
"Forks" a copy of the target component. |
Component |
getComponent(Name _name)
Returns the component contained in the element registered in the target component under the name name. |
Element |
getElement(Name name)
Returns the element in the target component identified by name,
null if no element exists under name name. |
java.lang.Object |
getFactoryValue()
|
int |
getIntValue()
Returns the value of the target component, if its class is an integer class. |
Element |
getReference()
Returns a distinguished element referencing the target component, if any, null otherwise. |
java.lang.Class |
getType()
Returns the type of the target component, as a Class. |
java.lang.Object |
getValue()
Returns the value of the target component, if its type is an object reference type. |
java.lang.Object |
getValue(Name _name)
Returns the value of the element registered in the target context under the name name. |
protected void |
initialize()
JAlias specific initialization code. |
Component |
internalFork()
|
Element |
setReference(Element _reference)
Sets an element containing the target component. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Element alias
protected Name alias_name
protected Element reference
| Constructor Detail |
public JAlias(java.lang.String _alias_name,
char separator)
public JAlias(Name _alias_name)
| Method Detail |
public java.lang.Class getType()
Component
getType in interface Componentpublic java.lang.Object getValue()
Component
If the target component is of an integral type,
NO_VALUE} is returned.
getValue in interface Componentpublic int getIntValue()
ComponentIf the target component has an object reference type, Integer.MAX_VALUE is returned.
getIntValue in interface Component
public java.lang.Object getFactoryValue()
throws JonathanException
getFactoryValue in interface ComponentJonathanExceptionpublic Element getReference()
Component
getReference in interface Componentpublic Element setReference(Element _reference)
Component
setReference in interface Component_reference - the new element referencing the target component.
public java.lang.String toString()
protected final void initialize()
Element (but don't instantiate its value!). Used
used internally by JComponent.
public Component internalFork()
internalFork in interface Forkablepublic Component fork()
ComponentFor basic components, this operation simply duplicates the component structure, but the value is still shared.
In the configuration framework, components contain a specification of their value (in the form of an assemblage, atom, alias... description). The fork() method is used to duplicate the specification, but not the value. It may thus be used to obtain several instances of a component, using getValue() on the returned component.
When the target component is a context, the returned component is a new context, roughly containing the forked versions of the target context's components.
If the target context contains an alias, and if the target T of this alias is in the scope of the context, then the target of the forked alias is a forked instance of T. But if the target is outside the scope of the context, then the target of the forked alias is T itself. The context thus defines a set of components that will be actually duplicated, all links outside the context being preserved.
The same rule applies for assemblages, and other "container" components. For instance, consider an assemblage 'A' made of factory 'F' and configuration 'C', 'C' containing an atom 'At', an alias 'In' to At, and an alias 'Out' to a component 'K' outside 'A'. Then the forked version of 'A' is a new assemblage made of a copy of 'F' and a new configuration containing a copy 'At2' of 'At', an alias 'In2' to 'At2', and an alias 'Out2' to 'K'.
Aliases are treated specifically. Calling the fork() method on an alias is like calling the same method on its target.
fork in interface Componentpublic Element getElement(Name name)
Componentname,
null if no element exists under name name.
getElement in interface Componentname - the name of the element to be retrieved;
public final Component getComponent(Name _name)
Componentname.
A call to getComponent(name) is equivalent to
getElement(name).getComponent() if the provided name actually
corresponds to an element. If it is not the case, null is returned.
getComponent in interface Component_name - the name of the element whose component is seeked;
public final java.lang.Object getValue(Name _name)
Componentname.
A call to getValue(name) is equivalent to
getElement(name).getValue() if the provided name actually
corresponds to an element. If it is not the case,
NO_VALUE is returned.
getValue in interface Component_name - the name of the element whose value is seeked;
NO_VALUE.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||