org.objectweb.fractal.adl

Interface Factory

Known Implementing Classes:
BasicFactory

public interface Factory

A component factory.

Method Summary

Object
newComponent(String name, Map context)
Creates a new instance of the component whose name is given.

Method Details

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.

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.