Package de.hybris.platform.cluster
Class PingBroadcastHandler
- java.lang.Object
-
- de.hybris.platform.cluster.PingBroadcastHandler
-
- All Implemented Interfaces:
BroadcastMessageListener
public class PingBroadcastHandler extends java.lang.Object implements BroadcastMessageListener
Sends and receives ping broadcast messages to and from the hybris cluster.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPingBroadcastHandler.NodeInfo
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCFG_PING_INTERVALstatic java.lang.StringCOMMAND_PINGstatic java.lang.StringCOMMAND_PING_RESULTstatic java.lang.StringDELIMITERstatic intKIND_PINGstatic intPING_INTERVAL
-
Constructor Summary
Constructors Constructor Description PingBroadcastHandler(BroadcastService broadcastService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddNode(long dynamicNodeID, int remoteNodeID, java.lang.String ipAddress, java.lang.String methodName)voiddestroy()protected longgetClusterIslandPK()protected intgetClusterNodeID()static PingBroadcastHandlergetInstance()java.util.Collection<PingBroadcastHandler.NodeInfo>getNodes()booleanisNodeAlive(int nodeID)voidpingNodes()booleanprocessMessage(RawMessage message)protected booleanprocessPingMessage(RawMessage message)protected voidsendPing()protected voidsendPingAnswer(long remoteDynamicNode)
-
-
-
Field Detail
-
KIND_PING
public static final int KIND_PING
- See Also:
- Constant Field Values
-
CFG_PING_INTERVAL
public static final java.lang.String CFG_PING_INTERVAL
- See Also:
- Constant Field Values
-
PING_INTERVAL
public static final int PING_INTERVAL
- See Also:
- Constant Field Values
-
DELIMITER
public static final java.lang.String DELIMITER
- See Also:
- Constant Field Values
-
COMMAND_PING
public static final java.lang.String COMMAND_PING
- See Also:
- Constant Field Values
-
COMMAND_PING_RESULT
public static final java.lang.String COMMAND_PING_RESULT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PingBroadcastHandler
public PingBroadcastHandler(BroadcastService broadcastService)
-
-
Method Detail
-
getInstance
public static PingBroadcastHandler getInstance()
-
destroy
public void destroy()
-
processMessage
public boolean processMessage(RawMessage message)
- Specified by:
processMessagein interfaceBroadcastMessageListener
-
isNodeAlive
public boolean isNodeAlive(int nodeID)
-
getNodes
public java.util.Collection<PingBroadcastHandler.NodeInfo> getNodes()
-
addNode
protected void addNode(long dynamicNodeID, int remoteNodeID, java.lang.String ipAddress, java.lang.String methodName)
-
pingNodes
public void pingNodes()
-
sendPing
protected void sendPing()
-
sendPingAnswer
protected void sendPingAnswer(long remoteDynamicNode)
-
processPingMessage
protected boolean processPingMessage(RawMessage message)
-
getClusterNodeID
protected int getClusterNodeID()
-
getClusterIslandPK
protected long getClusterIslandPK()
-
-