- Enclosing interface:
- Server<C extends Remote,
A extends ServerAdmin>
public static interface Server.Locator
Locates
Server
s by name on a registry.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Server.Locator.Builder
builder()
Returns aServer.Locator.Builder
instance.<C extends Remote,
A extends ServerAdmin>
Server<C,A> Retrieves a Server from a registry running on the given host, using the given server name prefix as a condition.static Registry
registry()
Initializes a Registry if one is not running on the port defined byServerConfiguration.REGISTRY_PORT
static Registry
registry
(int registryPort) Initializes a Registry if one is not running
-
Method Details
-
locateServer
<C extends Remote,A extends ServerAdmin> Server<C,A> locateServer() throws RemoteException, NotBoundExceptionRetrieves a Server from a registry running on the given host, using the given server name prefix as a condition. Returns the first server satisfying the condition.- Type Parameters:
C
- the Remote connection type served by the serverA
- the server admin type supplied by the server- Returns:
- the servers having a name with the given prefix
- Throws:
RemoteException
- in case of a remote exceptionNotBoundException
- in case no such server is found
-
builder
Returns aServer.Locator.Builder
instance.- Returns:
- a
Server.Locator.Builder
instance.
-
registry
Initializes a Registry if one is not running on the port defined byServerConfiguration.REGISTRY_PORT
- Returns:
- the Registry
- Throws:
RemoteException
- in case of an exception
-
registry
Initializes a Registry if one is not running- Parameters:
registryPort
- the port on which to look for (or create) a registry- Returns:
- the Registry
- Throws:
RemoteException
- in case of an exception
-