org.apache.catalina.ha.session

## Class ClusterSessionListener

- java.lang.Object
- - org.apache.catalina.ha.ClusterListener
  - - org.apache.catalina.ha.session.ClusterSessionListener

- All Implemented Interfaces:
    ChannelListener

      public class ClusterSessionListener
      extends ClusterListener

  Receive replicated SessionMessage form other cluster node.
  Author:
    Peter Rossbach

- - ### Field Summary

    - ### Fields inherited from class org.apache.catalina.ha.ClusterListener

      `cluster`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClusterSessionListener()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(ClusterMessage msg)` Accept only SessionMessage
    `void` | `messageReceived(ClusterMessage myobj)` Callback from the cluster, when a message is received, The cluster will broadcast it invoking the messageReceived on the receiver.

    - ### Methods inherited from class org.apache.catalina.ha.ClusterListener

      `accept, getCluster, messageReceived, setCluster`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.catalina.tribes.ChannelListener

      `equals, hashCode`

- - ### Constructor Detail

    - #### ClusterSessionListener

          public ClusterSessionListener()

  - ### Method Detail

    - #### messageReceived

          public void messageReceived(ClusterMessage myobj)

      Callback from the cluster, when a message is received, The cluster will broadcast it invoking the messageReceived on the receiver.
      Specified by:
        `messageReceived` in class `ClusterListener`
      Parameters:
        `myobj` - ClusterMessage - the message received from the cluster

    - #### accept

          public boolean accept(ClusterMessage msg)

      Accept only SessionMessage
      Specified by:
        `accept` in class `ClusterListener`
      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-2021 Apache Software Foundation. All Rights Reserved.