Implementation of Context interface.
All Names are expected to be Compound, not Composite.
| Modifier and Type | Class and Description |
|---|---|
| public class | NamingContext.
BindingEnumeration Implementation of NamingEnumeration Notes Used to return results of Context.listBindings(); Usage |
| public class |
| Modifier and Type | Field and Description |
|---|---|
| protected Hashtable | |
| protected Hashtable | |
| protected String | |
| protected Context | |
| protected NameParser | |
| public static final Enumeration | |
| public static final String | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public | NamingContext(Hashtable<K, V>
environment properties env, String relative name of this context name, Context immediate ancestor Context (can be null) parent, NameParser NameParser for this Context parser)Constructor |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addBinding(Name
a name, Object Name valuean obj)Object valueAdd a name to object binding to this Context. |
| public Object | Returns: propVal or previous value of the propertyname of the property to add propName, Object value of the property to add propVal)Implements javax. |
| public void | bind(Name
Name of the object name, Object object to bind obj)Implements javax. |
| public void | bind(String
a name, Object String valuean obj)Object valueImplements javax. |
| public Object | Returns: copy of this NamingContextOverrides java. |
| public void | |
| public Name | Returns: aName valuea name, Name Name valuea prefix)Name valueImplements javax. |
| public String | Returns: aName valuea name, String Name valuea prefix)Name valueImplements javax. |
| public Context | Returns: aContext valuea name)Name valueImplements javax. |
| public Context | Returns: aContext valuea name)String valueImplements javax. |
| public void | destroySubcontext(String
name of subcontext to remove name)Implements javax. |
| public void | destroySubcontext(Name
name of subcontext to remove name)Implements javax. |
| protected Binding | Returns: aBinding valuea name)Name valueGet a name to object binding from this Context |
| protected Binding | Returns: null or the Bindingas a String name)Get a name to object binding from this Context |
| public Hashtable | Returns: a copy of the environment of this Context.Implements javax. |
| public String | |
| public String | Returns: the full name of this ContextImplements javax. |
| public NameParser | Returns: aNameParser valuea name)Name valueImplements javax. |
| public NameParser | Returns: aNameParser valuea name)Name valueImplements javax. |
| public Context | |
| private boolean | |
| public NamingEnumeration | Returns: aNamingEnumeration valuea name)Name valueImplements javax. |
| public NamingEnumeration | Returns: aNamingEnumeration valuea name)Name valueImplements javax. |
| public NamingEnumeration | Returns: aNamingEnumeration valuea name)Name valueImplements javax. |
| public NamingEnumeration | Returns: aNamingEnumeration valuea name)String valueImplements javax. |
| public Object | lookup(Name
name of bound object name)Implements javax. |
| public Object | Returns: object bound to namename of bound object name)Implements javax. |
| public Object | Returns: LinkRef or plain object bound at namename of link binding name)Implements javax. |
| public Object | Returns: LinkRef or plain object bound at namename of link binding name)Implements javax. |
| public void | rebind(Name
a name, Object Name valuean obj)Object valueImplements javax. |
| public void | rebind(String
a name, Object String valuean obj)Object valueImplements javax. |
| protected void | |
| public Object | Returns: value of property or null if it didn't existname of property to remove propName)Implements javax. |
| public void | rename(Name
a oldName, Name Name valuea newName)Name valueImplements javax. |
| public void | rename(String
a oldName, String Name valuea newName)Name valueImplements javax. |
| public void | |
| public Name | Returns: normalized namethe name to normalize name)Remove leading or trailing empty components from name. |
| public void | |
| public void |
| _bindings | back to summary |
|---|---|
| protected Hashtable<K, V> _bindings | |
| _env | back to summary |
|---|---|
| protected Hashtable<K, V> _env | |
| _name | back to summary |
|---|---|
| protected String _name | |
| _parent | back to summary |
|---|---|
| protected Context _parent | |
| _parser | back to summary |
|---|---|
| protected NameParser _parser | |
| EMPTY_ENUM | back to summary |
|---|---|
| public static final Enumeration<E> EMPTY_ENUM | |
| LOCK_PROPERTY | back to summary |
|---|---|
| public static final String LOCK_PROPERTY | |
| UNLOCK_PROPERTY | back to summary |
|---|---|
| public static final String UNLOCK_PROPERTY | |
| NamingContext | back to summary |
|---|---|
| public NamingContext(Hashtable<K, V> env, String name, Context parent, NameParser parser) Constructor
| |
| NamingContext | back to summary |
|---|---|
| public NamingContext(Hashtable<K, V> env) Creates a new
| |
| NamingContext | back to summary |
|---|---|
| public NamingContext() Constructor | |
| addBinding | back to summary |
|---|---|
| protected void addBinding(Name name, Object obj) Add a name to object binding to this Context. | |
| addToEnvironment | back to summary |
|---|---|
| public Object addToEnvironment(String propName, Object propVal) throws NamingException Implements javax. Add an environment setting to this Context
| |
| bind | back to summary |
|---|---|
| public void bind(Name name, Object obj) throws NamingException Implements javax. Bind a name to an object
| |
| bind | back to summary |
|---|---|
| public void bind(String name, Object obj) throws NamingException Implements javax. Bind a name (as a String) to an object
| |
| clone | back to summary |
|---|---|
| public Object clone() throws CloneNotSupportedException Overrides java. Clone this NamingContext
| |
| close | back to summary |
|---|---|
| public void close() throws NamingException Implements javax. Do nothing
| |
| composeName | back to summary |
|---|---|
| public Name composeName(Name name, Name prefix) throws NamingException Implements javax. Join two names together. These are treated as CompoundNames.
| |
| composeName | back to summary |
|---|---|
| public String composeName(String name, String prefix) throws NamingException Implements javax. Join two names together. These are treated as CompoundNames.
| |
| createSubcontext | back to summary |
|---|---|
| public Context createSubcontext(Name name) throws NamingException Implements javax. Create a context as a child of this one
| |
| createSubcontext | back to summary |
|---|---|
| public Context createSubcontext(String name) throws NamingException Implements javax. Create a Context as a child of this one
| |
| destroySubcontext | back to summary |
|---|---|
| public void destroySubcontext(String name) throws NamingException Implements javax. Not supported
| |
| destroySubcontext | back to summary |
|---|---|
| public void destroySubcontext(Name name) throws NamingException Implements javax. Not supported
| |
| getBinding | back to summary |
|---|---|
| protected Binding getBinding(Name name) Get a name to object binding from this Context | |
| getBinding | back to summary |
|---|---|
| protected Binding getBinding(String name) Get a name to object binding from this Context | |
| getEnvironment | back to summary |
|---|---|
| public Hashtable Implements javax. Get the environment of this Context.
| |
| getName | back to summary |
|---|---|
| public String getName() Getter for _name
| |
| getNameInNamespace | back to summary |
|---|---|
| public String getNameInNamespace() throws NamingException Implements javax. 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
| |
| getNameParser | back to summary |
|---|---|
| public NameParser getNameParser(Name name) Implements javax. Return a NameParser for this Context.
| |
| getNameParser | back to summary |
|---|---|
| public NameParser getNameParser(String name) Implements javax. Return a NameParser for this Context.
| |
| getParent | back to summary |
|---|---|
| public Context getParent() Getter for _parent
| |
| isLocked | back to summary |
|---|---|
| private boolean isLocked() | |
| list | back to summary |
|---|---|
| public NamingEnumeration Implements javax. List all names bound at Context named by Name
| |
| list | back to summary |
|---|---|
| public NamingEnumeration Implements javax. List all names bound at Context named by Name
| |
| listBindings | back to summary |
|---|---|
| public NamingEnumeration Implements javax. List all Bindings present at Context named by Name
| |
| listBindings | back to summary |
|---|---|
| public NamingEnumeration Implements javax. List all Bindings at Name
| |
| lookup | back to summary |
|---|---|
| public Object lookup(Name name) throws NamingException Implements javax. Lookup a binding by name
| |
| lookup | back to summary |
|---|---|
| public Object lookup(String name) throws NamingException Implements javax. Lookup binding of an object by name
| |
| lookupLink | back to summary |
|---|---|
| public Object lookupLink(Name name) throws NamingException Implements javax. Lookup link bound to name
| |
| lookupLink | back to summary |
|---|---|
| public Object lookupLink(String name) throws NamingException Implements javax. Lookup link bound to name
| |
| rebind | back to summary |
|---|---|
| public void rebind(Name name, Object obj) throws NamingException Implements javax. Overwrite or create a binding
| |
| rebind | back to summary |
|---|---|
| public void rebind(String name, Object obj) throws NamingException Implements javax. Overwrite or create a binding from Name to Object
| |
| removeBinding | back to summary |
|---|---|
| protected void removeBinding(Name name) | |
| removeFromEnvironment | back to summary |
|---|---|
| public Object removeFromEnvironment(String propName) throws NamingException Implements javax. Remove a property from this Context's environment.
| |
| rename | back to summary |
|---|---|
| public void rename(Name oldName, Name newName) throws NamingException Implements javax. Not supported
| |
| rename | back to summary |
|---|---|
| public void rename(String oldName, String newName) throws NamingException Implements javax. Not supported
| |
| setNameParser | back to summary |
|---|---|
| public void setNameParser(NameParser parser) Setter for _parser | |
| toCanonicalName | back to summary |
|---|---|
| public Name toCanonicalName(Name name) Remove leading or trailing empty components from name. Eg "/comp/env/" -> "comp/env" | |
| unbind | back to summary |
|---|---|
| public void unbind(String name) throws NamingException Implements javax. Not supported.
| |
| unbind | back to summary |
|---|---|
| public void unbind(Name name) throws NamingException Implements javax. Not supported.
| |
Implementation of NamingEnumeration
Used to return results of Context.listBindings();
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Enumeration |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | hasMore()
Implements javax. |
| public boolean | hasMoreElements()
Implements java. |
| public Object | next()
Implements javax. |
| public Object | nextElement()
Implements java. |
| _delegate | back to summary |
|---|---|
| pack-priv Enumeration<E> _delegate | |
| BindingEnumeration | back to summary |
|---|---|
| public BindingEnumeration(Enumeration<E> e) | |
| close | back to summary |
|---|---|
| public void close() throws NamingException Implements javax. Doc from javax. Closes this enumeration.
After this method has been invoked on this enumeration, the
enumeration becomes invalid and subsequent invocation of any of
its methods will yield undefined results.
This method is intended for aborting an enumeration to free up resources.
If an enumeration proceeds to the end--that is, until
This method indicates to the service provider that it is free
to release resources associated with the enumeration, and can
notify servers to cancel any outstanding requests. The
| |
| hasMore | back to summary |
|---|---|
| public boolean hasMore() throws NamingException Implements javax. Doc from javax. Determines whether there are any more elements in the enumeration. This method allows naming exceptions encountered while determining whether there are more elements to be caught and handled by the application.
| |
| hasMoreElements | back to summary |
|---|---|
| public boolean hasMoreElements() Implements java. Doc from java. Tests if this enumeration contains more elements.
| |
| next | back to summary |
|---|---|
| public Object next() throws NamingException Implements javax. Doc from javax. Retrieves the next element in the enumeration. This method allows naming exceptions encountered while retrieving the next element to be caught and handled by the application.
Note that
| |
| nextElement | back to summary |
|---|---|
| public Object nextElement() Implements java. Doc from java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
| |
Implementation of NamingEnumeration interface.
Used for returning results of Context.list();
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Enumeration |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | hasMore()
Implements javax. |
| public boolean | hasMoreElements()
Implements java. |
| public Object | next()
Implements javax. |
| public Object | nextElement()
Implements java. |
| _delegate | back to summary |
|---|---|
| pack-priv Enumeration<E> _delegate | |
| NameEnumeration | back to summary |
|---|---|
| public NameEnumeration(Enumeration<E> e) | |
| close | back to summary |
|---|---|
| public void close() throws NamingException Implements javax. Doc from javax. Closes this enumeration.
After this method has been invoked on this enumeration, the
enumeration becomes invalid and subsequent invocation of any of
its methods will yield undefined results.
This method is intended for aborting an enumeration to free up resources.
If an enumeration proceeds to the end--that is, until
This method indicates to the service provider that it is free
to release resources associated with the enumeration, and can
notify servers to cancel any outstanding requests. The
| |
| hasMore | back to summary |
|---|---|
| public boolean hasMore() throws NamingException Implements javax. Doc from javax. Determines whether there are any more elements in the enumeration. This method allows naming exceptions encountered while determining whether there are more elements to be caught and handled by the application.
| |
| hasMoreElements | back to summary |
|---|---|
| public boolean hasMoreElements() Implements java. Doc from java. Tests if this enumeration contains more elements.
| |
| next | back to summary |
|---|---|
| public Object next() throws NamingException Implements javax. Doc from javax. Retrieves the next element in the enumeration. This method allows naming exceptions encountered while retrieving the next element to be caught and handled by the application.
Note that
| |
| nextElement | back to summary |
|---|---|
| public Object nextElement() Implements java. Doc from java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
| |