org.objectweb.fractal.adl
Class DelegatingLoader

java.lang.Object
  extended byorg.objectweb.fractal.adl.DelegatingLoader
All Implemented Interfaces:
BindingController, Loader
Direct Known Subclasses:
CachingLoader, KilimLoader, VerifyingLoader

public abstract class DelegatingLoader
extends Object
implements Loader, BindingController

A Loader that delegates parts of its work to another Loader.


Field Summary
protected  Loader delegate
          The Loader to which this loader can delegate work.
protected  Logger logger
          The logger used to log messages.
protected  LoggerFactory loggerFactory
          The optional logger factory used to get a logger for this component.
 
Constructor Summary
DelegatingLoader()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
          Binds the client interface whose name is given to a server interface.
protected abstract  XMLElement handleTemplateDescriptor(String name, XMLElement desc)
          Handles a template descriptor that has just been loaded by the delegate.
protected abstract  XMLElement handleTypeDescriptor(String name, XMLElement desc)
          Handles a type descriptor that has just been loaded by the delegate.
 String[] listFc()
          Returns the names of the client interfaces of the component to which this interface belongs.
 XMLElement loadTemplateDescriptor(String name)
          Loads the template definition whose name is given.
 XMLElement loadTypeDescriptor(String name)
          Loads the type definition whose name is given.
 Object lookupFc(String clientItfName)
          Returns the interface to which the given client interface is bound.
 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

delegate

protected Loader delegate
The Loader to which this loader can delegate work.


loggerFactory

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


logger

protected Logger logger
The logger used to log messages. May be null.

Constructor Detail

DelegatingLoader

public DelegatingLoader()
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.

loadTypeDescriptor

public XMLElement loadTypeDescriptor(String name)
                              throws ParserException
Description copied from interface: Loader
Loads the type definition 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:
loadTypeDescriptor in interface Loader
Parameters:
name - the name of a component type.
Returns:
the XML element corresponding to the type definition whose name is given. This XML element must not be modified.
Throws:
ParserException - if the type definition can not be found or is invalid.

loadTemplateDescriptor

public XMLElement loadTemplateDescriptor(String name)
                                  throws ParserException
Description copied from interface: Loader
Loads the template definition 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:
loadTemplateDescriptor in interface Loader
Parameters:
name - the name of a component template.
Returns:
the XML element corresponding to the component template whose name is given. This XML element must not be modified.
Throws:
ParserException - if the component template can not be found or is invalid.

handleTypeDescriptor

protected abstract XMLElement handleTypeDescriptor(String name,
                                                   XMLElement desc)
                                            throws ParserException
Handles a type descriptor that has just been loaded by the delegate.

Parameters:
name - the name of the type descriptor.
desc - a type descriptor.
Returns:
the given type descriptor, possibly modified by this method.
Throws:
ParserException - if the type descriptor is invalid.

handleTemplateDescriptor

protected abstract XMLElement handleTemplateDescriptor(String name,
                                                       XMLElement desc)
                                                throws ParserException
Handles a template descriptor that has just been loaded by the delegate.

Parameters:
name - the name of the template descriptor.
desc - a template descriptor.
Returns:
the given template descriptor, possibly modified by this method.
Throws:
ParserException - if the template descriptor is invalid.