Class Register

java.lang.Object
com.yahoo.jrt.slobrok.api.Register

public class Register extends Object
A Register object is used to register and unregister services with a slobrok cluster. The register/unregister operations performed against this object are stored in a to-do list that will be performed asynchronously against the slobrok cluster as soon as possible.
  • Constructor Details

    • Register

      public Register(Supervisor orb, SlobrokList slobroks, Spec spec, BackOffPolicy bop)
      Create a new Register using the given Supervisor, slobrok connect specs, hostname and port
      Parameters:
      orb - the Supervisor to use
      slobroks - slobrok connect spec list
      spec - the Spec representing hostname and port for this host
      bop - custom backoff policy, mostly useful for testing
    • Register

      public Register(Supervisor orb, SlobrokList slobroks, Spec spec)
      Create a new Register using the given Supervisor, slobrok connect specs, hostname and port
      Parameters:
      orb - the Supervisor to use
      slobroks - slobrok connect spec list
      spec - the Spec representing hostname and port for this host
    • Register

      public Register(Supervisor orb, SlobrokList slobroks, String myHost, int myPort)
      Create a new Register using the given Supervisor, slobrok connect specs, hostname and port
      Parameters:
      orb - the Supervisor to use
      slobroks - slobrok connect spec list
      myHost - the hostname of this host
      myPort - the port number we are listening to
  • Method Details

    • shutdown

      public void shutdown()
      Shut down the Register. This will close any open connections and stop the regular re-registration.
    • registerName

      public void registerName(String name)
      Register a service with the slobrok cluster.
      Parameters:
      name - service name
    • unregisterName

      public void unregisterName(String name)
      Unregister a service with the slobrok cluster
      Parameters:
      name - service name