Interface ClusterStateChangeFacility
-
public interface ClusterStateChangeFacility
Rhino extension facility that reports to a resource adaptor entity nodes on which it is activated or deactivated in the cluster.
As of Rhino 3.2, this facility has been updated to provide similar functionality for nodes running in the POOL clustering mode rather than the SAVANNA clustering mode but with some limitations. Refer to the documentation in the listener interfaces for more detail.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ClusterStateChangeFacility.ClusteringMode
Node clustering mode.
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_PROPERTY_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addStateChangeListener(ClusterStateChangeListener listener)
Add a state change listener.void
addStateChangeListener(ClusterStateChangeListenerV2 listener)
Add a v2 state change listener.void
addStateChangeListener(ClusterStateChangeListenerV3 listener)
Add a v3 state change listener.ClusterStateChangeFacility.ClusteringMode
getClusteringMode()
Get the clustering mode that the node is configured to use.String[]
getClusterMembers()
Get the set of current cluster members.String
getNodeID()
Get the node ID of this node.boolean
isClusterMember(String nodeID)
Determine if the specified node is a current live cluster member.void
removeStateChangeListener(ClusterStateChangeListener listener)
Remove a state change listener.void
removeStateChangeListener(ClusterStateChangeListenerV2 listener)
Remove a v2 state change listener.void
removeStateChangeListener(ClusterStateChangeListenerV3 listener)
Remove a v3 state change listener.
-
-
-
Field Detail
-
CONFIG_PROPERTY_NAME
static final String CONFIG_PROPERTY_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNodeID
String getNodeID()
Get the node ID of this node.
NoteFor compatibility with pool mode, this method returns the node ID as a String
value. When using the savanna clustering mode, this value can be converted back into its numeric form usingInteger.parseInt(String)
.- Returns:
- the node ID of this node.
- Since:
- Rhino 3.2
- See Also:
RhinoExtensionProperties.NODE_ID
,RhinoExtensionProperties.NODE_ID_STRING
-
getClusteringMode
ClusterStateChangeFacility.ClusteringMode getClusteringMode()
Get the clustering mode that the node is configured to use.
- Returns:
- the clustering mode configured for the node.
- Since:
- Rhino 3.2
-
getClusterMembers
String[] getClusterMembers()
Get the set of current cluster members.
-
If
getClusteringMode()
returnsClusterStateChangeFacility.ClusteringMode.SAVANNA
then this method returns the set of current savanna cluster members, regardless of their current actual SLEE state or resource adaptor entity actual state. -
If
getClusteringMode()
returnsClusterStateChangeFacility.ClusteringMode.POOL
then this method returns the set of current live or assumed-live pool nodes, regardless of their current actual SLEE state.
NoteFor compatibility with pool mode, this method returns node IDs as String
values. When using the savanna clustering mode, these string values can be converted back into their numeric form usingInteger.parseInt(String)
.- Returns:
- the set of current cluster members.
- Since:
- Rhino 3.2
-
-
isClusterMember
boolean isClusterMember(String nodeID)
Determine if the specified node is a current live cluster member.
NoteFor compatibility with pool mode, this method requires the node ID to be expressed as a String
value. When using the savanna clustering mode, an integer node ID can be converted to the appropriate string value for this method usingString.valueOf(int)
.- Parameters:
nodeID
- the node ID to check.- Returns:
true
if the specified node is a current cluster member,false
otherwise.- Throws:
NullPointerException
- ifnodeID
isnull
.- Since:
- Rhino 3.2
-
addStateChangeListener
void addStateChangeListener(ClusterStateChangeListener listener)
Add a state change listener.
If the listener has not already been added then
clusterStateChange
will be immediately invoked on it to notify the listener of the current cluster state. In this instance the joined set will be equal to the running set.Typically this method would be called in
raConfigure(ConfigProperties)
orraActive()
- Parameters:
listener
- the state change listener
-
addStateChangeListener
void addStateChangeListener(ClusterStateChangeListenerV2 listener)
Add a v2 state change listener.
If the listener has not already been added then
clusterStateChange
will be immediately invoked on it to notify the listener of the current cluster state.Typically this method would be called in
raConfigure(ConfigProperties)
orraActive()
.- Parameters:
listener
- the state change listener.- Since:
- Rhino 2.6.1
-
addStateChangeListener
void addStateChangeListener(ClusterStateChangeListenerV3 listener)
Add a v3 state change listener.
If the listener has not already been added then
clusterStateChange
will be immediately invoked on it to notify the listener of the current cluster state.Typically this method would be called in
raConfigure(ConfigProperties)
orraActive()
.- Parameters:
listener
- the state change listener.- Since:
- Rhino 3.2
-
removeStateChangeListener
void removeStateChangeListener(ClusterStateChangeListener listener)
Remove a state change listener. This method does nothing if the specified listener was not previously added or has already been removed.
This method would typically be called in
raUnconfigure()
,raStopping()
, orraInactive()
- Parameters:
listener
-
-
removeStateChangeListener
void removeStateChangeListener(ClusterStateChangeListenerV2 listener)
Remove a v2 state change listener. This method does nothing if the specified listener was not previously added or has already been removed.
This method would typically be called in
raUnconfigure()
,raStopping()
, orraInactive()
.- Parameters:
listener
- the state change listener.- Since:
- Rhino 2.6.1
-
removeStateChangeListener
void removeStateChangeListener(ClusterStateChangeListenerV3 listener)
Remove a v3 state change listener. This method does nothing if the specified listener was not previously added or has already been removed.
This method would typically be called in
raUnconfigure()
,raStopping()
, orraInactive()
.- Parameters:
listener
- the state change listener.- Since:
- Rhino 3.2
-
-