org.objectweb.dsrg.sofa.dockregistry
Class DeploymentDockRegistryImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.objectweb.dsrg.sofa.dockregistry.DeploymentDockRegistryImpl
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, DeploymentDockRegistry

public class DeploymentDockRegistryImpl
extends java.rmi.server.UnicastRemoteObject
implements DeploymentDockRegistry

Implementation of the Deployment Dock Registry

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
DeploymentDockRegistryImpl(java.rmi.registry.Registry registry)
          The constructor
 
Method Summary
 java.lang.String[] getAllNames()
          Gets the names of all registered (and reachable) deployment docks
 DeploymentDockRegistryClient lookup(java.lang.String name)
          Finds a deployment dock and return a reference to it
 boolean register(DeploymentDockRegistryClient deplDock, java.lang.String name)
          Registers a new running dock
 boolean unregister(java.lang.String name)
          Unregisters a deployment dock
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeploymentDockRegistryImpl

public DeploymentDockRegistryImpl(java.rmi.registry.Registry registry)
                           throws java.lang.Exception
The constructor

Parameters:
registry - The registry where the DDR itself should be registered
Throws:
java.lang.Exception
Method Detail

register

public boolean register(DeploymentDockRegistryClient deplDock,
                        java.lang.String name)
                 throws java.rmi.RemoteException
Registers a new running dock

Specified by:
register in interface DeploymentDockRegistry
Parameters:
deplDock - The deployment dock
name - Its name
Returns:
True if the registration was successfull
Throws:
java.rmi.RemoteException

unregister

public boolean unregister(java.lang.String name)
                   throws java.rmi.RemoteException
Unregisters a deployment dock

Specified by:
unregister in interface DeploymentDockRegistry
Parameters:
name - The name of the dock to unregister
Returns:
True if the unregistration was successfull
Throws:
java.rmi.RemoteException

lookup

public DeploymentDockRegistryClient lookup(java.lang.String name)
                                    throws java.rmi.RemoteException,
                                           DockNotFoundException
Finds a deployment dock and return a reference to it

Specified by:
lookup in interface DeploymentDockRegistry
Parameters:
name - The name of the deployment dock to look up
Returns:
A reference to the given deployment dock
Throws:
java.rmi.RemoteException
DockNotFoundException

getAllNames

public java.lang.String[] getAllNames()
                               throws java.rmi.RemoteException
Gets the names of all registered (and reachable) deployment docks

Specified by:
getAllNames in interface DeploymentDockRegistry
Returns:
An array of all registered docks
Throws:
java.rmi.RemoteException