| |
|
| java.lang.Object org.mortbay.naming.NamingContext
NamingContext | public class NamingContext implements Context,Cloneable(Code) | | NamingContext
Implementation of Context interface.
Notes
All Names are expected to be Compound, not Composite.
Usage
|
Method Summary | |
protected void | addBinding(Name name, Object obj) Add a name to object binding to this Context. | public Object | addToEnvironment(String propName, Object propVal) | public void | bind(Name name, Object obj) | public void | bind(String name, Object obj) | public Object | clone() | public void | close() | public Name | composeName(Name name, Name prefix) Join two names together. | public String | composeName(String name, String prefix) Join two names together. | public Context | createSubcontext(Name name) | public Context | createSubcontext(String name) | public void | destroySubcontext(String name) | public void | destroySubcontext(Name name) | protected Binding | getBinding(Name name) | protected Binding | getBinding(String name) | public Hashtable | getEnvironment() Get the environment of this Context. | public String | getName() | public String | getNameInNamespace() Get the full name of this Context node
by visiting it's ancestors back to root. | public NameParser | getNameParser(Name name) Return a NameParser for this Context. | public NameParser | getNameParser(String name) Return a NameParser for this Context. | public Context | getParent() | public NamingEnumeration | list(Name name) | public NamingEnumeration | list(String name) | public NamingEnumeration | listBindings(Name name) | public NamingEnumeration | listBindings(String name) | public Object | lookup(Name name) | public Object | lookup(String name) | public Object | lookupLink(Name name) | public Object | lookupLink(String name) | public void | rebind(Name name, Object obj) | public void | rebind(String name, Object obj) | protected void | removeBinding(Name name) | public Object | removeFromEnvironment(String propName) Remove a property from this Context's environment. | public void | rename(Name oldName, Name newName) | public void | rename(String oldName, String newName) | public void | setNameParser(NameParser parser) | public Name | toCanonicalName(Name name) Remove leading or trailing empty components from
name. | public void | unbind(String name) Not supported. | public void | unbind(Name name) Not supported. |
UNLOCK_PROPERTY | final public static String UNLOCK_PROPERTY(Code) | | |
NamingContext | public NamingContext(Hashtable env, String name, Context parent, NameParser parser)(Code) | | Constructor
Parameters: env - environment properties Parameters: name - relative name of this context Parameters: parent - immediate ancestor Context (can be null) Parameters: parser - NameParser for this Context |
NamingContext | public NamingContext(Hashtable env)(Code) | | Creates a new NamingContext instance.
Parameters: env - a Hashtable value |
NamingContext | public NamingContext()(Code) | | Constructor
|
addBinding | protected void addBinding(Name name, Object obj)(Code) | | Add a name to object binding to this Context.
Parameters: name - a Name value Parameters: obj - an Object value |
addToEnvironment | public Object addToEnvironment(String propName, Object propVal) throws NamingException(Code) | | Add an environment setting to this Context
Parameters: propName - name of the property to add Parameters: propVal - value of the property to add propVal or previous value of the property exception: NamingException - if an error occurs |
composeName | public Name composeName(Name name, Name prefix) throws NamingException(Code) | | Join two names together. These are treated as
CompoundNames.
Parameters: name - a Name value Parameters: prefix - a Name value a Name value exception: NamingException - if an error occurs |
composeName | public String composeName(String name, String prefix) throws NamingException(Code) | | Join two names together. These are treated as
CompoundNames.
Parameters: name - a Name value Parameters: prefix - a Name value a Name value exception: NamingException - if an error occurs |
getBinding | protected Binding getBinding(Name name)(Code) | | Get a name to object binding from this Context
Parameters: name - a Name value a Binding value |
getBinding | protected Binding getBinding(String name)(Code) | | Get a name to object binding from this Context
Parameters: name - as a String null or the Binding |
getEnvironment | public Hashtable getEnvironment()(Code) | | Get the environment of this Context.
a copy of the environment of this Context. |
getName | public String getName()(Code) | | Getter for _name
name of this Context (relative, not absolute) |
getNameInNamespace | public String getNameInNamespace() throws NamingException(Code) | | Get the full name of this Context node
by visiting it's ancestors back to root.
NOTE: if this Context has a URL namespace then
the URL prefix will be missing
the full name of this Context exception: NamingException - if an error occurs |
getNameParser | public NameParser getNameParser(Name name)(Code) | | Return a NameParser for this Context.
Parameters: name - a Name value a NameParser value |
getNameParser | public NameParser getNameParser(String name)(Code) | | Return a NameParser for this Context.
Parameters: name - a Name value a NameParser value |
getParent | public Context getParent()(Code) | | Getter for _parent
parent Context |
rebind | public void rebind(String name, Object obj) throws NamingException(Code) | | Overwrite or create a binding from Name to Object
Parameters: name - a String value Parameters: obj - an Object value exception: NamingException - if an error occurs |
removeBinding | protected void removeBinding(Name name)(Code) | | |
removeFromEnvironment | public Object removeFromEnvironment(String propName) throws NamingException(Code) | | Remove a property from this Context's environment.
Parameters: propName - name of property to remove value of property or null if it didn't exist exception: NamingException - if an error occurs |
setNameParser | public void setNameParser(NameParser parser)(Code) | | Setter for _parser
|
toCanonicalName | public Name toCanonicalName(Name name)(Code) | | Remove leading or trailing empty components from
name. Eg "/comp/env/" -> "comp/env"
Parameters: name - the name to normalize normalized name |
|
|
|