Package org.apache.catalina.tribes
Interface ChannelSender
- All Superinterfaces:
Heartbeat
- All Known Implementing Classes:
ReplicationTransmitter
The
ChannelSender
interface is the data sender component at the bottom layer, the IO layer (for layers
see the Channel
interface). The channel sender must support "silent" members, i.e., be able to send a message
to a member that is not in the membership, but is part of the destination parameter-
Method Summary
Modifier and TypeMethodDescriptionvoid
Notify the sender of a member being added to the group.
Optional.Return the channel that is related to this ChannelSendervoid
A channel heartbeat, use this method to clean up resourcesvoid
Notification that a member has been removed or crashed.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 ChannelSendervoid
start()
Start the channel sendervoid
stop()
Stop the channel sender
-
Method Details
-
add
Notify the sender of a member being added to the group.
Optional. This can be an empty implementation, that does nothing- Parameters:
member
- Member
-
remove
Notification that a member has been removed or crashed. Can be used to clean up open connections etc- Parameters:
member
- Member
-
start
Start the channel sender- Throws:
IOException
- if preprocessing takes place and an error happens
-
stop
void stop()Stop the channel sender -
heartbeat
void heartbeat()A channel heartbeat, use this method to clean up resources -
sendMessage
Send a message to one or more recipients.- Parameters:
message
- ChannelMessage - the message to be sentdestination
- 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:
-
getChannel
Channel getChannel()Return the channel that is related to this ChannelSender- Returns:
- Channel
-
setChannel
Set the channel that is related to this ChannelSender- Parameters:
channel
- The channel
-