org.objectweb.fractal.adl
Class BasicParser

java.lang.Object
  extended byorg.objectweb.fractal.adl.BasicParser
All Implemented Interfaces:
BindingController, Parser

public class BasicParser
extends Object
implements Parser, BindingController

Default implementation of the Parser interface.


Field Summary
protected  GenericFactory genericFactory
          The factory used to create the component templates.
protected  Loader loader
          The loader used to load resolved type and template definitions.
protected  LoggerFactory loggerFactory
          The optional logger factory used to get a logger for this component.
protected  TypeFactory typeFactory
          The factory used to create the component types.
 
Constructor Summary
BasicParser()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
          Binds the client interface whose name is given to a server interface.
 String[] listFc()
          Returns the names of the client interfaces of the component to which this interface belongs.
 Component loadTemplate(String name, boolean template)
          Loads the template component whose name is given.
 ComponentType loadType(String name)
          Loads the component type whose name is given.
 Object lookupFc(String clientItfName)
          Returns the interface to which the given client interface is bound.
 void registerExternalComponent(String name, Component component)
          Registers an external component under the given name.
 void unbindFc(String clientItfName)
          Unbinds the given client interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loader

protected Loader loader
The loader used to load resolved type and template definitions.


typeFactory

protected TypeFactory typeFactory
The factory used to create the component types.


genericFactory

protected GenericFactory genericFactory
The factory used to create the component templates.


loggerFactory

protected LoggerFactory loggerFactory
The optional logger factory used to get a logger for this component.

Constructor Detail

BasicParser

public BasicParser()
Method Detail

listFc

public String[] listFc()
Description copied from interface: BindingController
Returns the names of the client interfaces of the component to which this interface belongs.

Specified by:
listFc in interface BindingController
Returns:
the names of the client interfaces of the component to which this interface belongs.

lookupFc

public Object lookupFc(String clientItfName)
Description copied from interface: BindingController
Returns the interface to which the given client interface is bound. More precisely, returns the server interface to which the client interface whose name is given is bound. This server interface is necessarily in the same address space as the client interface (see bindFc).

Specified by:
lookupFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.
Returns:
the server interface to which the given interface is bound, or null if it is not bound.

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
Description copied from interface: BindingController
Binds the client interface whose name is given to a server interface. More precisely, binds the client interface of the component to which this interface belongs, and whose name is equal to the given name, to the given server interface. The given server interface must be in the same address space as the client interface.

Specified by:
bindFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.
serverItf - a server interface.

unbindFc

public void unbindFc(String clientItfName)
Description copied from interface: BindingController
Unbinds the given client interface. More precisely, unbinds the client interface of the component to which this interface belongs, and whose name is equal to the given name.

Specified by:
unbindFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.

loadType

public ComponentType loadType(String name)
                       throws ParserException
Description copied from interface: Parser
Loads the component type whose name is given. Depending on the implementation, this method can return or not a different object when it is called several times with the same argument.

Specified by:
loadType in interface Parser
Parameters:
name - a component type name.
Returns:
the component type object whose name is given.
Throws:
ParserException - if the component type definition cannot be loaded, if it is invalid, or if the corresponding component type object cannot be created.

loadTemplate

public Component loadTemplate(String name,
                              boolean template)
                       throws ParserException
Description copied from interface: Parser
Loads the template component whose name is given. Depending on the implementation, this method can return or not a different component when it is called several times with the same argument.

Specified by:
loadTemplate in interface Parser
Parameters:
name - a template name.
template - true to return a template component, false to return directly the instantiated component.
Returns:
the Component interface of the loaded template component.
Throws:
ParserException - if the template definition cannot be loaded, if it is invalid, or if the corresponding template component cannot be created.

registerExternalComponent

public void registerExternalComponent(String name,
                                      Component component)
Description copied from interface: Parser
Registers an external component under the given name. External components are used to create the template components corresponding to <external-template> template descriptors.

Specified by:
registerExternalComponent in interface Parser
Parameters:
name - the name of the external component.
component - an already instantiated component.