SimpleCoordinator (Apache Tomcat 8.5.57 API Documentation)

org.apache.catalina.tribes.group.interceptors

## Class SimpleCoordinator

- java.lang.Object
- - org.apache.catalina.tribes.group.ChannelInterceptorBase
  - - org.apache.catalina.tribes.group.interceptors.SimpleCoordinator

- All Implemented Interfaces:
    ChannelInterceptor, Heartbeat, MembershipListener

      public class SimpleCoordinator
      extends ChannelInterceptorBase

  A dinky coordinator, just uses a sorted version of the member array.
  Author:
    rnewson

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.catalina.tribes.ChannelInterceptor

      `ChannelInterceptor.InterceptorEvent`

  - ### Field Summary

    - ### Fields inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase

      `optionFlag`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleCoordinator()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Member` | `getCoordinator()`
    `Member[]` | `getView()`
    `boolean` | `isCoordinator()`
    `void` | `memberAdded(Member member)` A member was added to the group
    `void` | `memberDisappeared(Member member)` A member was removed from the group If the member left voluntarily, the Member.getCommand will contain the Member.SHUTDOWN_PAYLOAD data
    `void` | `start(int svc)` Starts up the channel.
    `void` | `stop(int svc)` Shuts down the channel.
    `protected void` | `viewChange(Member[] view)` Override to receive view changes.

    - ### Methods inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase

      `fireInterceptorEvent, getChannel, getLocalMember, getMember, getMembers, getNext, getOptionFlag, getPrevious, hasMembers, heartbeat, messageReceived, okToProcess, sendMessage, setChannel, setNext, setOptionFlag, setPrevious`

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

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

- - ### Constructor Detail

    - #### SimpleCoordinator

          public SimpleCoordinator()

  - ### Method Detail

    - #### memberAdded

          public void memberAdded(Member member)

      Description copied from interface: `MembershipListener`
      A member was added to the group
      Specified by:
        `memberAdded` in interface `MembershipListener`
      Overrides:
        `memberAdded` in class `ChannelInterceptorBase`
      Parameters:
        `member` - Member - the member that was added

    - #### memberDisappeared

          public void memberDisappeared(Member member)

      Description copied from interface: `MembershipListener`
      A member was removed from the group
      If the member left voluntarily, the Member.getCommand will contain the Member.SHUTDOWN_PAYLOAD data
      Specified by:
        `memberDisappeared` in interface `MembershipListener`
      Overrides:
        `memberDisappeared` in class `ChannelInterceptorBase`
      Parameters:
        `member` - Member
      See Also:
        `Member.SHUTDOWN_PAYLOAD`

    - #### viewChange

          protected void viewChange(Member[] view)

      Override to receive view changes.
      Parameters:
        `view` - The members array

    - #### start

          public void start(int svc)
                     throws ChannelException

      Description copied from class: `ChannelInterceptorBase`
      Starts up the channel. This can be called multiple times for individual services to start The svc parameter can be the logical or value of any constants
      Specified by:
        `start` in interface `ChannelInterceptor`
      Overrides:
        `start` in class `ChannelInterceptorBase`
      Parameters:
        `svc` - int value of
        DEFAULT - will start all services
        MBR_RX_SEQ - starts the membership receiver
        MBR_TX_SEQ - starts the membership broadcaster
        SND_TX_SEQ - starts the replication transmitter
        SND_RX_SEQ - starts the replication receiver
      Throws:
        `ChannelException` - if a startup error occurs or the service is already started.
      See Also:
        `Channel`

    - #### stop

          public void stop(int svc)
                    throws ChannelException

      Description copied from class: `ChannelInterceptorBase`
      Shuts down the channel. This can be called multiple times for individual services to shutdown The svc parameter can be the logical or value of any constants
      Specified by:
        `stop` in interface `ChannelInterceptor`
      Overrides:
        `stop` in class `ChannelInterceptorBase`
      Parameters:
        `svc` - int value of
        DEFAULT - will shutdown all services
        MBR_RX_SEQ - stops the membership receiver
        MBR_TX_SEQ - stops the membership broadcaster
        SND_TX_SEQ - stops the replication transmitter
        SND_RX_SEQ - stops the replication receiver
      Throws:
        `ChannelException` - if a startup error occurs or the service is already started.
      See Also:
        `Channel`

    - #### getView

          public Member[] getView()

    - #### getCoordinator

          public Member getCoordinator()

    - #### isCoordinator

          public boolean isCoordinator()

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