com.twitter.common.zookeeper.guice
Class ServerSetModule

java.lang.Object
  extended by com.google.inject.AbstractModule
      extended by com.twitter.common.zookeeper.guice.ServerSetModule
All Implemented Interfaces:
Module

public class ServerSetModule
extends AbstractModule

A module that registers all ports in the LocalServiceRegistry in an ServerSet. Required bindings:

LifecycleModule must also be included by users so a startup action may be registered. Provided bindings:


Field Summary
protected static  SERVERSET_PATH
          
Constructor Summary
ServerSetModule()
          Calls ServerSetModule(Optional) with an absent value.
ServerSetModule(Optional<String> auxPortAsPrimary)
          Calls ServerSetModule(Status, Optional) with initial status Status#ALIVE.
ServerSetModule(Status initialStatus)
          Constructs a ServerSetModule that registers a startup action that registers this process in ZooKeeper, with the specified initial Status.
ServerSetModule(Status initialStatus, Optional<String> auxPortAsPrimary)
          Constructs a ServerSetModule that registers a startup action to register this process in ZooKeeper, with the specified initial status and auxiliary port to represent as the primary service port.
 
Method Summary
protected  void configure()
           
 
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVERSET_PATH

Constructor Detail

ServerSetModule

public ServerSetModule()
Calls ServerSetModule(Optional) with an absent value.


ServerSetModule

public ServerSetModule(Optional<String> auxPortAsPrimary)
Calls ServerSetModule(Status, Optional) with initial status Status#ALIVE.

Parameters:
auxPortAsPrimary - Name of the auxiliary port to use as the primary port.

ServerSetModule

public ServerSetModule(Status initialStatus)
Constructs a ServerSetModule that registers a startup action that registers this process in ZooKeeper, with the specified initial Status.

Parameters:
initialStatus - initial Status to report to ZooKeeper.

ServerSetModule

public ServerSetModule(Status initialStatus,
                       Optional<String> auxPortAsPrimary)
Constructs a ServerSetModule that registers a startup action to register this process in ZooKeeper, with the specified initial status and auxiliary port to represent as the primary service port.

Parameters:
initialStatus - initial Status to report to ZooKeeper.
auxPortAsPrimary - Name of the auxiliary port to use as the primary port.
Method Detail

configure

protected void configure()
Specified by:
configure in class AbstractModule