org.mortbay.jndi
public class NamingContext extends Object implements Context, Cloneable
Implementation of Context interface.
All Names are expected to be Compound, not Composite.
| Nested Class Summary | |
|---|---|
| class | NamingContext.BindingEnumeration BindingEnumeration
Implementation of NamingEnumeration NotesUsed to return results of Context.listBindings(); Usage |
| class | NamingContext.NameEnumeration NameEnumeration
Implementation of NamingEnumeration interface. |
| Field Summary | |
|---|---|
| static Enumeration | EMPTY_ENUM |
| static String | IMMUTABLE_PROPERTY |
| protected Hashtable | _bindings |
| protected Hashtable | _env |
| protected String | _name |
| protected Context | _parent |
| protected NameParser | _parser |
| Constructor Summary | |
|---|---|
| NamingContext(Hashtable env, String name, Context parent, NameParser parser)
Constructor
| |
| NamingContext(Hashtable env)
Creates a new NamingContext instance.
| |
| NamingContext()
Constructor
| |
| Method Summary | |
|---|---|
| protected void | addBinding(Name name, Object obj)
Add a name to object binding to this Context.
|
| Object | addToEnvironment(String propName, Object propVal)
Add an environment setting to this Context
|
| void | bind(Name name, Object obj)
Bind a name to an object
|
| void | bind(String name, Object obj)
Bind a name (as a String) to an object
|
| Object | clone()
Clone this NamingContext
|
| void | close()
Do nothing
|
| Name | composeName(Name name, Name prefix) Join two names together. |
| String | composeName(String name, String prefix) Join two names together. |
| Context | createSubcontext(Name name)
Create a context as a child of this one
|
| Context | createSubcontext(String name)
Create a Context as a child of this one
|
| void | destroySubcontext(String name)
Not supported
|
| void | destroySubcontext(Name name)
Not supported
|
| protected Binding | getBinding(Name name)
Get a name to object binding from this Context
|
| protected Binding | getBinding(String name)
Get a name to object binding from this Context
|
| Hashtable | getEnvironment()
Get the environment of this Context.
|
| String | getName()
Getter for _name
|
| String | getNameInNamespace()
Get the full name of this Context node
by visiting it's ancestors back to root.
|
| NameParser | getNameParser(Name name)
Return a NameParser for this Context.
|
| NameParser | getNameParser(String name)
Return a NameParser for this Context.
|
| Context | getParent()
Getter for _parent
|
| NamingEnumeration | list(Name name)
List all names bound at Context named by Name
|
| NamingEnumeration | list(String name)
List all names bound at Context named by Name
|
| NamingEnumeration | listBindings(Name name)
List all Bindings present at Context named by Name
|
| NamingEnumeration | listBindings(String name)
List all Bindings at Name
|
| Object | lookup(Name name)
Lookup a binding by name
|
| Object | lookup(String name)
Lookup binding of an object by name
|
| Object | lookupLink(Name name)
Lookup link bound to name
|
| Object | lookupLink(String name)
Lookup link bound to name
|
| void | rebind(Name name, Object obj)
Overwrite or create a binding
|
| void | rebind(String name, Object obj)
Overwrite or create a binding from Name to Object
|
| Object | removeFromEnvironment(String propName)
Remove a property from this Context's environment.
|
| void | rename(Name oldName, Name newName)
Not supported
|
| void | rename(String oldName, String newName)
Not supported
|
| void | setNameParser(NameParser parser)
Setter for _parser
|
| Name | toCanonicalName(Name name)
Remove leading or trailing empty components from
name. |
| void | unbind(String name)
Not supported.
|
| void | unbind(Name name)
Not supported.
|
Parameters: env environment properties name relative name of this context parent immediate ancestor Context (can be null) parser NameParser for this Context
NamingContext instance.
Parameters: env a Hashtable value
Parameters: name a Name value obj an Object value
Parameters: propName name of the property to add propVal value of the property to add
Returns: propVal or previous value of the property
Throws: NamingException if an error occurs
Parameters: name Name of the object obj object to bind
Throws: NamingException if an error occurs
Parameters: name a String value obj an Object value
Throws: NamingException if an error occurs
Returns: copy of this NamingContext
Throws: CloneNotSupportedException if an error occurs
Throws: NamingException if an error occurs
Parameters: name a Name value prefix a Name value
Returns: a Name value
Throws: NamingException if an error occurs
Parameters: name a Name value prefix a Name value
Returns: a Name value
Throws: NamingException if an error occurs
Parameters: name a Name value
Returns: a Context value
Throws: NamingException if an error occurs
Parameters: name a String value
Returns: a Context value
Throws: NamingException if an error occurs
Parameters: name name of subcontext to remove
Throws: NamingException if an error occurs
Parameters: name name of subcontext to remove
Throws: NamingException if an error occurs
Parameters: name a Name value
Returns: a Binding value
Parameters: name as a String
Returns: null or the Binding
Returns: a copy of the environment of this Context.
Returns: name of this Context (relative, not absolute)
Returns: the full name of this Context
Throws: NamingException if an error occurs
Parameters: name a Name value
Returns: a NameParser value
Parameters: name a Name value
Returns: a NameParser value
Returns: parent Context
Parameters: name a Name value
Returns: a NamingEnumeration value
Throws: NamingException if an error occurs
Parameters: name a Name value
Returns: a NamingEnumeration value
Throws: NamingException if an error occurs
Parameters: name a Name value
Returns: a NamingEnumeration value
Throws: NamingException if an error occurs
Parameters: name a String value
Returns: a NamingEnumeration value
Throws: NamingException if an error occurs
Parameters: name name of bound object
Throws: NamingException if an error occurs
Parameters: name name of bound object
Returns: object bound to name
Throws: NamingException if an error occurs
Parameters: name name of link binding
Returns: LinkRef or plain object bound at name
Throws: NamingException if an error occurs
Parameters: name name of link binding
Returns: LinkRef or plain object bound at name
Throws: NamingException if an error occurs
Parameters: name a Name value obj an Object value
Throws: NamingException if an error occurs
Parameters: name a String value obj an Object value
Throws: NamingException if an error occurs
Parameters: propName name of property to remove
Returns: value of property or null if it didn't exist
Throws: NamingException if an error occurs
Parameters: oldName a Name value newName a Name value
Throws: NamingException if an error occurs
Parameters: oldName a Name value newName a Name value
Throws: NamingException if an error occurs
Parameters: name the name to normalize
Returns: normalized name
Parameters: name a String value
Throws: NamingException if an error occurs
Parameters: name a String value
Throws: NamingException if an error occurs