org.objectweb.fractal.adl

Class BasicFactory

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

static String
COMPILER_BINDING
Name of the client interface bound to the Compiler used by this factory.
static String
LOADER_BINDING
Name of the client interface bound to the Loader used by this factory.
static String
SCHEDULER_BINDING
Name of the client interface bound to the Scheduler used by this factory.
Compiler
compiler
The Compiler used by this factory.
Loader
loader
The Loader used by this factory.
Scheduler
scheduler
The Scheduler used by this factory.

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)

Field Details

COMPILER_BINDING

public static final String COMPILER_BINDING


LOADER_BINDING

public static final String LOADER_BINDING


SCHEDULER_BINDING

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


compiler

public Compiler compiler
The Compiler used by this factory.


loader

public Loader loader
The Loader used by this factory.


scheduler

public Scheduler scheduler
The Scheduler used by this factory.

Method Details

bindFc

public void bindFc(String itf,
                   Object value)


listFc

public String[] listFc()


lookupFc

public Object lookupFc(String itf)


newComponent

public Object newComponent(String name,
                           Map context)
            throws ADLException
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.


unbindFc

public void unbindFc(String itf)