org.objectweb.kilim.model.instanciation
Interface InstanciationStrategy

All Known Implementing Classes:
DefaultInstanciationStrategy

public interface InstanciationStrategy

This class is a simple container dedicated to the definition of instanciation strategies. It is used by the component factory to find the instanciation manager to be associated to each application component. It is possible to redefine a default instanciation manager, and to define per template managers and per instance managers. The factory uses the following look up strategy. The search is stopped as soon as a manager is found. the component factory first looks for a manager explicitely associated to the component. If none can be found, it then looks for a manager explicitely associated to the component template. If none can be found, it recursively looks for a manager explicitely associated to super templates. If none can be found it looks for a default manager. No null value can be returned, since this class defines a NAryPreInstanciationMger as default instanciation manager and no null value is accepted by the setDefaultMger().

Author:
horn

Method Summary
 InstanciationMger getDefaultMger()
          Method getDefaultMger returns the default manager.
 InstanciationMger getPerInstanceMger(java.lang.String aName)
          Method getPerInstanceMger.
 InstanciationMger getPerTemplateMger(java.lang.String aName)
          Method getPerTemplateMger
 void setDefaultMger(InstanciationMger aMger)
          Method setDefaultMger.
 void setPerInstanceMger(java.lang.String aName, InstanciationMger aManager)
          Method setPerInstanceMger sets the manager to be used for a given instance.
 void setPerTemplateMger(java.lang.String aName, InstanciationMger aManager)
          Method setPerTemplateMger sets the manager to be used when the component is an instance of a template or one of its subtemplates.
 

Method Detail

setDefaultMger

public void setDefaultMger(InstanciationMger aMger)
                    throws KilimException
Method setDefaultMger.

Parameters:
aMger - : a default instanciation manager (this ctor just contains a call to setDefaultManager(aMger). This value cannot be null. A NullInstanciationMger should be indicated if no action should be performed at instanciation time.
Throws:
KilimException - : generated if the reference is null.

getDefaultMger

public InstanciationMger getDefaultMger()
Method getDefaultMger returns the default manager.

Returns:
InstanciationMger

setPerTemplateMger

public void setPerTemplateMger(java.lang.String aName,
                               InstanciationMger aManager)
                        throws KilimException
Method setPerTemplateMger sets the manager to be used when the component is an instance of a template or one of its subtemplates.

Parameters:
aName - is name of the template.
aManager - is the manager to be used.
Throws:
KilimException - : generated when aName is null.

getPerTemplateMger

public InstanciationMger getPerTemplateMger(java.lang.String aName)
                                     throws KilimException
Method getPerTemplateMger

Parameters:
aName - : the name of the template.
Returns:
InstanciationMger
Throws:
KilimException - : generated when aName is null

setPerInstanceMger

public void setPerInstanceMger(java.lang.String aName,
                               InstanciationMger aManager)
                        throws KilimException
Method setPerInstanceMger sets the manager to be used for a given instance.

Parameters:
aName - : the name of the component.
aManager - : the manager to be used
Throws:
KilimException - : generated when aName is null.

getPerInstanceMger

public InstanciationMger getPerInstanceMger(java.lang.String aName)
                                     throws KilimException
Method getPerInstanceMger.

Parameters:
aName - : the name of the component
Returns:
InstanciationMger :
Throws:
KilimException - : generated when aName is null.