FileDocCategorySizeDatePackage
ClusterListener.javaAPI DocApache Tomcat 6.0.143674Fri Jul 20 04:20:34 BST 2007org.apache.catalina.ha

ClusterListener

public abstract class ClusterListener extends Object implements org.apache.catalina.tribes.ChannelListener
Receive SessionID cluster change from other backup node after primary session node is failed.
author
Peter Rossbach
author
Filip Hanik
version
$Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
public static org.apache.juli.logging.Log
log
protected org.apache.catalina.util.StringManager
sm
The string manager for this package.
protected CatalinaCluster
cluster
Constructors Summary
public ClusterListener()


    //--Constructor---------------------------------------------

      
    
Methods Summary
public final booleanaccept(java.io.Serializable msg, org.apache.catalina.tribes.Member member)

        if ( msg instanceof ClusterMessage ) return true;
        return false;
    
public abstract booleanaccept(ClusterMessage msg)
Accept only SessionIDMessages

param
msg ClusterMessage
return
boolean - returns true to indicate that messageReceived should be invoked. If false is returned, the messageReceived method will not be invoked.

public booleanequals(java.lang.Object listener)

        return super.equals(listener);
    
public CatalinaClustergetCluster()

        return cluster;
    
public inthashCode()

        return super.hashCode();
    
public final voidmessageReceived(java.io.Serializable msg, org.apache.catalina.tribes.Member member)

        if ( msg instanceof ClusterMessage ) messageReceived((ClusterMessage)msg);
    
public abstract voidmessageReceived(ClusterMessage msg)
Callback from the cluster, when a message is received, The cluster will broadcast it invoking the messageReceived on the receiver.

param
msg ClusterMessage - the message received from the cluster

public voidsetCluster(CatalinaCluster cluster)

        if (log.isDebugEnabled()) {
            if (cluster != null)
                log.debug("add ClusterListener " + this.toString() + " to cluster" + cluster);
            else
                log.debug("remove ClusterListener " + this.toString() + " from cluster");
        }
        this.cluster = cluster;