org.objectweb.fractal.adl
Class BasicFactory

java.lang.Object
  extended byorg.objectweb.fractal.adl.BasicFactory
All Implemented Interfaces:
BindingController, Factory

public class BasicFactory
extends Object
implements BindingController, Factory

Basic implementation of the Factory interface. This implementation uses a Loader to load ADL definitions, a Compiler to compile them, and a Scheduler to execute the compiled tasks.


Field Summary
 Compiler compiler
          The Compiler used by this factory.
static String COMPILER_BINDING
          Name of the client interface bound to the Compiler used by this factory.
 Loader loader
          The Loader used by this factory.
static String LOADER_BINDING
          Name of the client interface bound to the Loader used by this factory.
 org.objectweb.deployment.scheduling.core.api.Scheduler scheduler
          The Scheduler used by this factory.
static String SCHEDULER_BINDING
          Name of the client interface bound to the Scheduler used by this factory.
 
Constructor Summary
BasicFactory()
           
 
Method Summary
 void bindFc(String itf, Object value)
           
 String[] listFc()
           
 Object lookupFc(String itf)
           
 Object newComponent(String name, Map context)
          Creates a new instance of the component whose name is given.
 void unbindFc(String itf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOADER_BINDING

public static final String LOADER_BINDING
Name of the client interface bound to the Loader used by this factory.

See Also:
Constant Field Values

COMPILER_BINDING

public static final String COMPILER_BINDING
Name of the client interface bound to the Compiler used by this factory.

See Also:
Constant Field Values

SCHEDULER_BINDING

public static final String SCHEDULER_BINDING
Name of the client interface bound to the Scheduler used by this factory.

See Also:
Constant Field Values

loader

public Loader loader
The Loader used by this factory.


compiler

public Compiler compiler
The Compiler used by this factory.


scheduler

public org.objectweb.deployment.scheduling.core.api.Scheduler scheduler
The Scheduler used by this factory.

Constructor Detail

BasicFactory

public BasicFactory()
Method Detail

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController

lookupFc

public Object lookupFc(String itf)
Specified by:
lookupFc in interface BindingController

bindFc

public void bindFc(String itf,
                   Object value)
Specified by:
bindFc in interface BindingController

unbindFc

public void unbindFc(String itf)
Specified by:
unbindFc in interface BindingController

newComponent

public Object newComponent(String name,
                           Map context)
                    throws ADLException
Description copied from interface: Factory
Creates a new instance of the component whose name is given. This can be done by loading the ADL definition of this name, by compiling it into a set of tasks and by executing these tasks in the proper order.

Specified by:
newComponent in interface Factory
Parameters:
name - the name of the component to be created.
context - optional additional information.
Returns:
the component that has been created. The type of this result depends on the implementation of this interface: it can be a Fractal component reference (if this factory creates Fractal components), it can be an identifier (if this factory generates source code that will create components, instead of directly creating components), etc.
Throws:
ADLException - if a problem occurs during the creation of the component.