## org.apache.catalina.ha
Class ClusterListener

    java.lang.Object
      org.apache.catalina.ha.ClusterListener

All Implemented Interfaces:
  ChannelListener

Direct Known Subclasses:
  ClusterSessionListener, ClusterSingleSignOnListener, FarmWarDeployer, JvmRouteSessionIDBinderListener

    public abstract class ClusterListener

extends java.lang.Object
implements ChannelListener

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

Version:
  $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $
Author:
  Peter Rossbach, Filip Hanik

Field Summary
`protected CatalinaCluster` `cluster`
`static 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` `accept(java.io.Serializable msg, Member member)` Invoked by the channel to determine if the listener will process this message or not.
`boolean` `equals(java.lang.Object listener)`
`CatalinaCluster` `getCluster()`
`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` `messageReceived(java.io.Serializable msg, Member member)` Receive a message from the channel
`void` `setCluster(CatalinaCluster cluster)`

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

Field Detail

### log

    public static 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()

### setCluster

    public void setCluster(CatalinaCluster cluster)

### equals

    public boolean equals(java.lang.Object listener)

  Specified by:
    `equals` in interface `ChannelListener`
  Overrides:
    `equals` in class `java.lang.Object`
  Parameters:
    `listener` - Object
  Returns:
    boolean
  See Also:
    `Object.equals(Object)`

### hashCode

    public int hashCode()

  Specified by:
    `hashCode` in interface `ChannelListener`
  Overrides:
    `hashCode` in class `java.lang.Object`
  Returns:
    int
  See Also:
    `Object#hashCode(int)`

### messageReceived

    public final void messageReceived(java.io.Serializable msg,
                                      Member member)

  Description copied from interface: `ChannelListener`
  Receive a message from the channel

  Specified by:
    `messageReceived` in interface `ChannelListener`
  Parameters:
    `msg` - Serializable
    `member` - - the source of the message

### accept

    public final boolean accept(java.io.Serializable msg,
                                Member member)

  Description copied from interface: `ChannelListener`
  Invoked by the channel to determine if the listener will process this message or not.

  Specified by:
    `accept` in interface `ChannelListener`
  Parameters:
    `msg` - Serializable
    `member` - 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` - ClusterMessage - the message received from the cluster

### accept

    public abstract boolean accept(ClusterMessage msg)

  Accept only SessionIDMessages

  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-2008 Apache Software Foundation. All Rights Reserved.