|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectweb.jonathan.libs.kernel.JComponent
org.objectweb.jonathan.libs.kernel.JContextFactory.JContext
Implementation of Context.
| Nested Class Summary | |
protected class |
JContextFactory.JContext.InnerEnumeration
|
| Nested classes inherited from class org.objectweb.jonathan.apis.kernel.Context |
Context.NO_VALUE |
| Field Summary | |
protected Context |
enclosing_context
The enclosing context (scope) |
protected int |
id
Identifies the target context |
| Fields inherited from class org.objectweb.jonathan.libs.kernel.JComponent |
int_value, reference, type, value |
| Fields inherited from interface org.objectweb.jonathan.apis.kernel.Context |
NO_VALUE |
| Constructor Summary | |
protected |
JContextFactory.JContext()
Constructs a new JContext instance. |
protected |
JContextFactory.JContext(Context _scope)
Creates a new JContext with the specified enclosing context. |
| Method Summary | |
void |
acquire()
Acquires the target context. |
Element |
addElement(Name _name,
java.lang.Class _type,
int _value)
Adds an element to the target context. |
Element |
addElement(Name _name,
java.lang.Class _type,
java.lang.Object _value)
Adds an element in the target context. |
Element |
addElement(Name _name,
Component _component)
Adds an element in the target context. |
Element |
addElement(java.lang.String name,
java.lang.Class type,
int value,
char separator)
Adds an element to the target context. |
Element |
addElement(java.lang.String name,
java.lang.Class type,
java.lang.Object value,
char separator)
Adds an element to the target context. |
Element |
addElement(java.lang.String _name,
Component _component,
char separator)
Adds an element to the target context. |
protected Element |
addLocalElement(JContextFactory.ContextElement element,
boolean _check_types)
Adds an Element to the Context if no other exists with the same name. |
Context |
addOrGetContext(Name _name)
|
Context |
addOrGetContext(java.lang.String _name,
char _separator)
|
protected JContextFactory.JContext |
addOrGetLocalContext(java.lang.String _id)
|
Component |
duplicate()
|
protected void |
finalize()
|
Component |
getComponent(java.lang.String name,
char separator)
Returns the component contained in the element registered in the target context under the name name. |
Element |
getElement(Name _name)
may need to be synchronized |
protected Element |
getElement(java.lang.String name,
boolean local)
Returns the local element identified by name, or null if none exists. |
Element |
getElement(java.lang.String _name,
char _separator)
Returns the element in the target context identified by name,
null if no element is registered under name name. |
java.util.Enumeration |
getElements()
Returns an enumeration of the elements found in the target context. |
java.lang.Object |
getFactoryValue(java.lang.String name,
char separator)
|
int |
getIntValue(Name _name)
Returns the value of the element registered in the target context under the name name. |
int |
getIntValue(java.lang.String name,
char separator)
Returns the value of the element registered in the target context under the name name. |
Context |
getScope()
Returns the scope of the target context; |
java.lang.Object |
getValue(java.lang.String name,
char separator)
Returns the value of the element registered in the target context under the name name. |
protected Element |
handleScopeElement(Element element)
|
Component |
internalFork()
|
protected Component |
newComponent(java.lang.Class type,
int value)
|
protected Component |
newComponent(java.lang.Class type,
java.lang.Object value)
|
protected JContextFactory.ContextElement |
newContextElement(Context _container)
Creates a new empty context element. |
protected JContextFactory.ContextElement |
newContextElement(java.lang.String name,
Component component,
Context container)
Creates a new context element, using the provided parameters to initialize it. |
protected void |
recycle()
|
void |
release()
Releases the target context, releasing all the resources it uses, if no one still uses it. |
void |
reset()
needs to be synchronized. |
Context |
setScope(Context scope)
Sets the scope of the target context; |
java.lang.String |
toString()
|
| Methods inherited from class org.objectweb.jonathan.libs.kernel.JComponent |
fork, getComponent, getFactoryValue, getIntValue, getReference, getType, getValue, getValue, setReference |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.objectweb.jonathan.apis.kernel.Component |
fork, getComponent, getFactoryValue, getIntValue, getReference, getType, getValue, getValue, setReference |
| Field Detail |
protected Context enclosing_context
protected final int id
| Constructor Detail |
protected JContextFactory.JContext()
protected JContextFactory.JContext(Context _scope)
_scope - a Context.| Method Detail |
public final Element getElement(Name _name)
getElement in interface ComponentgetElement in class JComponent_name -
_name, if any.public final int getIntValue(Name _name)
Contextname.
A call to getIntValue(name) is equivalent to
if the provided name actually corresponds to an
element. If it is not the case,
getElement(name).getIntValue()Integer.MAX_VALUE is returned.
getIntValue in interface Context_name - the name of the element whose value is seeked;
Integer.MAX_VALUE
public final Element getElement(java.lang.String _name,
char _separator)
Contextname,
null if no element is registered under name name.
This method is equivalent to getElement(Name), except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
getElement in interface Context_name - a string representing the name of the seeked element;_separator - the separator character used to parse name;
public final Component getComponent(java.lang.String name,
char separator)
Contextname.
This method is equivalent to getComponent(Name), except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
getComponent in interface Contextname - the name of the element whose component is seeked;separator - the separator character used to parse name;
public final java.lang.Object getFactoryValue(java.lang.String name,
char separator)
throws JonathanException
JonathanException
public final java.lang.Object getValue(java.lang.String name,
char separator)
Contextname.
This method is equivalent to getValue(Name), except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
getValue in interface Contextname - the name of the element whose value is seeked;separator - the separator character used to parse name;
NO_VALUE.
public final int getIntValue(java.lang.String name,
char separator)
Contextname.
This method is equivalent to getIntValue(Name), except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
getIntValue in interface Contextname - the name of the element whose value is seeked;separator - the separator character used to parse name;
Integer.MAX_VALUE
public final Element addElement(Name _name,
Component _component)
throws JonathanException
Context
addElement in interface Context_name - the name of the element to be added;_component - the component to be added;
JonathanException - if something goes wrong (usually, a type
exception).
public final Element addElement(Name _name,
java.lang.Class _type,
java.lang.Object _value)
throws JonathanException
Context
addElement in interface Context_name - the name of the object to be added;_type - the type of the object to be added;_value - the object to be added.
JonathanException - if something goes wrong (usually, a type
exception).
public final Element addElement(Name _name,
java.lang.Class _type,
int _value)
throws JonathanException
ContextClass is one of int.class, short.class, char.class,
or byte.class.
addElement in interface Context_name - the name of the element to be added;_value - the integer value of the element to be added;
JonathanException - if something goes wrong (usually, a type
exception).
public final Element addElement(java.lang.String _name,
Component _component,
char separator)
throws JonathanException
ContextaddElement(Name,Component), except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
addElement in interface Context_name - a string representing the name of the added element;_component - the component to be added;separator - the separator character used to parse name;
JonathanException - if something goes wrong (usually, a type
exception).
public final Element addElement(java.lang.String name,
java.lang.Class type,
java.lang.Object value,
char separator)
throws JonathanException
ContextaddElement(Name,Class,Object), except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
addElement in interface Contextname - a string representing the name of the seeked element;type - the type of the object to be added;value - the object to be added;separator - the separator character used to parse name;
JonathanException - if something goes wrong (usually, a type
exception).
public final Element addElement(java.lang.String name,
java.lang.Class type,
int value,
char separator)
throws JonathanException
ContextaddElement(Name,Class,int), except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
addElement in interface Contextname - a string representing the name of the seeked element;value - the integer value of the element to be added;separator - the separator character used to parse name;
JonathanException - if something goes wrong (usually, a type
exception).
public Context addOrGetContext(java.lang.String _name,
char _separator)
throws JonathanException
addOrGetContext in interface ContextJonathanException
public Context addOrGetContext(Name _name)
throws JonathanException
addOrGetContext in interface ContextJonathanExceptionpublic java.util.Enumeration getElements()
Context
getElements in interface Contextpublic Context getScope()
Context
getScope in interface Contextpublic Component internalFork()
internalFork in interface ForkableinternalFork in class JComponentpublic Context setScope(Context scope)
Context
setScope in interface Contextscope - the new scope of the target context;
public void reset()
reset in interface Contextreset in class JComponentpublic void acquire()
Context
acquire in interface Contextpublic void release()
Context
release in interface Contextpublic Component duplicate()
duplicate in class JComponentpublic java.lang.String toString()
toString in class JComponentprotected void recycle()
protected Element getElement(java.lang.String name,
boolean local)
name - a local name;local - if true, don't search the enclosing context.
protected Element addLocalElement(JContextFactory.ContextElement element,
boolean _check_types)
throws JonathanException
must be called in a synchronized context
JonathanExceptionprotected JContextFactory.ContextElement newContextElement(Context _container)
protected final JContextFactory.ContextElement newContextElement(java.lang.String name,
Component component,
Context container)
name - a name;
protected Component newComponent(java.lang.Class type,
java.lang.Object value)
protected Component newComponent(java.lang.Class type,
int value)
protected void finalize()
throws java.lang.Throwable
java.lang.Throwable
protected JContextFactory.JContext addOrGetLocalContext(java.lang.String _id)
throws JonathanException
JonathanExceptionprotected Element handleScopeElement(Element element)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||