public class McastClusterManager extends Object implements ClusterBroadcast, Runnable
McastListener, McastSender and McastPacketControl are the main helpers to this object.
This Manager (thread) periodically processes the ACK, Re-send and Control messages. The McastListener is handling all the incoming packets and informs this manager when interesting packets need to be processed by the Manager.
Other threads call broadcast(RemoteTransactionEvent) to send
transaction even information.
| Constructor and Description |
|---|
McastClusterManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(RemoteTransactionEvent remoteTransEvent)
Send the remoteTransEvent to all the other members of the cluster.
|
protected void |
fromListener(long newMinAcked,
MessageControl msgControl,
MessageResend msgResend,
int groupSize,
long totalPacketsReceived,
long totalBytesReceived,
long totalTxnEventsReceived)
McastListener calls this method to get the manager to process messages.
|
protected void |
fromListenerTimeoutNoMembers()
The McastListener tells us there are no other members of the cluster that
are currently online.
|
protected SpiEbeanServer |
getEbeanServer(String serverName) |
long |
getManagerSleepMillis()
Return the frequency by which this manager will send out ACKs.
|
McastStatus |
getStatus(boolean reset)
Get the overall status and activity of this cluster node.
|
void |
run()
Periodically send out Ack, Re-send and Control messages.
|
void |
setManagerSleepMillis(long managerSleepMillis)
Effectively set the frequency by which this manager will send out ACKs.
|
void |
shutdown()
Say 'Leaving' and shutdown.
|
void |
startup(ClusterManager clusterManager)
Startup listeners and 'Join'.
|
protected void fromListenerTimeoutNoMembers()
protected void fromListener(long newMinAcked,
MessageControl msgControl,
MessageResend msgResend,
int groupSize,
long totalPacketsReceived,
long totalBytesReceived,
long totalTxnEventsReceived)
newMinAcked - the minAcked packetId according to the listenermsgControl - a control message to processmsgResend - a Please re-send message to processgroupSize - the number of other online memberspublic McastStatus getStatus(boolean reset)
public void run()
public void shutdown()
shutdown in interface ClusterBroadcastpublic void startup(ClusterManager clusterManager)
startup in interface ClusterBroadcastprotected SpiEbeanServer getEbeanServer(String serverName)
public void broadcast(RemoteTransactionEvent remoteTransEvent)
broadcast in interface ClusterBroadcastpublic void setManagerSleepMillis(long managerSleepMillis)
public long getManagerSleepMillis()
Copyright © 2014. All Rights Reserved.