org.eclipse.swordfish.internal.core.util
Class RegistryImpl<T>

java.lang.Object
  extended by org.eclipse.swordfish.internal.core.util.RegistryImpl<T>
All Implemented Interfaces:
ReadOnlyRegistry<T>, Registry<T>, org.springframework.beans.factory.DisposableBean, org.springframework.osgi.context.BundleContextAware
Direct Known Subclasses:
ConfigurationConsumerRegistry, EventHandlerRegistry, InterceptorExceptionListenerRegistry, InterceptorRegistry, PollableConfigurationSourceRegistry

public class RegistryImpl<T>
extends java.lang.Object
implements Registry<T>, org.springframework.osgi.context.BundleContextAware, org.springframework.beans.factory.DisposableBean


Constructor Summary
RegistryImpl()
           
 
Method Summary
 void destroy()
           
 java.util.Set<T> getKeySet()
          Read access to the components for which properties are registered.
 java.util.Map<java.lang.String,?> getProperties(T key)
          Read access to the property maps.
 void register(T key, java.util.Map<java.lang.String,?> properties)
          Perform registration of an item with its properties.
 void setBundleContext(org.osgi.framework.BundleContext bundleContext)
           
 void unregister(T key, java.util.Map<java.lang.String,?> properties)
          Unregister an item.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryImpl

public RegistryImpl()
Method Detail

register

public void register(T key,
                     java.util.Map<java.lang.String,?> properties)
              throws SwordfishException
Description copied from interface: Registry
Perform registration of an item with its properties.

Specified by:
register in interface Registry<T>
Parameters:
key - The key i.e. the component for which properties are registered.
properties - The properties of the registered item. Must not be null, but if there are no properties, an empty Map must be provided.
Throws:
SwordfishException - risen in case of double registration of the same item, an invalid item, or an invalid properties argument.

unregister

public void unregister(T key,
                       java.util.Map<java.lang.String,?> properties)
                throws SwordfishException
Description copied from interface: Registry
Unregister an item.

Specified by:
unregister in interface Registry<T>
Parameters:
key - - to be unregistered. When the item is not registered, nothing happens.
Throws:
SwordfishException - if an item cannot be unregistered due to the internal state of the system.

getKeySet

public java.util.Set<T> getKeySet()
Description copied from interface: ReadOnlyRegistry
Read access to the components for which properties are registered.

Specified by:
getKeySet in interface ReadOnlyRegistry<T>
Returns:
the keys of the registry, i.e. the components registered.

getProperties

public java.util.Map<java.lang.String,?> getProperties(T key)
Description copied from interface: ReadOnlyRegistry
Read access to the property maps.

Specified by:
getProperties in interface ReadOnlyRegistry<T>
Parameters:
key - the component for which the properties are registerd.
Returns:
the properties for the specified component as unmodifiable Map. A return value of null indicates that a component has not been registered. A component registered with no properties will provide an empty Map.

setBundleContext

public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
Specified by:
setBundleContext in interface org.springframework.osgi.context.BundleContextAware

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
java.lang.Exception