org.objectweb.fractal.julia.factory
Class SingletonTemplateMixin

java.lang.Object
  extended by org.objectweb.fractal.julia.factory.SingletonTemplateMixin
All Implemented Interfaces:
Factory, Template

public abstract class SingletonTemplateMixin
extends Object
implements Template

Provides a singleton behavior to a Template. A singleton composite template must only contain other singleton templates, otherwise the "singleton" semantics will not be ensured.

Requirements


Field Summary
 Component fcInstance
          The singleton instance created by this template.
 
Method Summary
abstract  Component _super_newFcControllerInstance()
          The newFcControllerInstance overriden by this mixin.
 Component newFcControllerInstance()
          Calls the overriden method only if the fcInstance field is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.fractal.api.factory.Factory
getFcContentDesc, getFcControllerDesc, getFcInstanceType, newFcInstance
 

Field Detail

fcInstance

public Component fcInstance
The singleton instance created by this template.

Method Detail

newFcControllerInstance

public Component newFcControllerInstance()
                                  throws InstantiationException
Calls the overriden method only if the fcInstance field is null.

Specified by:
newFcControllerInstance in interface Template
Returns:
the instantiated component.
Throws:
InstantiationException - if the component controller cannot be instantiated.

_super_newFcControllerInstance

public abstract Component _super_newFcControllerInstance()
                                                  throws InstantiationException
The newFcControllerInstance overriden by this mixin.

Returns:
the instantiated component.
Throws:
InstantiationException - if the component controller cannot be instantiated.