org.objectweb.fractal.rmi.registry
Interface NamingService

All Known Implementing Classes:
NamingServiceImpl

public interface NamingService

Typical naming service interface, inspired from Java RMI Registry's interface. Note: be careful with term "bind", which is not used here as Fractal's concept about linking interfaces, but as the basic naming service concept of associating a name with a server reference.


Field Summary
static String NAMING_SERVICE
          Interface name for naming service.
 
Method Summary
 boolean bind(String name, Component comp)
          Associates the given name with the given component, if and only if the given name is not already in use in the naming service.
 String[] list()
          Gets the list of names currently present in the naming service.
 Component lookup(String name)
          Looks for a component.
 Component rebind(String name, Component comp)
          Associates the given name with the given component, replacing any existing association using the same name.
 Component unbind(String name)
          Removes a name from the naming service.
 

Field Detail

NAMING_SERVICE

public static final String NAMING_SERVICE
Interface name for naming service.

See Also:
Constant Field Values
Method Detail

list

public String[] list()
Gets the list of names currently present in the naming service.

Returns:
an array of names.

lookup

public Component lookup(String name)
Looks for a component.

Parameters:
name - the name to look for.
Returns:
the component associated to the given name.

bind

public boolean bind(String name,
                    Component comp)
Associates the given name with the given component, if and only if the given name is not already in use in the naming service.

Parameters:
name - name to be associated to the component.
comp - component to be associated to the given name.
Returns:
true if the name has been added to the naming service, false otherwise.

rebind

public Component rebind(String name,
                        Component comp)
Associates the given name with the given component, replacing any existing association using the same name.

Parameters:
name - name to be associated to the component.
comp - component to be associated to the given name.
Returns:
the component formerly associated to the given name, or null if the given name is new to the naming service.

unbind

public Component unbind(String name)
Removes a name from the naming service.

Parameters:
name - to remove.
Returns:
the component that was associated to the name, or null if the name was not known by the naming service.