Class ReplicationTransmitter
- java.lang.Object
-
- org.apache.catalina.tribes.transport.ReplicationTransmitter
-
- All Implemented Interfaces:
ChannelSender
,Heartbeat
public class ReplicationTransmitter extends java.lang.Object implements ChannelSender
Transmit message to other cluster members Actual senders are created based on the replicationMode type
-
-
Constructor Summary
Constructors Constructor Description ReplicationTransmitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Member member)
add new cluster member and create sender ( s. replicationMode) transfer current properties to senderChannel
getChannel()
Return the channel that is related to this ChannelSenderMultiPointSender
getTransport()
void
heartbeat()
Call transmitter to check for sender socket statusvoid
remove(Member member)
remove sender from transmitter. ( deregister mbean and disconnect sender )void
sendMessage(ChannelMessage message, Member[] destination)
Send data to one membervoid
setChannel(Channel channel)
Set the channel that is related to this ChannelSendervoid
setTransport(MultiPointSender transport)
void
start()
start the sender and register transmitter mbeanvoid
stop()
stop the sender and deregister mbeans (transmitter, senders)
-
-
-
Method Detail
-
getTransport
public MultiPointSender getTransport()
-
setTransport
public void setTransport(MultiPointSender transport)
-
sendMessage
public void sendMessage(ChannelMessage message, Member[] destination) throws ChannelException
Send data to one member- Specified by:
sendMessage
in interfaceChannelSender
- 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:
ChannelSender.sendMessage(org.apache.catalina.tribes.ChannelMessage, org.apache.catalina.tribes.Member[])
-
start
public void start() throws java.io.IOException
start the sender and register transmitter mbean- Specified by:
start
in interfaceChannelSender
- Throws:
java.io.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 interfaceChannelSender
- See Also:
ChannelSender.stop()
-
heartbeat
public void heartbeat()
Call transmitter to check for sender socket status- Specified by:
heartbeat
in interfaceChannelSender
- Specified by:
heartbeat
in interfaceHeartbeat
- 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 interfaceChannelSender
- 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 interfaceChannelSender
- 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 interfaceChannelSender
- 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 interfaceChannelSender
- Parameters:
channel
- The channel
-
-