org.objectweb.fractal.julia.factory
Class BasicGenericFactoryMixin

java.lang.Object
  extended by org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin
All Implemented Interfaces:
GenericFactory

public class BasicGenericFactoryMixin
extends Object
implements GenericFactory

Provides a basic implementation of the GenericFactory interface.

Requirements


Field Summary
 Loader _this_weaveableL
          The weaveableL field required by this mixin.
 TypeFactory _this_weaveableTF
          The weaveableTF field required by this mixin.
 
Constructor Summary
BasicGenericFactoryMixin()
           
 
Method Summary
 Tree getFcContentDescriptor(Object contentDesc)
          Returns the tree corresponding to the given content descriptor.
 Tree getFcControllerDescriptor(Object controllerDesc)
          Returns the tree corresponding to the given controller descriptor.
 Object getFcLoader(Object loader)
           
 Tree getFcTypeDescriptor(Type type)
          Returns a tree representing the given component type.
 Component newFcInstance(Type type, Object controllerDesc, Object contentDesc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_this_weaveableL

public Loader _this_weaveableL
The weaveableL field required by this mixin. This field is supposed to reference the Loader interface of the component to which this controller object belongs.


_this_weaveableTF

public TypeFactory _this_weaveableTF
The weaveableTF field required by this mixin. This field is supposed to reference the TypeFactory interface of the component to which this controller object belongs.

Constructor Detail

BasicGenericFactoryMixin

public BasicGenericFactoryMixin()
Method Detail

newFcInstance

public Component newFcInstance(Type type,
                               Object controllerDesc,
                               Object contentDesc)
                        throws InstantiationException
Specified by:
newFcInstance in interface GenericFactory
Throws:
InstantiationException

getFcLoader

public Object getFcLoader(Object loader)

getFcTypeDescriptor

public Tree getFcTypeDescriptor(Type type)
                         throws InstantiationException
Returns a tree representing the given component type. This tree has the format specified in ContextClassGenerator

Parameters:
type - a component type, must be instance of ComponentType.
Returns:
a tree representing the given component type.
Throws:
InstantiationException - if the given type is not an instance of ComponentType, or if it contains control interface types.

getFcControllerDescriptor

public Tree getFcControllerDescriptor(Object controllerDesc)
                               throws InstantiationException
Returns the tree corresponding to the given controller descriptor. This tree is found by using the _this_weaveableL loader. It must have the format specified in ContextClassGenerator

Parameters:
controllerDesc - a string referencing a true controller descriptor.
Returns:
the tree corresponding to the given controller descriptor.
Throws:
InstantiationException - if the tree cannot be loaded.

getFcContentDescriptor

public Tree getFcContentDescriptor(Object contentDesc)
Returns the tree corresponding to the given content descriptor. This tree has the format specified in ContextClassGenerator

Parameters:
contentDesc - a content descriptor.
Returns:
the tree corresponding to the given content descriptor.