public interface Group<T extends NodeState> extends Closeable
Modifier and Type | Method and Description |
---|---|
void |
add(GroupListener<T> listener)
Registers a listener which will be called
when the cluster membership changes or
the group is connected or disconnected.
|
void |
close()
A member should be closed to release acquired resources used
to monitor the group membership.
|
T |
getLastState()
Gets the last state.
|
boolean |
isConnected()
Are we connected with the cluster?
|
boolean |
isMaster()
Check if we are the master.
|
T |
master()
Retrieve the master node.
|
Map<String,T> |
members()
Get the list of members connected to this group.
|
void |
remove(GroupListener<T> listener)
Removes a previously added listener.
|
List<T> |
slaves()
Retrieve the list of slaves.
|
void |
start()
Start this member
|
void |
update(T state)
Update the state of this group member.
|
boolean isConnected()
void start()
void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
void add(GroupListener<T> listener)
void remove(GroupListener<T> listener)
void update(T state)
state
- the new state of this group memberboolean isMaster()
T master()
Apache Camel