com.sun.enterprise.mgmt.transport
Class BlockingIOMulticastSender

java.lang.Object
  extended by com.sun.enterprise.mgmt.transport.AbstractMulticastMessageSender
      extended by com.sun.enterprise.mgmt.transport.BlockingIOMulticastSender
All Implemented Interfaces:
MulticastMessageSender, ShoalMessageSender, Runnable

public class BlockingIOMulticastSender
extends AbstractMulticastMessageSender
implements Runnable

This class is a default MulticastMessageSender's implementation and extends AbstractMulticastMessageSender This uses MulticastSocket which is based on Blocking I/O

Author:
Bongjae Chang

Field Summary
 
Fields inherited from class com.sun.enterprise.mgmt.transport.AbstractMulticastMessageSender
localPeerID
 
Fields inherited from interface com.sun.enterprise.mgmt.transport.ShoalMessageSender
TCP_TRANSPORT, UDP_TRANSPORT
 
Constructor Summary
BlockingIOMulticastSender(String host, String multicastAddress, int multicastPort, String networkInterfaceName, int multicastPacketSize, PeerID localPeerID, Executor executor, int multicastTimeToLive, NetworkManager networkManager)
           
 
Method Summary
protected  boolean doBroadcast(Message message)
          Broadcasts or Multicasts the given Message to all members
 void run()
           
 void start()
          
 void stop()
          
 
Methods inherited from class com.sun.enterprise.mgmt.transport.AbstractMulticastMessageSender
broadcast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingIOMulticastSender

public BlockingIOMulticastSender(String host,
                                 String multicastAddress,
                                 int multicastPort,
                                 String networkInterfaceName,
                                 int multicastPacketSize,
                                 PeerID localPeerID,
                                 Executor executor,
                                 int multicastTimeToLive,
                                 NetworkManager networkManager)
                          throws IOException
Throws:
IOException
Method Detail

start

public void start()
           throws IOException

Specified by:
start in interface ShoalMessageSender
Overrides:
start in class AbstractMulticastMessageSender
Throws:
IOException

stop

public void stop()
          throws IOException

Specified by:
stop in interface ShoalMessageSender
Overrides:
stop in class AbstractMulticastMessageSender
Throws:
IOException

run

public void run()
Specified by:
run in interface Runnable

doBroadcast

protected boolean doBroadcast(Message message)
                       throws IOException
Broadcasts or Multicasts the given Message to all members

Specified by:
doBroadcast in class AbstractMulticastMessageSender
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.