Class Register


  • public class Register
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      Register​(Supervisor orb, SlobrokList slobroks, Spec spec)
      Create a new Register using the given Supervisor, slobrok connect specs, hostname and port
      Register​(Supervisor orb, SlobrokList slobroks, Spec spec, BackOffPolicy bop)
      Create a new Register using the given Supervisor, slobrok connect specs, hostname and port
      Register​(Supervisor orb, SlobrokList slobroks, java.lang.String myHost, int myPort)
      Create a new Register using the given Supervisor, slobrok connect specs, hostname and port
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void registerName​(java.lang.String name)
      Register a service with the slobrok cluster.
      void shutdown()
      Shut down the Register.
      void unregisterName​(java.lang.String name)
      Unregister a service with the slobrok cluster
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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,
                        java.lang.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 Detail

      • shutdown

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

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

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