Class JavaColonNamespaceBindings<T>
- Type Parameters:
T
- the binding object
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
T>
Manages the bindings for a
#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
Nested ClassesModifier and TypeClassDescriptionstatic interface
Provides the type names for the bindings.Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionJavaColonNamespaceBindings
(NamingConstants.JavaColonNamespace namespace, JavaColonNamespaceBindings.ClassNameProvider<T> nameProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a binding.boolean
hasObjectWithPrefix
(String contextName) Collection<? extends NameClassPair>
listInstances
(String contextName) Looks up a binding.void
Removes a binding.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
JavaColonNamespaceBindings
public JavaColonNamespaceBindings(NamingConstants.JavaColonNamespace namespace, JavaColonNamespaceBindings.ClassNameProvider<T> nameProvider)
-
-
Method Details
-
bind
Adds a binding.- Parameters:
name
- the namespace name (e.g., "jdbc/ds")binding
- the binding object
-
unbind
Removes a binding.- Parameters:
name
- the namespace name (e.g., "jdbc/ds")
-
lookup
Looks up a binding.- Parameters:
name
- the name passed tobind(java.lang.String, T)
- Returns:
- the binding, or null if unavailable
- Throws:
NotContextException
- if a lookup attempts to use a binding as a context nameNamingException
-
hasObjectWithPrefix
-
listInstances
- Throws:
NotContextException
- if a lookup attempts to use a binding as a context nameNamingException
- See Also:
-