|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprovided.rmiUtils.RMIUtils
public class RMIUtils
Utilities to make it easier to get a hold of the Registry
| Field Summary | |
|---|---|
private ClassFileServer |
classFileServer
A class file server to enable remote dynamic class loading of the ICompute object. |
private IVoidLambda<java.lang.String> |
outputCmd
Command used to output strings to one or more destinations. |
| Constructor Summary | |
|---|---|
RMIUtils(IVoidLambda<java.lang.String> outputCmd)
Constructor for the class. |
|
| Method Summary | |
|---|---|
private void |
configRMIProperties(int classServerPort)
Sets the java.rmi.server.hostname and java.rmi.server.codebase system properties which control the automatic remote dynamic class loading. |
private void |
configSecurityManager()
Sets the java.security.policy system property to point at the location of the security policy file, which is assumed to be at "provided\rmiUtils\server.policy" (file separators adjusted to match operating system). |
java.lang.String |
getLocalAddress()
This method is designed to reliably return the actual local IP address across multiple platforms, particularly Linux. |
java.rmi.registry.Registry |
getLocalRegistry()
Returns the Registry on the local machine on port IRMI_Defs.REGISTRY_PORT, as a server would require. |
java.rmi.registry.Registry |
getRemoteRegistry(java.lang.String host)
Returns the Registry on the given machine on port IRMI_Defs.REGISTRY_PORT, as a client would require. |
private void |
startClassFileServer(int classServerPort)
Start the class file server to support remote dynamic class loading. |
void |
startRMI(int classServerPort)
Start up the RMI system. |
private void |
stopClassFileServer()
Stop the class file server and reset the reference to it, "classFileServer", to null. |
void |
stopRMI()
Performs all necessary work to shut the RMI system down, such as shut the class server down. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private IVoidLambda<java.lang.String> outputCmd
private ClassFileServer classFileServer
| Constructor Detail |
|---|
public RMIUtils(IVoidLambda<java.lang.String> outputCmd)
outputCmd - command used to output status and error information| Method Detail |
|---|
public java.rmi.registry.Registry getLocalRegistry()
getLocalRegistry in interface IRMIUtilspublic java.rmi.registry.Registry getRemoteRegistry(java.lang.String host)
getRemoteRegistry in interface IRMIUtilshost - the IP address or host name of the remote machine.
public java.lang.String getLocalAddress()
throws java.net.SocketException,
java.net.UnknownHostException
getLocalAddress in interface IRMIUtilsjava.net.SocketException - thrown when there is a problem retrieving the network
interfaces.
java.net.UnknownHostException - thrown when the local host address cannot be found.public void startRMI(int classServerPort)
startRMI in interface IRMIUtilsclassServerPort - the port that the class server will useprivate void configRMIProperties(int classServerPort)
classServerPort - The port the class server will use.private void configSecurityManager()
private void startClassFileServer(int classServerPort)
classServerPort - the port the class file server will use.private void stopClassFileServer()
public void stopRMI()
stopRMI in interface IRMIUtils
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||