org.objectweb.fractal.julia.factory
Class BasicTemplateMixin

java.lang.Object
  extended byorg.objectweb.fractal.julia.factory.BasicTemplateMixin
All Implemented Interfaces:
Controller, Factory, Template

public abstract class BasicTemplateMixin
extends Object
implements Controller, Template

Provides a basic implementation of the Template interface.

Requirements (here "sub template" means "any direct or indirect sub template")


Field Summary
 Component _this_weaveableC
          The weaveableC field required by this mixin.
 Object[] fcContent
          The controller and content descriptors of the components instantiated by this template.
 Type fcInstanceType
          The functional type of the components instantiated by this template.
 
Method Summary
abstract  void _super_initFcController(InitializationContext i)
          The initFcController method overriden by this mixin.
 Object getFcContentDesc()
          Returns a description of the content part of the components instantiated by this factory.
 Object getFcControllerDesc()
          Returns a description of the controller part of the components instantiated by this factory.
 Type getFcInstanceType()
          Returns the functional type of the components instantiated by this factory.
 void initFcController(InitializationContext ic)
          Initializes the fields of this mixin and then calls the overriden method.
 Component newFcControllerInstance()
          Instantiates only the controller part of the component normally instantiated by this template.
 Component newFcInstance()
          Instantiates a component from this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fcInstanceType

public Type fcInstanceType
The functional type of the components instantiated by this template.


fcContent

public Object[] fcContent
The controller and content descriptors of the components instantiated by this template.


_this_weaveableC

public Component _this_weaveableC
The weaveableC field required by this mixin. This field is supposed to reference the Component interface of the component to which this controller object belongs.

Method Detail

initFcController

public void initFcController(InitializationContext ic)
                      throws InstantiationException
Initializes the fields of this mixin and then calls the overriden method.

Specified by:
initFcController in interface Controller
Parameters:
ic - information about the component to which this controller object belongs.
Throws:
InstantiationException - if the initialization fails.

getFcInstanceType

public Type getFcInstanceType()
Description copied from interface: Factory
Returns the functional type of the components instantiated by this factory.

Specified by:
getFcInstanceType in interface Factory
Returns:
the functional type of the components instantiated by this factory.

getFcControllerDesc

public Object getFcControllerDesc()
Description copied from interface: Factory
Returns a description of the controller part of the components instantiated by this factory.

Specified by:
getFcControllerDesc in interface Factory
Returns:
a description of the controller part of the components instantiated by this factory. This description is implementation specific. If it is null then a "default" controller part will be used.

getFcContentDesc

public Object getFcContentDesc()
Description copied from interface: Factory
Returns a description of the content part of the components instantiated by this factory.

Specified by:
getFcContentDesc in interface Factory
Returns:
a description of the content part of the components instantiated by this factory. This description is implementation specific. It may be null to create component with an empty initial content. It may also be, in Java, the fully qualified name of a Java class, to creat primitive components.

newFcInstance

public Component newFcInstance()
                        throws InstantiationException
Description copied from interface: Factory
Instantiates a component from this factory.

Specified by:
newFcInstance in interface Factory
Returns:
the Component interface of the component instantiated from this factory.
Throws:
InstantiationException - if the component cannot be created.

newFcControllerInstance

public Component newFcControllerInstance()
                                  throws InstantiationException
Description copied from interface: Template
Instantiates only the controller part of the component normally instantiated by this template. Because of component sharing, the newFcInstance method cannot be implemented by just calling itself recursively on the sub templates of this template (otherwise some sub templates may be instantiated several times). Hence this method.

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

_super_initFcController

public abstract void _super_initFcController(InitializationContext i)
                                      throws InstantiationException
The initFcController method overriden by this mixin.

Throws:
InstantiationException