org.objectweb.fractal.julia.factory
Class BasicTemplateMixin

java.lang.Object
  extended by org.objectweb.fractal.julia.factory.BasicTemplateMixin
All Implemented Interfaces:
Factory, Controller, 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 ic)
          The initFcController method overriden by this mixin.
 Object getFcContentDesc()
           
 Object getFcControllerDesc()
           
 Type getFcInstanceType()
           
 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()
           
 
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()
Specified by:
getFcInstanceType in interface Factory

getFcControllerDesc

public Object getFcControllerDesc()
Specified by:
getFcControllerDesc in interface Factory

getFcContentDesc

public Object getFcContentDesc()
Specified by:
getFcContentDesc in interface Factory

newFcInstance

public Component newFcInstance()
                        throws InstantiationException
Specified by:
newFcInstance in interface Factory
Throws:
InstantiationException

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 ic)
                                      throws InstantiationException
The initFcController method overriden by this mixin.

Parameters:
ic - information about the component to which this controller object belongs.
Throws:
InstantiationException - if the initialization fails.