org.jminor.common.server
Class ServerUtil

java.lang.Object
  extended by org.jminor.common.server.ServerUtil

public final class ServerUtil
extends Object

A utility class for working with RemoteServer instances.


Method Summary
static RemoteServer getServer(String serverHostName, String serverNamePrefix)
          Retrieves a RemoteServer from a registry running on the given host, using the given prefix as a criteria.
static RemoteServer getServer(String serverHostName, String serverNamePrefix, int port)
          Retrieves a RemoteServer from a registry running on the given host, using the given prefix as a criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServer

public static RemoteServer getServer(String serverHostName,
                                     String serverNamePrefix)
                              throws RemoteException,
                                     NotBoundException
Retrieves a RemoteServer from a registry running on the given host, using the given prefix as a criteria.

Parameters:
serverHostName - the name of the host
serverNamePrefix - the server name prefix, an empty string results in all servers being returned
Returns:
the servers having a name with the given prefix
Throws:
RemoteException - in case of a remote exception
NotBoundException - in case no such server is found

getServer

public static RemoteServer getServer(String serverHostName,
                                     String serverNamePrefix,
                                     int port)
                              throws RemoteException,
                                     NotBoundException
Retrieves a RemoteServer from a registry running on the given host, using the given prefix as a criteria.

Parameters:
serverHostName - the name of the host
serverNamePrefix - the server name prefix, an empty string results in all servers being returned
port - the required server port, -1 for any port
Returns:
the servers having a name with the given prefix
Throws:
RemoteException - in case of a remote exception
NotBoundException - in case no such server is found