|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClusterListener
A listener interface that can be implemented to be notified about terracotta cluster events.
Listeners can be registered through the addClusterListener method and removed through the
removeClusterListener method of a ClusterInfo instance.
The ordering and the timing of the events isn't guaranteed across the cluster. It is however guaranteed that the events can only appear in the following succession on each individual node:
The node joined and node left events are sent to all the nodes in the cluster and happen once for the
lifetime of a node.
The operations enabled and operations disabled events are repeatable and indicate temporary
situations that may resolve themselves automatically over time. Only the current node will receive events concerning
its own cluster operations. Nodes in the cluster don't get cluster operation events about other nodes.
| Method Summary | |
|---|---|
void |
nodeJoined(ClusterEvent event)
Sent when a node joined the cluster, including the current node. |
void |
nodeLeft(ClusterEvent event)
Sent when a node left the cluster, including the current node. |
void |
operationsDisabled(ClusterEvent event)
Sent when cluster operations are disabled on a node, no cluster operations can go through. |
void |
operationsEnabled(ClusterEvent event)
Sent when cluster operations are enabled on a node, any operations will go through and propagate through the cluster. |
| Method Detail |
|---|
void nodeJoined(ClusterEvent event)
This event happens once for the lifetime of a node.
event - provides more information about the eventClusterInfo.isNodeJoined()void nodeLeft(ClusterEvent event)
This event happens once for the lifetime of a node.
Note that this event might never be triggered for the node in question, other nodes in the cluster will however always receive this event about nodes that have permanently left the cluster.
event - provides more information about the eventClusterInfo.isNodeJoined()void operationsEnabled(ClusterEvent event)
This event can be repeated as many times as appropriate, but you're guaranteed to have always received a node left or operations disabled event before.
Only the current node will receive events concerning its own cluster operations.
event - provides more information about the eventClusterInfo.areOperationsEnabled()void operationsDisabled(ClusterEvent event)
They might propagate through the cluster if the operations are enabled again afterwards, however it's also possible that the nodes is forced to leave the cluster instead.
This event can be repeated as many times as appropriate, but you're guaranteed to have always received an operations enabled event before.
Only the current node will receive events concerning its own cluster operations.
event - provides more information about the eventClusterInfo.areOperationsEnabled()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||