org.objectweb.fractal.julia.factory
Class CheckGenericFactoryMixin

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

public abstract class CheckGenericFactoryMixin
extends Object
implements GenericFactory, Initializable

Provides reflective checks to a GenericFactory.

Requirements


Method Summary
abstract  Object _super_getFcLoader(Object loader)
           
abstract  void _super_initialize(Tree args)
          The initialize method overriden by this mixin.
abstract  Component _super_newFcInstance(Type type, Object controllerDesc, Object contentDesc)
          The newFcInstance method overriden by this mixin.
 boolean checkFcAttributeControllerInterface(Class itf)
          Checks that the given class is valid attribute controller interface.
 void checkFcContentClass(Type type, String content, ClassLoader loader)
          Checks the given class against the given component type.
 void checkFcType(Type type, ClassLoader loader)
          Checks the given component type.
 Object getFcLoader(Object loader)
           
 void initialize(Tree args)
          Initializes this object with the given arguments.
 Component newFcInstance(Type type, Object controllerDesc, Object contentDesc)
          Checks that type and contentDesc are compatible, and then calls the overriden method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

public void initialize(Tree args)
                throws Exception
Initializes this object with the given arguments.

Specified by:
initialize in interface Initializable
Parameters:
args - the arguments to be used to initialize this object. The format of these arguments depends on the class of this object.
Throws:
Exception - if a problem occurs during the object initialization.

newFcInstance

public Component newFcInstance(Type type,
                               Object controllerDesc,
                               Object contentDesc)
                        throws InstantiationException
Checks that type and contentDesc are compatible, and then calls the overriden method.

Specified by:
newFcInstance in interface GenericFactory
Parameters:
type - an arbitrary component type.
controllerDesc - a description of the controller part of the component to be created. This description is implementation specific. If it is null then a "default" controller part will be used.
contentDesc - a description of the content part of the component to be created. 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 create primitive components.
Returns:
the Component interface of the created component.
Throws:
InstantiationException - if the component cannot be created.

getFcLoader

public Object getFcLoader(Object loader)

checkFcType

public void checkFcType(Type type,
                        ClassLoader loader)
                 throws InstantiationException
Checks the given component type.

Parameters:
type - the component type to be checked.
loader - the class loader to be used to load the Java interface types.
Throws:
InstantiationException - if the given type is invalid.

checkFcAttributeControllerInterface

public boolean checkFcAttributeControllerInterface(Class itf)
Checks that the given class is valid attribute controller interface.

Parameters:
itf - a Java interface
Returns:
true if the given interface is valid, or false otherwise.

checkFcContentClass

public void checkFcContentClass(Type type,
                                String content,
                                ClassLoader loader)
                         throws InstantiationException
Checks the given class against the given component type. This method checks that the given class exists, that it is public non abstract class with a default public constructor, that it implements all the server interface types (except control interface types) of the given type, and that it implements BindingController (if there is at least one client interface).

Parameters:
type - a component type, must be instance of ComponentType.
content - the fully qualified name of a Java class.
loader - the class loader to be used to load the "content" class.
Throws:
InstantiationException - if the given class is not compatible with the given component type.

_super_initialize

public abstract void _super_initialize(Tree args)
                                throws Exception
The initialize method overriden by this mixin.

Parameters:
args - the arguments to be used to initialize this object. The format of these arguments depends on the class of this object.
Throws:
Exception - if a problem occurs during the object initialization.

_super_newFcInstance

public abstract Component _super_newFcInstance(Type type,
                                               Object controllerDesc,
                                               Object contentDesc)
                                        throws InstantiationException
The newFcInstance method overriden by this mixin.

Parameters:
type - an arbitrary component type.
controllerDesc - a description of the controller part of the component to be created. This description is implementation specific. If it is null then a "default" controller part will be used.
contentDesc - a description of the content part of the component to be created. 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 create primitive components.
Returns:
the Component interface of the created component.
Throws:
InstantiationException - if the component cannot be created.

_super_getFcLoader

public abstract Object _super_getFcLoader(Object loader)