org.objectweb.kilim.model
Interface Component

All Superinterfaces:
ComponentElement, ContainerElement
All Known Implementing Classes:
RtComponent

public interface Component
extends ContainerElement

Author:
horn

Method Summary
 void addController(java.lang.String aName, java.lang.Object aController)
          adds a controller
 void addSubComponent(Component aElement)
          adds a new subcomponent.
 Component fork()
          creates a copy of a component as defined in the template (same elements, same plugs, ....).
 java.lang.Object getController(java.lang.String aName)
          returns a controller identified by its name.
 java.util.Iterator getControllers()
          returns as an iterator the controllersz associated to a component.
 InstanciationMger getInstanciationMger()
          Method getInstanciationMger returns the instanciation manager to be used the component.
 InstanciationMger getInstanciationMgerFromConfiguration()
          sets the instanciation manager from the instanciation strategy defined in the class KilimConfiguration KilimConfiguration
 java.util.Iterator getPlugTos()
          returns as an iterator the slots the component is plugged into.
 ComponentSlot getSlot(java.lang.String aLocalName)
          Method getSlot returns a component slot identified by its local name.
 java.util.Iterator getSlots()
          returns as an iterator the slots defined in the component.
 Component getSubComponent(java.lang.String aName)
          returns a subcomponent identified by its local name.
 java.util.Iterator getSubComponents()
          returns as an iterator the "direct" subcomponents of a component : this method does not recurse and thus only returns the subcomponent directly defined in the component.
 TemplateDescription getTemplate()
          returns the template describing the component.
 void plug(java.lang.String aName, Component aComponent)
          plugs a component into a slot.
 void release()
          releases a component by (1) removing it as a subcomponent of its containing component, (2) unpluging it from all slots it is plugged in, (3) removing its naming context from parent context and factory from parent factory.
 void removeController(java.lang.String aName)
          removes a controller.
 void removeSubComponent(Component aLocalChild)
          removes a "direct" subcomponent : this method only looks for subcomponent directly defined in the component.
 void removeSubComponent(java.lang.String aLocalName)
          removes a "direct" subcomponent : this method only looks for subcomponent directly defined in the component.
 void setInstanciationMger(InstanciationMger aMger)
          sets the instanciation manager to be used for the component.
 void unplug(java.lang.String aName, Component aComponent)
          unplugs a component form a slot.
 
Methods inherited from interface org.objectweb.kilim.model.ContainerElement
addInterface, getFactory, getInterface, getInterfaces, isComponent, isInitialized, isSlot, removeInterface, setInitialized
 
Methods inherited from interface org.objectweb.kilim.model.ComponentElement
getContainingComponent, getContainingElement, getElementDescription, getLocalName, getQualifiedName, getTemplateDefHierarchy
 

Method Detail

getTemplate

public TemplateDescription getTemplate()
returns the template describing the component.

Returns:
TemplateDescription

getSubComponent

public Component getSubComponent(java.lang.String aName)
returns a subcomponent identified by its local name. This methods does not recurse and therefore is not usable to find a subsubcomponent ....

Parameters:
aName - : the local name of a subcomponent.
Returns:
ComponentElement.

getSubComponents

public java.util.Iterator getSubComponents()
returns as an iterator the "direct" subcomponents of a component : this method does not recurse and thus only returns the subcomponent directly defined in the component.

Returns:
Iterator

addSubComponent

public void addSubComponent(Component aElement)
                     throws KilimException
adds a new subcomponent.

Parameters:
aElement - : the component to be added as a subcomponent.
Throws:
KilimException - : generated if aElement is null or is already a subcomponent.

removeSubComponent

public void removeSubComponent(java.lang.String aLocalName)
                        throws KilimException
removes a "direct" subcomponent : this method only looks for subcomponent directly defined in the component.

Parameters:
aLocalName - : the local name of the subcomponent to be removed. This method does nothing more than just "unregistering" AElement as a subcomponent
Throws:
KilimException - : generated if aElement is null, or if the aElement is not a direct subcomponent

removeSubComponent

public void removeSubComponent(Component aLocalChild)
                        throws KilimException
removes a "direct" subcomponent : this method only looks for subcomponent directly defined in the component.

Parameters:
aLocalChild - : the subcomponent to be removed. This method does nothing more than just "unregistering" AElement as a subcomponent
Throws:
KilimException - : generated if aElement is null, or if the aElement is not a direct subcomponent

getSlot

public ComponentSlot getSlot(java.lang.String aLocalName)
                      throws KilimException
Method getSlot returns a component slot identified by its local name.

Parameters:
aLocalName - : the local name of the slot
Returns:
Slot
Throws:
KilimException - :

getSlots

public java.util.Iterator getSlots()
returns as an iterator the slots defined in the component. Each element is thus an implementation of the ComponentSlot interface and an instance of the RtComponentSlot.

Returns:
Iterator : every member provided by the iterator implements the ComponentSlot interface and more precisly is an instance of the RtComponentSlot class.

getPlugTos

public java.util.Iterator getPlugTos()
returns as an iterator the slots the component is plugged into. The type of each element is thus a subtype of ComponentSlot.

Returns:
Iterator: every member provided by the iterator implements the Component interface and more precisly is an instance of the RtComponent class.

plug

public void plug(java.lang.String aName,
                 Component aComponent)
          throws KilimException
plugs a component into a slot.

Parameters:
aName - : name of the slot.
aComponent - : the component to be plugged in the slot.
Throws:
KilimException - : generated if aName or aComponent is null, if aName does not identifiy a component slot.

unplug

public void unplug(java.lang.String aName,
                   Component aComponent)
            throws KilimException
unplugs a component form a slot.

Parameters:
aName - : name of the slot.
aComponent - : the component to be unplugged from the slot .
Throws:
KilimException - : generated if aName or aComponent is null, if aName does not identifiy a component slot or if aCompoonent is not plugged in the slot.

fork

public Component fork()
               throws KilimException
creates a copy of a component as defined in the template (same elements, same plugs, ....). It does not perform any operations executed at runtime on the component on which the fork is invoked.

Returns:
Component
Throws:
KilimException - :

release

public void release()
             throws KilimException
releases a component by (1) removing it as a subcomponent of its containing component, (2) unpluging it from all slots it is plugged in, (3) removing its naming context from parent context and factory from parent factory. This method however does not unbind DIRECTLY bound ports (i.e. bound through a bindValue or a bindProvider method).

Throws:
KilimException - :

getInstanciationMgerFromConfiguration

public InstanciationMger getInstanciationMgerFromConfiguration()
                                                        throws KilimException
sets the instanciation manager from the instanciation strategy defined in the class KilimConfiguration KilimConfiguration

Returns:
InstanciationMgerI
Throws:
KilimException - :

setInstanciationMger

public void setInstanciationMger(InstanciationMger aMger)
                          throws KilimException
sets the instanciation manager to be used for the component. It overrides the manager defined in the instanciation strategy.

Parameters:
aMger - : the instanciation manager to be used
Throws:
KilimException - :

getInstanciationMger

public InstanciationMger getInstanciationMger()
Method getInstanciationMger returns the instanciation manager to be used the component.

Returns:
InstanciationMger

addController

public void addController(java.lang.String aName,
                          java.lang.Object aController)
                   throws KilimException
adds a controller

Parameters:
aName - : the name of the controller.
aController - : the controller to be added.
Throws:
KilimException - : generated if aName is null.

removeController

public void removeController(java.lang.String aName)
                      throws KilimException
removes a controller.

Parameters:
aName - : the name of the controller to be removed.
Throws:
KilimException - : generated if aName is null.

getController

public java.lang.Object getController(java.lang.String aName)
                               throws KilimException
returns a controller identified by its name.

Parameters:
aName - : the name of the controller.
Returns:
Object
Throws:
KilimException - : generated if aName is null.

getControllers

public java.util.Iterator getControllers()
returns as an iterator the controllersz associated to a component.

Returns:
Iterator