GroupChannelMBean (Apache Tomcat 9.0.120 API Documentation)
Description: declaration: package: org.apache.catalina.tribes.group, interface: GroupChannelMBean

# Interface GroupChannelMBean

All Known Implementing Classes:
  `GroupChannel`

public interface GroupChannelMBean
MBean interface for managing a GroupChannel.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addChannelListener(ChannelListener listener)`
  Adds a channel listener to receive incoming messages.
  `void`
  `addMembershipListener(MembershipListener listener)`
  Adds a membership listener to receive membership change notifications.
  `boolean`
  `getHeartbeat()`
  Returns whether the internal heartbeat is enabled.
  `long`
  `getHeartbeatSleeptime()`
  Returns the heartbeat sleep interval in milliseconds.
  `Member`
  `getLocalMember(boolean incAlive)`
  Returns the local member of the channel.
  `Member[]`
  `getMembers()`
  Returns the current members of the channel.
  `boolean`
  `getOptionCheck()`
  Returns whether option flag checking is enabled.
  `boolean`
  `hasMembers()`
  Returns whether the channel has any members.
  `void`
  `removeChannelListener(ChannelListener listener)`
  Removes a previously registered channel listener.
  `void`
  `removeMembershipListener(MembershipListener listener)`
  Removes a previously registered membership listener.
  `UniqueId`
  `send(Member[] destination, Serializable msg, int options)`
  Sends a message to the specified destination members.
  `UniqueId`
  `send(Member[] destination, Serializable msg, int options, ErrorHandler handler)`
  Sends a message to the specified destination members with an error handler.
  `void`
  `start(int svc)`
  Starts the channel with the given service type.
  `void`
  `stop(int svc)`
  Stops the channel with the given service type.

- ## Method Details

  - ### getOptionCheck

    boolean getOptionCheck()
    Returns whether option flag checking is enabled.
    Returns:
      `true` if option checking is enabled

  - ### getHeartbeat

    boolean getHeartbeat()
    Returns whether the internal heartbeat is enabled.
    Returns:
      `true` if heartbeat is enabled

  - ### getHeartbeatSleeptime

    long getHeartbeatSleeptime()
    Returns the heartbeat sleep interval in milliseconds.
    Returns:
      the heartbeat sleep time in milliseconds

  - ### start

    void start(int svc) throws ChannelException
    Starts the channel with the given service type.
    Parameters:
      `svc` - The service type
    Throws:
      `ChannelException` - if an error occurs during start

  - ### stop

    void stop(int svc) throws ChannelException
    Stops the channel with the given service type.
    Parameters:
      `svc` - The service type
    Throws:
      `ChannelException` - if an error occurs during stop

  - ### send

    UniqueId send(Member[] destination, Serializable msg, int options) throws ChannelException
    Sends a message to the specified destination members.
    Parameters:
      `destination` - The destination members
      `msg` - The message to send
      `options` - Send options flags
    Returns:
      UniqueId for the sent message
    Throws:
      `ChannelException` - if an error occurs during send

  - ### send

    UniqueId send(Member[] destination, Serializable msg, int options, ErrorHandler handler) throws ChannelException
    Sends a message to the specified destination members with an error handler.
    Parameters:
      `destination` - The destination members
      `msg` - The message to send
      `options` - Send options flags
      `handler` - Error handler for the send operation
    Returns:
      UniqueId for the sent message
    Throws:
      `ChannelException` - if an error occurs during send

  - ### addMembershipListener

    void addMembershipListener(MembershipListener listener)
    Adds a membership listener to receive membership change notifications.
    Parameters:
      `listener` - The membership listener to add

  - ### addChannelListener

    void addChannelListener(ChannelListener listener)
    Adds a channel listener to receive incoming messages.
    Parameters:
      `listener` - The channel listener to add

  - ### removeMembershipListener

    void removeMembershipListener(MembershipListener listener)
    Removes a previously registered membership listener.
    Parameters:
      `listener` - The membership listener to remove

  - ### removeChannelListener

    void removeChannelListener(ChannelListener listener)
    Removes a previously registered channel listener.
    Parameters:
      `listener` - The channel listener to remove

  - ### hasMembers

    boolean hasMembers()
    Returns whether the channel has any members.
    Returns:
      `true` if there are members in the channel

  - ### getMembers

    Member[] getMembers()
    Returns the current members of the channel.
    Returns:
      Array of current members

  - ### getLocalMember

    Member getLocalMember(boolean incAlive)
    Returns the local member of the channel.
    Parameters:
      `incAlive` - Whether to update the alive timestamp
    Returns:
      The local member