Package com.yahoo.jrt.slobrok.api
Class Register
- java.lang.Object
-
- com.yahoo.jrt.slobrok.api.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 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, 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
-
-
-
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 useslobroks
- slobrok connect spec listspec
- the Spec representing hostname and port for this hostbop
- 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 useslobroks
- slobrok connect spec listspec
- 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 useslobroks
- slobrok connect spec listmyHost
- the hostname of this hostmyPort
- 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
-
-