SmartFrog 3.10.000

org.smartfrog.sfcore.processcompound
Interface RootLocator

All Known Implementing Classes:
DefaultRootLocatorImpl

public interface RootLocator

Interface which root locators must implement. A root locator implementation maintains the resource which defines a process as being the root or owner process of a host. All other processcompounds in other processes on the same host must be slaves to the root process compound. A root locator should not allow multiple process compounds to identify themself as a root in a single process.


Method Summary
 ProcessCompound getRootProcessCompound(java.net.InetAddress host)
          Gets the root process compound for a given host.
 ProcessCompound getRootProcessCompound(java.net.InetAddress hostAddress, int portNum)
          Gets the root process compound for a given host on a specified port.
 void setRootProcessCompound(ProcessCompound c)
          Set given process compound as the root process compound for this host.
 void unbindRootProcessCompound()
          Unbinds root process compound from local registry.
 

Method Detail

setRootProcessCompound

void setRootProcessCompound(ProcessCompound c)
                            throws SmartFrogException,
                                   java.rmi.RemoteException
Set given process compound as the root process compound for this host.

Parameters:
c - process compound to set as root
Throws:
java.rmi.RemoteException - if there is any network/rmi error
SmartFrogException - if failed to set root
See Also:
getRootProcessCompound(java.net.InetAddress)

unbindRootProcessCompound

void unbindRootProcessCompound()
                               throws SmartFrogException,
                                      java.rmi.RemoteException
Unbinds root process compound from local registry.

Throws:
java.rmi.RemoteException - if there is any network/rmi error
SmartFrogException - if failed to unbind

getRootProcessCompound

ProcessCompound getRootProcessCompound(java.net.InetAddress host)
                                       throws java.lang.Exception
Gets the root process compound for a given host. If the passed host is null the root process compound for the local host is looked up.

Parameters:
host - host to get root compound for
Returns:
Root ProcessCompound
Throws:
java.lang.Exception - if failed to get process compound
See Also:
setRootProcessCompound(org.smartfrog.sfcore.processcompound.ProcessCompound)

getRootProcessCompound

ProcessCompound getRootProcessCompound(java.net.InetAddress hostAddress,
                                       int portNum)
                                       throws java.lang.Exception
Gets the root process compound for a given host on a specified port. If the passed host is null the root process compound for the local host is looked up. Checks if the local process compound is equal to the requested one, and returns the local object instead of the stub to avoid all calls going through RMI

Parameters:
hostAddress - host to look up root process compound
portNum - port to locate registry for root process conmpound if not default
Returns:
the root process compound on given host
Throws:
java.lang.Exception - if error locating root process compound on host
See Also:
setRootProcessCompound(org.smartfrog.sfcore.processcompound.ProcessCompound)

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP