## org.apache.catalina.cluster.session
Class ClusterListener

    java.lang.Object
      org.apache.catalina.cluster.session.ClusterListener

All Implemented Interfaces:
  MessageListener

Direct Known Subclasses:
  ClusterSessionListener, ClusterSingleSignOnListener, JvmRouteSessionIDBinderListener

public abstract class ClusterListener
extends java.lang.Object
implements MessageListener

Receive SessionID cluster change from other backup node after primary session node is failed.

Version:
  $Id: ClusterListener.java 939539 2010-04-30 01:31:33Z kkolinko $
Author:
  Peter Rossbach

Field Summary
`protected CatalinaCluster` `cluster`
`static org.apache.commons.logging.Log` `log`
`protected StringManager` `sm` The string manager for this package.

Constructor Summary
`ClusterListener()`

Method Summary
`abstract boolean` `accept(ClusterMessage msg)` Accept only SessionIDMessages
`boolean` `equals(java.lang.Object listener)`
`CatalinaCluster` `getCluster()` Returns the cluster the cluster deployer is associated with
`int` `hashCode()`
`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.
`void` `setCluster(CatalinaCluster cluster)` Associates the cluster deployer with a cluster

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    public static org.apache.commons.logging.Log log

### sm

    protected StringManager sm

  The string manager for this package.

### cluster

    protected CatalinaCluster cluster

Constructor Detail

### ClusterListener

    public ClusterListener()

Method Detail

### getCluster

    public CatalinaCluster getCluster()

  Description copied from interface: `MessageListener`
  Returns the cluster the cluster deployer is associated with

  Specified by:
    `getCluster` in interface `MessageListener`
  Returns:
    CatalinaCluster

### setCluster

    public void setCluster(CatalinaCluster cluster)

  Description copied from interface: `MessageListener`
  Associates the cluster deployer with a cluster

  Specified by:
    `setCluster` in interface `MessageListener`
  Parameters:
    `cluster` - CatalinaCluster

### equals

    public boolean equals(java.lang.Object listener)

  Specified by:
    `equals` in interface `MessageListener`

### hashCode

    public int hashCode()

  Specified by:
    `hashCode` in interface `MessageListener`

### 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.

  Specified by:
    `messageReceived` in interface `MessageListener`
  Parameters:
    `msg` - ClusterMessage - the message received from the cluster

### accept

    public abstract boolean accept(ClusterMessage msg)

  Accept only SessionIDMessages

  Specified by:
    `accept` in interface `MessageListener`
  Parameters:
    `msg` - ClusterMessage
  Returns:
    boolean - returns true to indicate that messageReceived should be invoked. If false is returned, the messageReceived method will not be invoked.

Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.