org.objectweb.kilim.model
Interface ContainerElement

All Superinterfaces:
ComponentElement
All Known Subinterfaces:
Component, ComponentSlot
All Known Implementing Classes:
RtComponent, RtComponentSlot

public interface ContainerElement
extends ComponentElement

Author:
horn ContainerElement is an intermediate interface corresponding to component entities that can contain elements i.e. components and slots. All containier elements have a state that is either "non-initialized" or "initialized". This state has been introduced because instanciation rises difficult and subtile problems which should be solved through precisely defined instanciation stategies. These strategies are usually enforced with the help of instanciation managers which should be executed prior to any access to a value. A container is thus created in the "non initialized" state. Access to the value of an element is only possible on an instanciated element which in turn requires that the container is instanciated. More precisely the evaluation algorithm of component interfaces always starts by looking whether the interface containier is initialized. The general instanciation strategy is invoked if it is not the case. It is the responsability of the instanciation manager to set the container in the "initialized" state. A container is a naming context .

Method Summary
 void addInterface(ComponentInterface aInterface)
          adds an Interface.in the slot.
 Factory getFactory()
          returns the factory used to create the container.
 ComponentInterface getInterface(java.lang.String aName)
          returns the local interface identified by its local name.
 java.util.Iterator getInterfaces()
          returns as an iterator the interfaces declared in the container.
 boolean isComponent()
          returns true if the container is a component.
 boolean isInitialized()
          returns true when the container is in the "initialized" state or not.
 boolean isSlot()
          returns true if the container is a slot.
 void removeInterface(ComponentInterface aElement)
          removes the interface from a component.
 void setInitialized()
          sets the container in the"initialized" state.
 
Methods inherited from interface org.objectweb.kilim.model.ComponentElement
getContainingComponent, getContainingElement, getElementDescription, getLocalName, getQualifiedName, getTemplateDefHierarchy
 

Method Detail

isInitialized

public boolean isInitialized()
returns true when the container is in the "initialized" state or not.

Returns:
boolean

setInitialized

public void setInitialized()
sets the container in the"initialized" state.


getFactory

public Factory getFactory()
returns the factory used to create the container. The result is a CompoonentFactory if the container is a component or a SlotFactory if the container is a slot.

Returns:
Factory

isComponent

public boolean isComponent()
returns true if the container is a component.

Returns:
boolean

isSlot

public boolean isSlot()
returns true if the container is a slot.

Returns:
boolean

getInterfaces

public java.util.Iterator getInterfaces()
returns as an iterator the interfaces declared in the container.

Returns:
Iterator

getInterface

public ComponentInterface getInterface(java.lang.String aName)
                                throws KilimException
returns the local interface identified by its local name.

Parameters:
aName - : the local name of the interface.
Returns:
ComponentInterface : the reference of the interface.
Throws:
KilimException - : generated if aName is null or if no interface exists with the specified name.

addInterface

public void addInterface(ComponentInterface aInterface)
                  throws KilimException
adds an Interface.in the slot.

Parameters:
aInterface - : the interface to be added.
Throws:
KilimException - : generated if aInterface is null or is already present in the slot.

removeInterface

public void removeInterface(ComponentInterface aElement)
                     throws KilimException
removes the interface from a component.

Parameters:
aElement - : the interface to be removed
Throws:
KilimException - : generated if aElement is null, if the component has no interface or if the interface is not defined in the component