org.objectweb.fractal.gui.repository.lib
Class BasicRepository

java.lang.Object
  extended byorg.objectweb.fractal.gui.repository.lib.BasicRepository
All Implemented Interfaces:
BindingController, Repository

public class BasicRepository
extends Object
implements Repository, BindingController

Basic implementation of the Repository interface. This implementation supposes that the component definitions are stored in the repository as Fractal ADL definitions, in XML form.


Field Summary
static String FACTORY_BINDING
          A mandatory client interface bound to a factory.
static String STORAGE_BINDING
          A mandatory client interface bound to a storage.
 
Constructor Summary
BasicRepository()
           
 
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 loadComponent(String name)
          Loads a component (and all its sub components) from this repository.
 Object lookupFc(String clientItfName)
          Returns the interface to which the given client interface is bound.
 String storeComponent(Component component)
          Stores a component (and all its sub components) into this repository.
 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

STORAGE_BINDING

public static final String STORAGE_BINDING
A mandatory client interface bound to a storage. This is the storage from which this repository loads the component definitions.

See Also:
Constant Field Values

FACTORY_BINDING

public static final String FACTORY_BINDING
A mandatory client interface bound to a factory. This factory is used to create components from the component definitions stored in the storage.

See Also:
Constant Field Values
Constructor Detail

BasicRepository

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

loadComponent

public Component loadComponent(String name)
                        throws Exception
Description copied from interface: Repository
Loads a component (and all its sub components) from this repository.

Specified by:
loadComponent in interface Repository
Parameters:
name - the name of the component to be loaded.
Returns:
the loaded component.
Throws:
Exception - if the component cannot loaded.

storeComponent

public String storeComponent(Component component)
                      throws Exception
Description copied from interface: Repository
Stores a component (and all its sub components) into this repository.

Specified by:
storeComponent in interface Repository
Parameters:
component - the component to be stored.
Returns:
the name of the component that has been stored.
Throws:
Exception - if the component cannot be stored.