Package org.apache.catalina.ha
Class ClusterListener
- java.lang.Object
-
- org.apache.catalina.ha.ClusterListener
-
- All Implemented Interfaces:
ChannelListener
- Direct Known Subclasses:
ClusterSessionListener,FarmWarDeployer
public abstract class ClusterListener extends java.lang.Object implements ChannelListener
Receive SessionID cluster change from other backup node after primary session node is failed.
-
-
Field Summary
Fields Modifier and Type Field Description protected CatalinaClustercluster
-
Constructor Summary
Constructors Constructor Description ClusterListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaccept(java.io.Serializable msg, Member member)Invoked by the channel to determine if the listener will process this message or not.abstract booleanaccept(ClusterMessage msg)Accept only a certain type of messages.CatalinaClustergetCluster()voidmessageReceived(java.io.Serializable msg, Member member)Receive a message from the channelabstract voidmessageReceived(ClusterMessage msg)Callback from the cluster, when a message is received, The cluster will broadcast it invoking the messageReceived on the receiver.voidsetCluster(CatalinaCluster cluster)
-
-
-
Field Detail
-
cluster
protected CatalinaCluster cluster
-
-
Method Detail
-
getCluster
public CatalinaCluster getCluster()
-
setCluster
public void setCluster(CatalinaCluster cluster)
-
messageReceived
public final void messageReceived(java.io.Serializable msg, Member member)Description copied from interface:ChannelListenerReceive a message from the channel- Specified by:
messageReceivedin interfaceChannelListener- Parameters:
msg- Serializablemember- - the source of the message
-
accept
public final boolean accept(java.io.Serializable msg, Member member)Description copied from interface:ChannelListenerInvoked by the channel to determine if the listener will process this message or not.- Specified by:
acceptin interfaceChannelListener- Parameters:
msg- Serializablemember- Member- Returns:
- boolean
-
messageReceived
public abstract void messageReceived(ClusterMessage msg)
Callback from the cluster, when a message is received, The cluster will broadcast it invoking the messageReceived on the receiver.- Parameters:
msg- the message received from the cluster
-
accept
public abstract boolean accept(ClusterMessage msg)
Accept only a certain type of messages.- Parameters:
msg- the message- Returns:
trueto indicate that messageReceived should be invoked. Iffalseis returned, the messageReceived method will not be invoked.
-
-