Package com.yahoo.jrt.slobrok.api
Class Register
java.lang.Object
com.yahoo.jrt.slobrok.api.Register
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
ConstructorDescriptionRegister
(Supervisor orb, SlobrokList slobroks, Spec spec) Create a new Register using the given Supervisor, slobrok connect specs, hostname and portRegister
(Supervisor orb, SlobrokList slobroks, Spec spec, BackOffPolicy bop) Create a new Register using the given Supervisor, slobrok connect specs, hostname and portRegister
(Supervisor orb, SlobrokList slobroks, String myHost, int myPort) Create a new Register using the given Supervisor, slobrok connect specs, hostname and port -
Method Summary
Modifier and TypeMethodDescriptionvoid
registerName
(String name) Register a service with the slobrok cluster.void
shutdown()
Shut down the Register.void
unregisterName
(String name) Unregister a service with the slobrok cluster
-
Constructor Details
-
Register
Create a new Register using the given Supervisor, slobrok connect specs, hostname and port- Parameters:
orb
- the Supervisor to useslobroks
- slobrok connect spec listspec
- the Spec representing hostname and port for this hostbop
- custom backoff policy, mostly useful for testing
-
Register
Create a new Register using the given Supervisor, slobrok connect specs, hostname and port- Parameters:
orb
- the Supervisor to useslobroks
- slobrok connect spec listspec
- the Spec representing hostname and port for this host
-
Register
Create a new Register using the given Supervisor, slobrok connect specs, hostname and port- Parameters:
orb
- the Supervisor to useslobroks
- slobrok connect spec listmyHost
- the hostname of this hostmyPort
- 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
Register a service with the slobrok cluster.- Parameters:
name
- service name
-
unregisterName
Unregister a service with the slobrok cluster- Parameters:
name
- service name
-