Interface Server.Locator.Builder

Enclosing interface:
Server.Locator

public static interface Server.Locator.Builder
A builder for Server.Locator instances.
  • Method Details

    • hostname

      Server.Locator.Builder hostname(String hostname)
      Parameters:
      hostname - the name of the host
      Returns:
      this builder instance
    • namePrefix

      Server.Locator.Builder namePrefix(String namePrefix)
      Parameters:
      namePrefix - the server name prefix to use when looking up, an empty string results in all servers being returned
      Returns:
      this builder instance
    • registryPort

      Server.Locator.Builder registryPort(int registryPort)
      Parameters:
      registryPort - the port on which to lookup/configure the registry
      Returns:
      this builder instance
    • port

      Server.Locator.Builder port(int port)
      Parameters:
      port - the required server port, -1 for a server on any port
      Returns:
      this builder instance
    • locate

      <C extends Remote, A extends ServerAdmin> Server<C,A> locate() throws RemoteException, NotBoundException
      Retrieves a Server from the registry, using the configured hostname, registry port and server name prefix. Returns the first server satisfying the condition.
      Type Parameters:
      C - the Remote connection type served by the server
      A - the server admin type supplied by the server
      Returns:
      the first server whose name has the configured prefix
      Throws:
      RemoteException - in case of a remote exception
      NotBoundException - in case no such server is found