com.sun.enterprise.mgmt.transport
Class AbstractMulticastMessageSender
java.lang.Object
com.sun.enterprise.mgmt.transport.AbstractMulticastMessageSender
- All Implemented Interfaces:
- MulticastMessageSender, ShoalMessageSender
- Direct Known Subclasses:
- BlockingIOMulticastSender, VirtualMulticastSender
public abstract class AbstractMulticastMessageSender
- extends Object
- implements MulticastMessageSender
This class implements a common MulticastMessageSender logic simply in order to help the specific transport layer to be implemented easily
Mainly, this stores both source's PeerID and target's PeerID before broadcasting the message to all members
- Author:
- Bongjae Chang
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
localPeerID
protected PeerID localPeerID
- Represents local
PeerID.
This value should be assigned in real MessageSender's implementation correspoinding to the specific transport layer
AbstractMulticastMessageSender
public AbstractMulticastMessageSender()
broadcast
public boolean broadcast(Message message)
throws IOException
- Broadcasts or Multicasts the given
Message to all members
- Specified by:
broadcast in interface MulticastMessageSender
- Parameters:
message - a message which is sent to all members
- Returns:
- true if the message is sent to all members successfully, otherwise false
- Throws:
IOException - if I/O error occurs or given parameters are not valid
start
public void start()
throws IOException
-
- Specified by:
start in interface ShoalMessageSender
- Throws:
IOException
stop
public void stop()
throws IOException
-
- Specified by:
stop in interface ShoalMessageSender
- Throws:
IOException
doBroadcast
protected abstract boolean doBroadcast(Message message)
throws IOException
- Broadcasts or Multicasts the given
Message to all members
- Parameters:
message - a message which is sent to all members
- Returns:
- true if the message is sent to all members successfully, otherwise false
- Throws:
IOException - if I/O error occurs or given parameters are not valid
Copyright © 2012. All Rights Reserved.