ReplicationTransmitter (Apache Tomcat 11.0.24 API Documentation)
Description: declaration: package: org.apache.catalina.tribes.transport, class: ReplicationTransmitter

# Class ReplicationTransmitter

java.lang.Object
org.apache.catalina.tribes.transport.ReplicationTransmitter

All Implemented Interfaces:
  `ChannelSender, Heartbeat`

public class ReplicationTransmitter extends Object implements ChannelSender
Transmit message to other cluster members Actual senders are created based on the replicationMode type

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReplicationTransmitter()`
  Default constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(Member member)`
  add new cluster member and create sender ( s. replicationMode) transfer current properties to sender
  `Channel`
  `getChannel()`
  Return the channel that is related to this ChannelSender
  `MultiPointSender`
  `getTransport()`
  Return the transport used for message sending.
  `void`
  `heartbeat()`
  Call transmitter to check for sender socket status
  `void`
  `remove(Member member)`
  remove sender from transmitter. ( deregister mbean and disconnect sender )
  `void`
  `sendMessage(ChannelMessage message, Member[] destination)`
  Send a message to one or more recipients.
  `void`
  `setChannel(Channel channel)`
  Set the channel that is related to this ChannelSender
  `void`
  `setTransport(MultiPointSender transport)`
  Set the transport used for message sending.
  `void`
  `start()`
  start the sender and register transmitter mbean
  `void`
  `stop()`
  stop the sender and deregister mbeans (transmitter, senders)

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### ReplicationTransmitter

    public ReplicationTransmitter()
    Default constructor.

- ## Method Details

  - ### getTransport

    public MultiPointSender getTransport()
    Return the transport used for message sending.
    Returns:
      the transport

  - ### setTransport

    public void setTransport(MultiPointSender transport)
    Set the transport used for message sending.
    Parameters:
      `transport` - the new transport

  - ### sendMessage

    public void sendMessage(ChannelMessage message, Member[] destination) throws ChannelException
    Description copied from interface: `ChannelSender`
    Send a message to one or more recipients.
    Specified by:
      `sendMessage` in interface `ChannelSender`
    Parameters:
      `message` - ChannelMessage - the message to be sent
      `destination` - Member[] - the destinations
    Throws:
      `ChannelException` - - if an error happens, the ChannelSender MUST report individual send failures on a per member basis, using ChannelException.addFaultyMember
    See Also:
      - `ChannelException.addFaultyMember(Member,java.lang.Exception)`

  - ### start

    public void start() throws IOException
    start the sender and register transmitter mbean
    Specified by:
      `start` in interface `ChannelSender`
    Throws:
      `IOException` - if preprocessing takes place and an error happens
    See Also:
      - `ChannelSender.start()`

  - ### stop

    public void stop()
    stop the sender and deregister mbeans (transmitter, senders)
    Specified by:
      `stop` in interface `ChannelSender`
    See Also:
      - `ChannelSender.stop()`

  - ### heartbeat

    public void heartbeat()
    Call transmitter to check for sender socket status
    Specified by:
      `heartbeat` in interface `ChannelSender`
    Specified by:
      `heartbeat` in interface `Heartbeat`
    See Also:
      - `SimpleTcpCluster.backgroundProcess()`

  - ### add

    public void add(Member member)
    add new cluster member and create sender ( s. replicationMode) transfer current properties to sender
    Specified by:
      `add` in interface `ChannelSender`
    Parameters:
      `member` - Member
    See Also:
      - `ChannelSender.add(org.apache.catalina.tribes.Member)`

  - ### remove

    public void remove(Member member)
    remove sender from transmitter. ( deregister mbean and disconnect sender )
    Specified by:
      `remove` in interface `ChannelSender`
    Parameters:
      `member` - Member
    See Also:
      - `ChannelSender.remove(org.apache.catalina.tribes.Member)`

  - ### getChannel

    public Channel getChannel()
    Description copied from interface: `ChannelSender`
    Return the channel that is related to this ChannelSender
    Specified by:
      `getChannel` in interface `ChannelSender`
    Returns:
      Channel

  - ### setChannel

    public void setChannel(Channel channel)
    Description copied from interface: `ChannelSender`
    Set the channel that is related to this ChannelSender
    Specified by:
      `setChannel` in interface `ChannelSender`
    Parameters:
      `channel` - The channel