|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--springs.util.RMIUtilities
Utilities for RMI.
Field Summary |
Constructor Summary | |
RMIUtilities()
|
Method Summary | |
static java.lang.String |
convert2LookupString(java.lang.String url,
java.lang.String agentName)
Converts into a lookup string. |
static java.lang.String |
convertURL2RMIFormat(java.lang.String url)
Converts an URL into the RMI format. |
static java.lang.String |
getURL(java.lang.String host,
int port)
Gets an RMI URL. |
static java.lang.Object |
lookup(java.lang.String url,
java.lang.String objectName)
Searches for an object. |
static boolean |
ping(int port)
Checks if there is an RMI registry in the given port. |
static boolean |
ping(java.lang.String host,
int port)
Checks if there is an RMI registry in the given port and host. |
static void |
printObjects(java.lang.String url)
Prints the names of the objects registered in the given URL. |
static void |
printObjects(java.lang.String host,
int port)
Prints the names of the objects registered in the given RMI server. |
static void |
printObjectsLocalRegistry()
Prints the names of the objects registered in the local RMI registry. |
static void |
registerServer(java.lang.String name,
java.rmi.Remote server,
int port)
Registers a server in the given port. |
static void |
registerServer(java.lang.String name,
java.rmi.Remote server,
java.rmi.registry.Registry registry,
int port)
Registers a server in the given port. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RMIUtilities()
Method Detail |
public static java.lang.String convertURL2RMIFormat(java.lang.String url)
url
- the URL.
String
public static java.lang.String convert2LookupString(java.lang.String url, java.lang.String agentName)
url
- the URL.agentName
- the name of the agent.
String
public static java.lang.String getURL(java.lang.String host, int port)
host
- the host name.port
- the port number.
String
public static java.lang.Object lookup(java.lang.String url, java.lang.String objectName) throws CommunicationException
url
- the URL of the object.objectName
- the name of the object.
CommunicationException
- if there is an error.Object
,
String
,
CommunicationException
public static void printObjectsLocalRegistry()
public static void printObjects(java.lang.String host, int port) throws java.rmi.RemoteException, java.net.MalformedURLException
host
- the host name.port
- the port number.
java.rmi.RemoteException
- if the registry cannot be contacted.
java.net.MalformedURLException
- if the URL is wrong.String
,
RemoteException
,
MalformedURLException
public static void printObjects(java.lang.String url) throws java.rmi.RemoteException, java.net.MalformedURLException
url
- the URL.
java.rmi.RemoteException
- if the registry cannot be contacted.
java.net.MalformedURLException
- if the URL is wrong.String
,
RemoteException
,
MalformedURLException
public static boolean ping(int port)
port
- the port number.
public static boolean ping(java.lang.String host, int port)
host
- the host.port
- the port number.
String
public static void registerServer(java.lang.String name, java.rmi.Remote server, int port) throws java.rmi.RemoteException
name
- the name of the server.server
- the server.port
- the port.
java.rmi.RemoteException
- if the registry cannot be contacted.String
,
Remote
,
RemoteException
public static void registerServer(java.lang.String name, java.rmi.Remote server, java.rmi.registry.Registry registry, int port) throws java.rmi.RemoteException
name
- the name of the server.server
- the server.port
- the port.registry
- the registry.
java.rmi.RemoteException
String
,
Remote
,
Registry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |