|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.objectweb.jonathan.libs.kernel.JContextFactory.JContext
Implementation of Context.
| Inner Class Summary | |
protected class |
JContextFactory.JContext.InnerEnumeration
|
| Inner 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 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(Element _element)
Adds an element to the target context. |
Element |
addElement(Name _name,
Class _type,
int _value)
Adds an element to the target context. |
Element |
addElement(Name _name,
Class _type,
Object _value)
Adds an element in the target context. |
Element |
addElement(String name,
Class type,
int value,
char separator)
Adds an element to the target context. |
Element |
addElement(String name,
Class type,
Object value,
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. |
protected JContextFactory.JContext |
addOrGetContext(Name _name)
|
protected JContextFactory.JContext |
addOrGetLocalContext(String _id)
|
protected void |
finalize()
|
Element |
getElement(Name _name)
may need to be synchronized |
protected Element |
getElement(String name,
boolean local)
Returns the local element identified by name, or null if none exists. |
Element |
getElement(String _name,
char _separator)
Returns the element in the target context identified by name,
null if no element is registered under name name.
|
Enumeration |
getElements()
Returns an enumeration of the elements found in the target context. |
int |
getIntValue(Name _name)
Returns the value of the element registered in the target context under the name name.
|
int |
getIntValue(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; |
Object |
getValue(Name _name)
Returns the value of the element registered in the target context under the name name.
|
Object |
getValue(String name,
char separator)
Returns the value of the element registered in the target context under the name name.
|
protected JContextFactory.ContextElement |
newContextElement()
Creates a new empty context element. |
protected JContextFactory.ContextElement |
newContextElement(String name,
Class type,
Object value,
int int_value)
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; |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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 Element getElement(Name _name)
getElement in interface Context_name - _name, if any.public Object getValue(Name _name)
Contextname.
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 Contextorg.objectweb.jonathan.apis.kernel.Contextname - the name of the element whose value is seeked;NO_VALUE.public 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 Contextorg.objectweb.jonathan.apis.kernel.Contextname - the name of the element whose value is seeked;Integer.MAX_VALUE
public Element getElement(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 Contextorg.objectweb.jonathan.apis.kernel.Contextname - a string representing the name of the seeked element;separator - the separator character used to parse name;
public Object getValue(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 Contextorg.objectweb.jonathan.apis.kernel.Contextname - the name of the element whose value is seeked;separator - the separator character used to parse name;NO_VALUE.
public int getIntValue(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 Contextorg.objectweb.jonathan.apis.kernel.Contextname - the name of the element whose value is seeked;separator - the separator character used to parse name;Integer.MAX_VALUE
public Element addElement(Name _name,
Class _type,
Object _value)
throws JonathanException
ContextaddElement in interface Contextorg.objectweb.jonathan.apis.kernel.Contextname - 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 Element addElement(Name _name,
Class _type,
int _value)
throws JonathanException
ContextClass is one of int.class, short.class, char.class,
or byte.class.addElement in interface Contextorg.objectweb.jonathan.apis.kernel.Contextname - 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 Element addElement(Element _element)
throws JonathanException
ContextaddElement in interface Contextorg.objectweb.jonathan.apis.kernel.Contextelement - the element to be added.JonathanException - if something goes wrong (usually, a type
exception).
public Element addElement(String name,
Class type,
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 Contextorg.objectweb.jonathan.apis.kernel.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 Element addElement(String name,
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 Contextorg.objectweb.jonathan.apis.kernel.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 Enumeration getElements()
ContextgetElements in interface Contextorg.objectweb.jonathan.apis.kernel.Contextpublic Context getScope()
ContextgetScope in interface Contextorg.objectweb.jonathan.apis.kernel.Contextpublic Context setScope(Context scope)
ContextsetScope in interface Contextorg.objectweb.jonathan.apis.kernel.Contextscope - the new scope of the target context;public void reset()
reset in interface Contextpublic void acquire()
Contextacquire in interface Contextpublic void release()
Contextrelease in interface Contextprotected void recycle()
protected Element getElement(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
name - the name of the new Element.type - the declared type of the new Element.value - the value of the Element to be inserted.JonathanException - protected JContextFactory.ContextElement newContextElement()
protected JContextFactory.ContextElement newContextElement(String name,
Class type,
Object value,
int int_value)
name - a name;type - a type;value - an object reference value;int_value - an integer value;
protected void finalize()
throws Throwable
finalize in class Object
protected JContextFactory.JContext addOrGetContext(Name _name)
throws JonathanException
protected JContextFactory.JContext addOrGetLocalContext(String _id)
throws JonathanException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||