com.twitter.common.net.pool
Interface DynamicHostSet<T>

Type Parameters:
T - The type that is used to identify members of the host set.
All Known Subinterfaces:
ServerSet
All Known Implementing Classes:
ServerSetImpl

public interface DynamicHostSet<T>

A host set that can be monitored for changes.


Nested Class Summary
static interface DynamicHostSet.HostChangeMonitor<T>
          An interface to an object that is interested in receiving notification whenever the host set changes.
static class DynamicHostSet.MonitorException
           
 
Method Summary
 void monitor(DynamicHostSet.HostChangeMonitor<T> monitor)
          Registers a monitor to receive change notices for this server set as long as this jvm process is alive.
 

Method Detail

monitor

void monitor(DynamicHostSet.HostChangeMonitor<T> monitor)
             throws DynamicHostSet.MonitorException
Registers a monitor to receive change notices for this server set as long as this jvm process is alive. Blocks until the initial server set can be gathered and delivered to the monitor. The monitor will be notified if the membership set or parameters of existing members have changed.

Parameters:
monitor - the server set monitor to call back when the host set changes
Throws:
DynamicHostSet.MonitorException - if there is a problem monitoring the host set