org.objectweb.fractal.rmi.registry
Class NamingServiceImpl

java.lang.Object
  extended byorg.objectweb.fractal.rmi.registry.NamingServiceImpl
All Implemented Interfaces:
AttributeController, NamingService, NamingServiceAttributes

public class NamingServiceImpl
extends Object
implements NamingService, NamingServiceAttributes

Vanilla implementation of a naming service component. Persistence is not implemented.


Field Summary
 
Fields inherited from interface org.objectweb.fractal.rmi.registry.NamingService
NAMING_SERVICE
 
Constructor Summary
NamingServiceImpl()
           
 
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 getPersistenceFileName()
           
 boolean getPersistenceMode()
           
 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.
 void setPersistenceFileName(String fileName)
           
 void setPersistenceMode(boolean on)
           
 Component unbind(String name)
          Removes a name from the naming service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamingServiceImpl

public NamingServiceImpl()
Method Detail

list

public String[] list()
Description copied from interface: NamingService
Gets the list of names currently present in the naming service.

Specified by:
list in interface NamingService
Returns:
an array of names.

lookup

public Component lookup(String name)
Description copied from interface: NamingService
Looks for a component.

Specified by:
lookup in interface NamingService
Parameters:
name - the name to look for.
Returns:
the component associated to the given name.

bind

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

Specified by:
bind in interface NamingService
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)
Description copied from interface: NamingService
Associates the given name with the given component, replacing any existing association using the same name.

Specified by:
rebind in interface NamingService
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)
Description copied from interface: NamingService
Removes a name from the naming service.

Specified by:
unbind in interface NamingService
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.

getPersistenceMode

public boolean getPersistenceMode()
Specified by:
getPersistenceMode in interface NamingServiceAttributes

setPersistenceMode

public void setPersistenceMode(boolean on)
Specified by:
setPersistenceMode in interface NamingServiceAttributes

getPersistenceFileName

public String getPersistenceFileName()
Specified by:
getPersistenceFileName in interface NamingServiceAttributes

setPersistenceFileName

public void setPersistenceFileName(String fileName)
Specified by:
setPersistenceFileName in interface NamingServiceAttributes