|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.kilim.model.mapping.DefaultMappingStrategy
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().
Field Summary | |
private Mapper |
defaultMapper
|
private java.util.HashMap |
perInstanceMapper
|
private java.util.HashMap |
perTemplateMapper
|
Constructor Summary | |
DefaultMappingStrategy()
|
|
DefaultMappingStrategy(Mapper aMapper)
Method DefaultMappingStrategy. |
Method Summary | |
Mapper |
getDefaultMapper()
Method getDefaultMapper returns the default mapper. |
Mapper |
getPerInstanceMapper(java.lang.String aName)
Method getPerInstanceMapper. |
Mapper |
getPerTemplateMapper(java.lang.String aName)
Method getPerTemplateMapper |
void |
setDefaultMapper(Mapper aMapper)
Method setDefaultMapper. |
void |
setPerInstanceMapper(java.lang.String aName,
Mapper aMapper)
Method setPerInstanceMger sets the mapper to be used for a given instance. |
void |
setPerTemplateMapper(java.lang.String aName,
Mapper aMapper)
Method setPerTemplateMapper sets the mapper to be used when the component is an instance of a template or one of its subtemplates. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Mapper defaultMapper
private java.util.HashMap perTemplateMapper
private java.util.HashMap perInstanceMapper
Constructor Detail |
public DefaultMappingStrategy() throws KilimException
Object.Object()
public DefaultMappingStrategy(Mapper aMapper) throws KilimException
aMapper
- : a default mapper (this ctor just contains a call to setDefaultMapper(aMapper)
KilimException
- : generated if the reference is null. A NullMapper should be indicated if
no mapping should be performed at runtime.Method Detail |
public void setDefaultMapper(Mapper aMapper) throws KilimException
MappingStrategy
setDefaultMapper
in interface MappingStrategy
aMapper
- : a default mapper (this ctor just contains a call to setDefaultManager(aMapper). This value
cannot be null. A NullMapper should be used if no action should be performed at instanciation time.
KilimException
- : generated if the reference is null.MappingStrategy.setDefaultMapper(Mapper)
public Mapper getDefaultMapper()
MappingStrategy
getDefaultMapper
in interface MappingStrategy
MappingStrategy.getDefaultMapper()
public void setPerTemplateMapper(java.lang.String aName, Mapper aMapper) throws KilimException
MappingStrategy
setPerTemplateMapper
in interface MappingStrategy
aName
- is name of the template.aMapper
- is the mapper to be used.
KilimException
- : generated when aName is null.MappingStrategy.setPerTemplateMapper(String, Mapper)
public Mapper getPerTemplateMapper(java.lang.String aName) throws KilimException
MappingStrategy
getPerTemplateMapper
in interface MappingStrategy
aName
- : the name of the template.
KilimException
- : generated when aName is nullMappingStrategy.getPerTemplateMapper(String)
public void setPerInstanceMapper(java.lang.String aName, Mapper aMapper) throws KilimException
MappingStrategy
setPerInstanceMapper
in interface MappingStrategy
aName
- : the name of the component.aMapper
- : the mapper to be used
KilimException
- : generated when aName is null.MappingStrategy.setPerInstanceMapper(String, Mapper)
public Mapper getPerInstanceMapper(java.lang.String aName) throws KilimException
MappingStrategy
getPerInstanceMapper
in interface MappingStrategy
aName
- : the name of the component
KilimException
- : generated when aName is null.MappingStrategy.getPerInstanceMapper(String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |