com.ibm.ws.container.service.naming
Class JavaColonNamespaceBindings<T>
- java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<java.lang.String,T>
com.ibm.ws.container.service.naming.JavaColonNamespaceBindings<T>
Type Parameters:
T
- the binding object
All implemented interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,T>
- public class JavaColonNamespaceBindings<T>
- extends java.util.HashMap<java.lang.String,T>
#JavaColonNamingHelper
. This object is
not thread-safe: accesses to the HashMap.put(K, V)
and HashMap.remove(java.lang.Object)
methods
must be protected by a write lock, and access to all other methods must be
protected by a read lock.
See Also:
Nested Class Summary
Modifier and Type | Class and Description |
---|---|
|
JavaColonNamespaceBindings.ClassNameProvider<T>
Provides the type names for the bindings.
|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary
Constructor and Description |
---|
JavaColonNamespaceBindings(NamingConstants.JavaColonNamespace namespace,JavaColonNamespaceBindings.ClassNameProvider<T> nameProvider)
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
bind(java.lang.String name,T binding)
Adds a binding.
|
|
hasObjectWithPrefix(java.lang.String contextName)
|
|
listInstances(java.lang.String contextName)
|
lookup(java.lang.String name)
Looks up a binding.
|
|
|
unbind(java.lang.String name)
Removes a binding.
|
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail
JavaColonNamespaceBindings
- public JavaColonNamespaceBindings( NamingConstants.JavaColonNamespace namespace,
- JavaColonNamespaceBindings.ClassNameProvider<T> nameProvider)
Method Detail
bind
- public void bind(java.lang.String name,
- T binding)
Adds a binding.
Parameters:
name
- the namespace name (e.g., "jdbc/ds") binding
- the binding object unbind
- public void unbind(java.lang.String name)
Removes a binding.
Parameters:
name
- the namespace name (e.g., "jdbc/ds") lookup
- public T lookup(java.lang.String name)
- throws javax.naming.NamingException
Looks up a binding.
Parameters:
name
- the name passed to bind(java.lang.String, T)
Returns:
the binding, or null if unavailable
Throws:
javax.naming.NotContextException
- if a lookup attempts to use a binding as a
context name javax.naming.NamingException
hasObjectWithPrefix
- public boolean hasObjectWithPrefix( java.lang.String contextName)
- throws javax.naming.NamingException
Throws:
javax.naming.NamingException
See Also:
listInstances
- public java.util.Collection<? extends javax.naming.NameClassPair> listInstances( java.lang.String contextName)
- throws javax.naming.NamingException
Throws:
javax.naming.NotContextException
- if a lookup attempts to use a binding as a
context name javax.naming.NamingException
See Also: