com.ibm.ws.container.service.naming

Class JavaColonNamespaceBindings<T>

  1. java.lang.Object
  2. extended byjava.util.AbstractMap<K,V>
  3. extended byjava.util.HashMap<java.lang.String,T>
  4. extended bycom.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>

  1. public class JavaColonNamespaceBindings<T>
  2. extends java.util.HashMap<java.lang.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:
Serialized Form

Nested Class Summary

Modifier and Type Class and Description
  1. static interface
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
  1. void
bind(java.lang.String name,T binding)
Adds a binding.
  1. boolean
hasObjectWithPrefix(java.lang.String contextName)
  1. java.util.Collection<? extends javax.naming.NameClassPair>
listInstances(java.lang.String contextName)
  1. T
lookup(java.lang.String name)
Looks up a binding.
  1. void
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

  1. public JavaColonNamespaceBindings( NamingConstants.JavaColonNamespace namespace,
  2. JavaColonNamespaceBindings.ClassNameProvider<T> nameProvider)

Method Detail

bind

  1. public void bind(java.lang.String name,
  2. T binding)
Adds a binding.
Parameters:
name - the namespace name (e.g., "jdbc/ds")
binding - the binding object

unbind

  1. public void unbind(java.lang.String name)
Removes a binding.
Parameters:
name - the namespace name (e.g., "jdbc/ds")

lookup

  1. public T lookup(java.lang.String name)
  2. 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

  1. public boolean hasObjectWithPrefix( java.lang.String contextName)
  2. throws javax.naming.NamingException
Throws:
javax.naming.NamingException
See Also:

listInstances

  1. public java.util.Collection<? extends javax.naming.NameClassPair> listInstances( java.lang.String contextName)
  2. 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: