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 java.lang.Object implements MulticastMessageSender
This class implements a commonMulticastMessageSenderlogic simply in order to help the specific transport layer to be implemented easily Mainly, this stores both source'sPeerIDand target'sPeerIDbefore broadcasting the message to all members- Author:
- Bongjae Chang
-
-
Field Summary
Fields Modifier and Type Field Description protected PeerIDlocalPeerIDRepresents localPeerID.-
Fields inherited from interface com.sun.enterprise.mgmt.transport.ShoalMessageSender
TCP_TRANSPORT, UDP_TRANSPORT
-
-
Constructor Summary
Constructors Constructor Description AbstractMulticastMessageSender()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanbroadcast(Message message)Broadcasts or Multicasts the givenMessageto all membersprotected abstract booleandoBroadcast(Message message)Broadcasts or Multicasts the givenMessageto all membersvoidstart()voidstop()
-
-
-
Field Detail
-
localPeerID
protected PeerID localPeerID
Represents localPeerID. This value should be assigned in realMessageSender's implementation correspoinding to the specific transport layer
-
-
Method Detail
-
broadcast
public boolean broadcast(Message message) throws java.io.IOException
Broadcasts or Multicasts the givenMessageto all members- Specified by:
broadcastin interfaceMulticastMessageSender- Parameters:
message- a message which is sent to all members- Returns:
- true if the message is sent to all members successfully, otherwise false
- Throws:
java.io.IOException- if I/O error occurs or given parameters are not valid
-
start
public void start() throws java.io.IOException- Specified by:
startin interfaceShoalMessageSender- Throws:
java.io.IOException
-
stop
public void stop() throws java.io.IOException- Specified by:
stopin interfaceShoalMessageSender- Throws:
java.io.IOException
-
doBroadcast
protected abstract boolean doBroadcast(Message message) throws java.io.IOException
Broadcasts or Multicasts the givenMessageto 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:
java.io.IOException- if I/O error occurs or given parameters are not valid
-
-