org.objectweb.fractal.juliak.factory
Class BasicGenericFactoryImpl

java.lang.Object
  extended by org.objectweb.fractal.juliak.factory.AbstractGenericFactoryImpl
      extended by org.objectweb.fractal.juliak.factory.AbstractJuliaEnabledGenericFactoryImpl
          extended by org.objectweb.fractal.juliak.factory.BasicGenericFactoryImpl
All Implemented Interfaces:
GenericFactory

public class BasicGenericFactoryImpl
extends AbstractJuliaEnabledGenericFactoryImpl
implements GenericFactory

A generic factory which instanciates components with a component-based membrane.

Since:
2.5
Author:
Lionel Seinturier

Constructor Summary
BasicGenericFactoryImpl()
           
 
Method Summary
protected  Component bindFcMembrane(Type type, Object contentDesc, Object content, Component membrane)
          Bind a control membrane to the component defined by the given type, content description and content.
protected  Class loadFcContentClass(Object controllerDesc, String contentDescStr)
          Load the specified content class.
protected  Component newFcMembrane(Type type, Object controllerDesc, Object contentDesc, Object content)
          Create a new control membrane.
 
Methods inherited from class org.objectweb.fractal.juliak.factory.AbstractJuliaEnabledGenericFactoryImpl
newFcInstance
 
Methods inherited from class org.objectweb.fractal.juliak.factory.AbstractGenericFactoryImpl
checkFcContentClassforBC, checkFcContentClassImplementsServerInterfaces, checkFcContentDesc, checkFcControllerDesc, checkFcType, isFcContentToBeCheckedForBC, newFcContent
 
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.GenericFactory
newFcInstance
 

Constructor Detail

BasicGenericFactoryImpl

public BasicGenericFactoryImpl()
Method Detail

newFcMembrane

protected Component newFcMembrane(Type type,
                                  Object controllerDesc,
                                  Object contentDesc,
                                  Object content)
                           throws InstantiationException
Create a new control membrane.

Specified by:
newFcMembrane in class AbstractGenericFactoryImpl
Parameters:
type - the type of the component associated to this membrane
controllerDesc - the controller description of this membrane (typically a String such as "primitive" or any of the other registered membrane identifier)
contentDesc - the content description of the component associated to this membrane (e.g. the fully qualified name of the class implementing a primitive component)
content - the instance implementing the component associated to this membrane
Returns:
the fcinterface for the component interface exported by the given control membrane
Throws:
InstantiationException

bindFcMembrane

protected Component bindFcMembrane(Type type,
                                   Object contentDesc,
                                   Object content,
                                   Component membrane)
                            throws InstantiationException
Bind a control membrane to the component defined by the given type, content description and content.

Specified by:
bindFcMembrane in class AbstractGenericFactoryImpl
Parameters:
type - the type of the component associated to this membrane
contentDesc - the content description of the component associated to this membrane (e.g. the fully qualified name of the class implementing a primitive component)
content - the instance implementing the component associated to this membrane
membrane - the control membrane
Returns:
the fcinterface for the component interface exported by the given control membrane
Throws:
InstantiationException

loadFcContentClass

protected Class loadFcContentClass(Object controllerDesc,
                                   String contentDescStr)
                            throws InstantiationException
Load the specified content class. First, try to load the class from the classpath. If that fails, assume that the specified contentDesc corresponds to an alias defined in the julia.cfg configuration file. This is case for control component where the content class is dynamically generated by the ASM mixin class generator.

Overrides:
loadFcContentClass in class AbstractGenericFactoryImpl
Parameters:
controllerDesc - the controller descriptor of the component for which the content class is requested
contentDescStr - the content descriptor. May be a fully-qualified class name or the stringified representation of a Tree to be loaded by a Julia Loader.
Throws:
InstantiationException