|
SmartFrog 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.smartfrog.sfcore.processcompound.DefaultRootLocatorImpl
public class DefaultRootLocatorImpl
Defines a default root locator for SmartFrog Processes. The root locator knows how to set a process compound to be the root of a host, as well as the method on how to get the root process compound on a given host and port. This implementation uses the rmi registry to set the root process compound in. Root Locators should not allow multiple process compounds to set themselves as root.
| Field Summary | |
|---|---|
protected static java.lang.String |
defaultName
Name under which the root process compound will name itself. |
protected static java.rmi.registry.Registry |
registry
RMI Registry. |
protected static int |
registryPort
Port for registry. |
| Constructor Summary | |
|---|---|
DefaultRootLocatorImpl()
Constructs the DefaultRootLocatorImpl object. |
|
| Method Summary | |
|---|---|
protected static int |
getRegistryPort(ProcessCompound c)
Gets the port of RMI registry on which input process compound is running or if ProcessCompound is null then the 'sfRootLocatorPort' is read from processcompound.sf description |
ProcessCompound |
getRootProcessCompound(java.net.InetAddress hostAddress)
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)
Tries to make the requesting process compound the root of the entire host. |
void |
unbindRootProcessCompound()
Unbinds root process compound from local registry. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.lang.String defaultName
protected static int registryPort
protected static java.rmi.registry.Registry registry
| Constructor Detail |
|---|
public DefaultRootLocatorImpl()
| Method Detail |
|---|
protected static int getRegistryPort(ProcessCompound c)
throws SmartFrogException,
java.rmi.RemoteException
c - Instance of process compound
SmartFrogException - fails to get the registry port
java.rmi.RemoteException - In case of network/rmi error
public void setRootProcessCompound(ProcessCompound c)
throws SmartFrogException,
java.rmi.RemoteException
setRootProcessCompound in interface RootLocatorc - compound which wants to become root for machine
SmartFrogException - could not create locator or bind compound
java.rmi.RemoteException - In case of network/rmi errorgetRootProcessCompound(java.net.InetAddress)
public void unbindRootProcessCompound()
throws SmartFrogException,
java.rmi.RemoteException
unbindRootProcessCompound in interface RootLocatorjava.rmi.RemoteException - if there is any network/rmi error
SmartFrogRuntimeException - if failed to unbind
SmartFrogException - if failed to unbind
public ProcessCompound getRootProcessCompound(java.net.InetAddress hostAddress)
throws java.lang.Exception
getRootProcessCompound in interface RootLocatorhostAddress - host to look up root process compound
java.lang.Exception - if error locating root process compound on hostsetRootProcessCompound(org.smartfrog.sfcore.processcompound.ProcessCompound)
public ProcessCompound getRootProcessCompound(java.net.InetAddress hostAddress,
int portNum)
throws java.lang.Exception
getRootProcessCompound in interface RootLocatorhostAddress - host to look up root process compoundportNum - port to locate registry for root process conmpound if not
default
java.lang.Exception - error locating root process compound on hostsetRootProcessCompound(org.smartfrog.sfcore.processcompound.ProcessCompound)
|
SmartFrog CORE 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||