|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.cluster.ClusterManager
public class ClusterManager
A cluster manager is responsible for triggering events related to clustering. A future version will also provide statistics about the cluster.
Field Summary | |
---|---|
static String |
CLUSTER_PROPERTY_NAME
|
Constructor Summary | |
---|---|
ClusterManager()
|
Method Summary | |
---|---|
static void |
addListener(ClusterEventListener listener)
Registers a listener to receive events. |
static void |
fireJoinedCluster(boolean asynchronous)
Triggers event indicating that this JVM is now part of a cluster. |
static void |
fireJoinedCluster(byte[] nodeID,
boolean asynchronous)
Triggers event indicating that another JVM is now part of a cluster. |
static void |
fireLeftCluster()
Triggers event indicating that this JVM is no longer part of the cluster. |
static void |
fireLeftCluster(byte[] nodeID)
Triggers event indicating that another JVM is no longer part of the cluster. |
static void |
fireMarkedAsSeniorClusterMember()
Triggers event indicating that this JVM is now the senior cluster member. |
static int |
getMaxClusterNodes()
Returns the maximum number of cluster members allowed. |
static Collection<ClusterNodeInfo> |
getNodesInfo()
Returns basic information about the current members of the cluster or an empty collection if not running in a cluster. |
static NodeID |
getSeniorClusterMember()
Returns the id of the node that is the senior cluster member. |
static boolean |
isClusteringAvailable()
Returns true if clustering is installed and can be used by this JVM to join a cluster. |
static boolean |
isClusteringEnabled()
Returns true if clustering support is enabled. |
static boolean |
isClusteringStarted()
Returns true if this JVM is part of a cluster. |
static boolean |
isClusteringStarting()
Returns true is clustering is currently being started. |
static boolean |
isClusterMember(byte[] nodeID)
Returns true if the specified node ID belongs to a known cluster node of this cluster. |
static boolean |
isSeniorClusterMember()
Returns true if this member is the senior member in the cluster. |
static void |
removeListener(ClusterEventListener listener)
Unregisters a listener to receive events. |
static void |
setClusteringEnabled(boolean enabled)
Sets true if clustering support is enabled. |
static void |
shutdown()
Shuts down the clustering service. |
static void |
startup()
Starts the cluster service if clustering is enabled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String CLUSTER_PROPERTY_NAME
Constructor Detail |
---|
public ClusterManager()
Method Detail |
---|
public static void addListener(ClusterEventListener listener)
listener
- the listener.public static void removeListener(ClusterEventListener listener)
listener
- the listener.public static void fireJoinedCluster(boolean asynchronous)
XMPPServer.getNodeID()
holds the new nodeID value and
the old nodeID value is passed in case the listener needs it.When joining the cluster as the senior cluster member the
fireMarkedAsSeniorClusterMember()
event will be sent right after this event.This event will be triggered in another thread. This will avoid potential deadlocks in Coherence.
asynchronous
- true if event will be triggered in backgroundpublic static void fireJoinedCluster(byte[] nodeID, boolean asynchronous)
This event will be triggered in another thread. This will avoid potential deadlocks in Coherence.
nodeID
- nodeID assigned to the JVM when joining the cluster.asynchronous
- true if event will be triggered in backgroundpublic static void fireLeftCluster()
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.
public static void fireLeftCluster(byte[] nodeID)
nodeID
- nodeID assigned to the JVM when joining the cluster.public static void fireMarkedAsSeniorClusterMember()
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
fireLeftCluster()
and fireJoinedCluster(boolean)
events.This event will be triggered in another thread. This will avoid potential deadlocks in Coherence.
public static void startup()
public static void shutdown()
public static void setClusteringEnabled(boolean enabled)
enabled
- if clustering support is enabled.public static boolean isClusteringEnabled()
public static boolean isClusteringAvailable()
public static boolean isClusteringStarting()
public static boolean isClusteringStarted()
public static boolean isSeniorClusterMember()
public static Collection<ClusterNodeInfo> getNodesInfo()
public static int getMaxClusterNodes()
public static NodeID getSeniorClusterMember()
XMPPServer.getNodeID()
.
public static boolean isClusterMember(byte[] nodeID)
nodeID
- the ID of the node to verify.
|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |