Package org.ow2.clif.deploy
Class ClifRegistry
- java.lang.Object
-
- org.ow2.clif.deploy.ClifRegistry
-
public class ClifRegistry extends java.lang.ObjectThe clifRegistry is responsible for creating the initial FractalRMI registry if not externally provided.- Author:
- Bruno Dillenseger, Joan Chaumont
-
-
Constructor Summary
Constructors Constructor Description ClifRegistry(boolean createRegistry)Creates a new test plan deployer, using the default RMI registry (as specified by system properties fractal.registry.host and fractal.registry.port)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(java.lang.String name, org.objectweb.fractal.api.Component comp)Direct access to CLIF/Fractal registry for binding a component to a namevoidbindClifApp(java.lang.String name, org.objectweb.fractal.api.Component clifApp)Bind clifApp component in registry namingService.voidbindServer(java.lang.String name, org.objectweb.fractal.api.Component server)Bind server component in registry namingService.static voidcreateRegistry(int port)java.util.Map<java.lang.String,org.objectweb.fractal.api.Component>getServerComponents()Gets the list of registered CLIF server names and componentsjava.lang.String[]getServers()Get bound servers in ClifRegistryjava.lang.String[]list()Direct access to CLIF/Fractal registry for listing all bound namesorg.objectweb.fractal.api.Componentlookup(java.lang.String name)Direct access to CLIF/Fractal registry for finding a component from its nameorg.objectweb.fractal.api.ComponentlookupClifApp(java.lang.String name)Looks for a clifApp component.org.objectweb.fractal.api.ComponentlookupServer(java.lang.String name)Looks for a server component.voidrebind(java.lang.String name, org.objectweb.fractal.api.Component comp)Direct access to CLIF/Fractal registry for rebinding a component to a namejava.lang.StringtoString()voidunbind(java.lang.String name)Direct access to CLIF/Fractal registry for unbinding a component name
-
-
-
Constructor Detail
-
ClifRegistry
public ClifRegistry(boolean createRegistry) throws java.lang.ExceptionCreates a new test plan deployer, using the default RMI registry (as specified by system properties fractal.registry.host and fractal.registry.port)- Parameters:
createRegistry- if true, a FractalRMI registry is created on localhost using default port; if false, the registry is supposed to be running already on the default host and port.- Throws:
java.lang.Errorjava.lang.Exception
-
-
Method Detail
-
getServers
public java.lang.String[] getServers()
Get bound servers in ClifRegistry- Returns:
- an array of the names of all available CLIF servers (i.e. registered in the FractalRMI Registry)
-
getServerComponents
public java.util.Map<java.lang.String,org.objectweb.fractal.api.Component> getServerComponents()
Gets the list of registered CLIF server names and components- Returns:
- a map with server names as keys and Clif server components as values
-
bindServer
public void bindServer(java.lang.String name, org.objectweb.fractal.api.Component server)Bind server component in registry namingService. Replace if binding allready exists.- Parameters:
name- name to be associated with the serverserver- server to be associated with the given name
-
bindClifApp
public void bindClifApp(java.lang.String name, org.objectweb.fractal.api.Component clifApp)Bind clifApp component in registry namingService. Replace if binding allready exists.- Parameters:
name- name to be associated with the clifAppclifApp- clifApp to be associated with the given name
-
bind
public void bind(java.lang.String name, org.objectweb.fractal.api.Component comp)Direct access to CLIF/Fractal registry for binding a component to a name- Parameters:
name- the component namecomp- the component
-
rebind
public void rebind(java.lang.String name, org.objectweb.fractal.api.Component comp)Direct access to CLIF/Fractal registry for rebinding a component to a name- Parameters:
name- the component namecomp- the component
-
unbind
public void unbind(java.lang.String name)
Direct access to CLIF/Fractal registry for unbinding a component name- Parameters:
name- the component name
-
lookup
public org.objectweb.fractal.api.Component lookup(java.lang.String name)
Direct access to CLIF/Fractal registry for finding a component from its name- Parameters:
name- component name- Returns:
- the component bound to the given name
-
list
public java.lang.String[] list()
Direct access to CLIF/Fractal registry for listing all bound names- Returns:
- the list of names bound to components
-
lookupServer
public org.objectweb.fractal.api.Component lookupServer(java.lang.String name)
Looks for a server component.- Parameters:
name- the name to look for.- Returns:
- Component if exists return server component else null
-
lookupClifApp
public org.objectweb.fractal.api.Component lookupClifApp(java.lang.String name)
Looks for a clifApp component.- Parameters:
name- the name to look for.- Returns:
- Component if exists return clifApp component else null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- string representation in the form registry@host:port_number
-
createRegistry
public static void createRegistry(int port) throws java.lang.Exception- Throws:
java.lang.Exception
-
-