com.tc.cluster
Interface DsoClusterListener


public interface DsoClusterListener

A listener interface that can be implemented to be notified about DSO cluster events.

Listeners can be registered through the addClusterListener method and removed through the removeClusterListener method of a DsoCluster 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.

Since:
3.0.0

Method Summary
 void nodeJoined(DsoClusterEvent event)
          Sent when a node joined the cluster, including the current node.
 void nodeLeft(DsoClusterEvent event)
          Sent when a node left the cluster, including the current node.
 void operationsDisabled(DsoClusterEvent event)
          Sent when cluster operations are disabled on a node, no cluster operations can go through.
 void operationsEnabled(DsoClusterEvent event)
          Sent when cluster operations are enabled on a node, any operations will go through and propagate through the cluster.
 

Method Detail

nodeJoined

void nodeJoined(DsoClusterEvent event)
Sent when a node joined the cluster, including the current node.

This event happens once for the lifetime of a node.

Parameters:
event - provides more information about the event
See Also:
DsoCluster.isNodeJoined()

nodeLeft

void nodeLeft(DsoClusterEvent event)
Sent when a node left the cluster, including the current node.

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.

Parameters:
event - provides more information about the event
See Also:
DsoCluster.isNodeJoined()

operationsEnabled

void operationsEnabled(DsoClusterEvent event)
Sent when cluster operations are enabled on a node, any operations will go through and propagate through the cluster.

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.

Parameters:
event - provides more information about the event
See Also:
DsoCluster.areOperationsEnabled()

operationsDisabled

void operationsDisabled(DsoClusterEvent event)
Sent when cluster operations are disabled on a node, no cluster operations can go through.

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.

Parameters:
event - provides more information about the event
See Also:
DsoCluster.areOperationsEnabled()


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.