org.jboss.media.util.registry
Class MapRegistry

java.lang.Object
  extended byorg.jboss.media.util.registry.MapRegistry
All Implemented Interfaces:
Registry (src)

public class MapRegistry
extends java.lang.Object
implements Registry (src)

A synchronized Map based registry with non-null keys or values.


Constructor Summary
MapRegistry()
           
MapRegistry(java.util.Map initialEntries)
           
 
Method Summary
 void bind(java.lang.Object key, java.lang.Object value)
          Binds the given key with the given value.
 java.util.Iterator keyIterator()
          Obtains an Iterator for all the keys in the registry.
 java.lang.Object lookup(java.lang.Object key)
          Lookups a value with the given key.
 void rebind(java.lang.Object key, java.lang.Object value)
          Rebinds the given key with the given value.
 java.lang.Object unbind(java.lang.Object key)
          Unbinds a value with the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapRegistry

public MapRegistry()

MapRegistry

public MapRegistry(java.util.Map initialEntries)
            throws ObjectAlreadyBoundException (src) 
Method Detail

bind

public void bind(java.lang.Object key,
                 java.lang.Object value)
          throws ObjectAlreadyBoundException (src) 
Description copied from interface: Registry (src)
Binds the given key with the given value.

Specified by:
bind in interface Registry (src)
Throws:
ObjectAlreadyBoundException (src) - if there is another value already bound for that key.

rebind

public void rebind(java.lang.Object key,
                   java.lang.Object value)
Description copied from interface: Registry (src)
Rebinds the given key with the given value.

Specified by:
rebind in interface Registry (src)

unbind

public java.lang.Object unbind(java.lang.Object key)
                        throws ObjectNotBoundException (src) 
Description copied from interface: Registry (src)
Unbinds a value with the given key.

Specified by:
unbind in interface Registry (src)
Returns:
value unbound.
Throws:
ObjectNotBoundException (src) - if there is no value bound to the key.

lookup

public java.lang.Object lookup(java.lang.Object key)
                        throws ObjectNotBoundException (src) 
Description copied from interface: Registry (src)
Lookups a value with the given key.

Specified by:
lookup in interface Registry (src)
Returns:
value obtained.
Throws:
ObjectNotBoundException (src) - if there is no value bound to the key.

keyIterator

public java.util.Iterator keyIterator()
Description copied from interface: Registry (src)
Obtains an Iterator for all the keys in the registry.

Specified by:
keyIterator in interface Registry (src)
Returns:
keys iterator.