org.ow2.clif.deploy
Class ClifRegistry

java.lang.Object
  extended by org.ow2.clif.deploy.ClifRegistry

public class ClifRegistry
extends java.lang.Object

The clifRegistry is responsible for creating the initial FractalRMI registry if not externally provided.

Author:
Bruno Dillenseger, Joan Chaumont

Constructor Summary
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
 void bindClifApp(java.lang.String name, org.objectweb.fractal.api.Component clifApp)
          Bind clifApp component in registry namingService.
 void bindServer(java.lang.String name, org.objectweb.fractal.api.Component server)
          Bind server component in registry namingService.
 java.util.Map<java.lang.String,org.objectweb.fractal.api.Component> getServerComponents()
          Gets the list of registered CLIF server names and components
 java.lang.String[] getServers()
          Get bound servers in ClifRegistry
 org.objectweb.fractal.api.Component lookupClifApp(java.lang.String name)
          Looks for a clifApp component.
 org.objectweb.fractal.api.Component lookupServer(java.lang.String name)
          Looks for a server component.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClifRegistry

public ClifRegistry(boolean createRegistry)
             throws java.lang.Exception
Creates 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.Error
java.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 server
server - 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 clifApp
clifApp - clifApp to be associated with the given name

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:
toString in class java.lang.Object
Returns:
string representation in the form registry@host:port_number