public class ClusterMonitor extends Object implements Module, ClusterEventListener
| Constructor and Description |
|---|
ClusterMonitor() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Module should free all resources and prepare for deallocation.
|
String |
getName()
Returns the name of the module for display in administration interfaces.
|
void |
initialize(XMPPServer xmppServer)
Initialize the module with the container.
|
void |
joinedCluster()
Notification event indicating that this JVM is now part of a cluster.
|
void |
joinedCluster(byte[] nodeIdBytes)
Notification event indicating that another JVM is now part of a cluster.
|
void |
leftCluster()
Notification event indicating that this JVM is no longer part of the cluster.
|
void |
leftCluster(byte[] nodeIdBytes)
Notification event indicating that another JVM is no longer part of the cluster.
|
void |
markedAsSeniorClusterMember()
Notification event indicating that this JVM is now the senior cluster member.
|
void |
start()
Start the module (must return quickly).
|
void |
stop()
Stop the module.
|
public String getName()
Modulepublic void initialize(XMPPServer xmppServer)
Moduleinitialize in interface ModulexmppServer - the server hosting this module.public void start()
Modulepublic void stop()
Modulepublic void destroy()
Modulepublic void joinedCluster()
ClusterEventListenerXMPPServer.getNodeID() holds the new nodeID value.
When joining the cluster as the senior cluster member the ClusterEventListener.markedAsSeniorClusterMember()
event will be sent right after this event.
At this point the CacheFactory holds clustered caches. That means that modifications to the caches will be reflected in the cluster. The clustered caches were just obtained from the cluster and no local cached data was automatically moved.
joinedCluster in interface ClusterEventListenerpublic void joinedCluster(byte[] nodeIdBytes)
ClusterEventListenerAt this point the CacheFactory of the new node holds clustered caches. That means that modifications to the caches of this JVM will be reflected in the cluster and in particular in the new node.
joinedCluster in interface ClusterEventListenernodeIdBytes - ID of the node that joined the cluster.public void leftCluster()
ClusterEventListener
Moreover, if we were in a "split brain" scenario (ie. separated cluster islands) and the
island were this JVM belonged was marked as "old" then all nodes of that island will
get the left cluster event and joined cluster events. That means that
caches will be reset and thus will need to be repopulated again with fresh data from this JVM.
This also includes the case where this JVM was the senior cluster member and when the islands
met again then this JVM stopped being the senior member.
At this point the CacheFactory holds local caches. That means that modifications to the caches will only affect this JVM.
leftCluster in interface ClusterEventListenerpublic void leftCluster(byte[] nodeIdBytes)
ClusterEventListener
Moreover, if we were in a "split brain" scenario (ie. separated cluster islands) and the
island were the other JVM belonged was marked as "old" then all nodes of that island will
get the left cluster event and joined cluster events. That means that
caches will be reset and thus will need to be repopulated again with fresh data from this JVM.
This also includes the case where the other JVM was the senior cluster member and when the islands
met again then the other JVM stopped being the senior member.
At this point the CacheFactory of the leaving node holds local caches. That means that modifications to the caches of this JVM will not affect the leaving node but other cluster members.
leftCluster in interface ClusterEventListenernodeIdBytes - ID of the node that is left the cluster.public void markedAsSeniorClusterMember()
ClusterEventListener
Moreover, in the case of a "split brain" scenario (ie. separated cluster islands) each
island will have its own senior cluster member. However, when the islands meet again there
could only be one senior cluster member so one of the senior cluster members will stop playing
that role. When that happens the JVM no longer playing that role will receive the
ClusterEventListener.leftCluster() and ClusterEventListener.joinedCluster() events.
markedAsSeniorClusterMember in interface ClusterEventListenerCopyright © 2003–2020 Ignite Realtime. All rights reserved.