org.objectweb.easybeans.component
Class ComponentRegistry

java.lang.Object
  extended by org.objectweb.easybeans.component.ComponentRegistry

public class ComponentRegistry
extends java.lang.Object

Registry that manages components. It allows to get components.

Author:
Florent Benoit

Field Summary
private  java.util.Map<java.lang.String,EZBComponent> components
          Map of components.
Name <--> Implementation of the component
private  JLog logger
          Logger.
 
Constructor Summary
ComponentRegistry()
          Constructor.
 
Method Summary
 EZBComponent getComponent(java.lang.String componentName)
          Allow to get a reference on another component.
 java.lang.String getComponentName(EZBComponent component)
           
 void register(java.lang.String componentName, EZBComponent component)
          Register a component.
 void unregister(EZBComponent component)
          Unregister a component.
 void unregister(java.lang.String componentName)
          Unregister a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private JLog logger
Logger.


components

private java.util.Map<java.lang.String,EZBComponent> components
Map of components.
Name <--> Implementation of the component

Constructor Detail

ComponentRegistry

public ComponentRegistry()
Constructor.

Method Detail

register

public void register(java.lang.String componentName,
                     EZBComponent component)
              throws EZBComponentException
Register a component.

Parameters:
componentName - the name of the component to register
component - the component to register.
Throws:
EZBComponentException - if registering fails.

unregister

public void unregister(java.lang.String componentName)
                throws EZBComponentException
Unregister a component.

Parameters:
componentName - the component name to unregister.
Throws:
EZBComponentException - if unregistering fails.

unregister

public void unregister(EZBComponent component)
                throws EZBComponentException
Unregister a component.

Parameters:
component - the instance of the component to unregister.
Throws:
EZBComponentException - if unregistering fails.

getComponent

public EZBComponent getComponent(java.lang.String componentName)
Allow to get a reference on another component.

Parameters:
componentName - the name of the component
Returns:
the component.

getComponentName

public java.lang.String getComponentName(EZBComponent component)
Parameters:
component - EZBComponent instance.
Returns:
Returns the component name from the EZBComponent instance.