org.objectweb.fractal.julia.factory
Class CheckGenericFactoryMixin

java.lang.Object
  extended byorg.objectweb.fractal.julia.factory.CheckGenericFactoryMixin
All Implemented Interfaces:
GenericFactory

public abstract class CheckGenericFactoryMixin
extends Object
implements GenericFactory

Provides reflective checks to a GenericFactory.

Requirements


Method Summary
abstract  Component _super_newFcInstance(Type type, Object controllerDesc, Object contentDesc)
          The newFcInstance method overriden by this mixin.
 void checkFcContentClass(Type type, String content)
          Checks the given class against the given component type.
 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

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.

checkFcContentClass

public void checkFcContentClass(Type type,
                                String content)
                         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.
Throws:
InstantiationException - if the given class is not compatible with the given component type.

_super_newFcInstance

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

Throws:
InstantiationException