|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.mgmt.ClusterManager
public class ClusterManager
The ClusterManager is the entry point for using the cluster management module which provides group communications and membership semantics on top of JXTA, Grizzly and others.
| Constructor Summary | |
|---|---|
ClusterManager(String groupName,
String instanceName,
Map<String,String> identityMap,
Map props,
List<ClusterViewEventListener> viewListeners,
List<ClusterMessageListener> messageListeners)
The ClusterManager is created using the instanceName, and a Properties object that contains a set of parameters that the employing application would like to set for its purposes, namely, configuration parameters such as failure detection timeout, retries, address and port on which to communicate with the group, group and instance IDs,etc. |
|
| Method Summary | |
|---|---|
void |
addClusteMessageListener(ClusterMessageListener listener)
|
ClusterViewManager |
getClusterViewManager()
Returns the ClusterViewManager object. |
String |
getGroupName()
|
HealthMonitor |
getHealthMonitor()
Returns the HealthMonitor instance. |
PeerID |
getID(String name)
Returns name encoded ID |
String |
getInstanceName()
Gets the instance name |
com.sun.enterprise.mgmt.MasterNode |
getMasterNode()
Returns the MasterNode instance |
NetworkManager |
getNetworkManager()
|
NetworkManager |
getNetworkManager(String transport)
Returns the NetworkManager instance |
String |
getNodeState(PeerID peerID,
long threshold,
long timeout)
|
PeerID |
getPeerID()
|
SystemAdvertisement |
getSystemAdvertisement()
Gets the systemAdvertisement attribute of the JXTAPlatform object |
SystemAdvertisement |
getSystemAdvertisementForMember(PeerID id)
|
int |
getType()
Returns the message type which Message is supporting
i.g. |
void |
groupStartup(GMSConstants.groupStartupState startupState,
List<String> memberTokens)
|
boolean |
isDiscoveryInProgress()
|
boolean |
isGroupStartup()
|
boolean |
isMaster()
|
boolean |
isWatchdog()
|
void |
notifyNewMaster()
|
void |
receiveMessageEvent(MessageEvent event)
Processing a MessageEvent |
void |
removeClusterViewEventListener(ClusterMessageListener listener)
|
void |
reportJoinedAndReadyState()
|
boolean |
send(PeerID peerid,
Serializable msg)
|
boolean |
send(PeerID peerid,
Serializable msg,
boolean validatePeeridInView)
Send a message to a specific node or the group. |
void |
setClusterStopping()
|
void |
start()
Starts the ClusterManager and all it's services |
void |
stop(boolean isClusterShutdown)
Stops the ClusterManager and all it's services |
void |
takeOverMasterRole()
|
void |
waitFor(long msec)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClusterManager(String groupName,
String instanceName,
Map<String,String> identityMap,
Map props,
List<ClusterViewEventListener> viewListeners,
List<ClusterMessageListener> messageListeners)
throws GMSException
groupName - Name of Group to which this process/peer seeks
membershipinstanceName - A token identifying this instance/processidentityMap - Additional identity tokens can be specified through
this Map object. These become a part of the
SystemAdvertisement allowing the peer/system to
be identified by the application layer based on their
own notion of identityprops - a Properties object containing parameters that are
allowed to be specified by employing application
//TODO: specify that INFRA IDs and address/port are
composite keys in essence but addresses/ports could
be shared across ids with a performance penalty.
//TODO: provide an API to send messages, synchronously or asynchronouslyviewListeners - listeners interested in group view change eventsmessageListeners - listeners interested in receiving messages.
GMSException| Method Detail |
|---|
public boolean isWatchdog()
public void addClusteMessageListener(ClusterMessageListener listener)
public void removeClusterViewEventListener(ClusterMessageListener listener)
public void stop(boolean isClusterShutdown)
isClusterShutdown - true if this peer is shutting down as part of cluster wide shutdownpublic void start()
public NetworkManager getNetworkManager(String transport)
public NetworkManager getNetworkManager()
public com.sun.enterprise.mgmt.MasterNode getMasterNode()
public HealthMonitor getHealthMonitor()
public ClusterViewManager getClusterViewManager()
public PeerID getPeerID()
public String getInstanceName()
public boolean isMaster()
public boolean send(PeerID peerid,
Serializable msg,
boolean validatePeeridInView)
throws IOException,
MemberNotInViewException
peerid - the node IDmsg - the message to send
true if the message has been sent otherwise
false. false. is commonly returned for
non-error related congestion, meaning that you should be able to send
the message after waiting some amount of time.
IOException - if an io error occurs
MemberNotInViewException
public boolean send(PeerID peerid,
Serializable msg)
throws IOException,
MemberNotInViewException
IOException
MemberNotInViewException
public void receiveMessageEvent(MessageEvent event)
throws MessageIOException
MessageEvent
receiveMessageEvent in interface MessageListenerevent - a received message event
MessageIOException - if I/O error occurspublic int getType()
MessageListenerMessage is supporting
i.g. Message.TYPE_CLUSTER_MANAGER_MESSAGE or Message.TYPE_HEALTH_MONITOR_MESSAGE's integer value or etc...
getType in interface MessageListenerpublic SystemAdvertisement getSystemAdvertisementForMember(PeerID id)
public SystemAdvertisement getSystemAdvertisement()
public String getNodeState(PeerID peerID,
long threshold,
long timeout)
public PeerID getID(String name)
name - to name to encode
public void takeOverMasterRole()
public void setClusterStopping()
public void waitFor(long msec)
public void notifyNewMaster()
public void reportJoinedAndReadyState()
public void groupStartup(GMSConstants.groupStartupState startupState,
List<String> memberTokens)
public boolean isGroupStartup()
public String getGroupName()
public boolean isDiscoveryInProgress()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||