com.sun.enterprise.mgmt.transport
Class VirtualMulticastSender

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

public class VirtualMulticastSender
extends AbstractMulticastMessageSender

This class extends BlockingIOMulticastSender for supporting the circumstance that cluster members are located beyond one subnet or multicast traffic is disabled virtualPeerIdList should contain PeerIDs of cluster members which are located beyond one subnet. So, this MulticastMessageSender will broadcast a message to endpoints which virtualPeerIdList includes as well as one subnet on TCP protocol.

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
VirtualMulticastSender(NetworkManager networkManager, List<PeerID> initialPeerIds)
           
 
Method Summary
protected  boolean doBroadcast(Message message)
          Broadcasts or Multicasts the given Message to all members
 Set<PeerID> getVirtualPeerIDSet()
           
 void removeUnknownInstances()
          Remove all PeerID entries added via DISCOVERY_URI_LIST.
 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

VirtualMulticastSender

public VirtualMulticastSender(NetworkManager networkManager,
                              List<PeerID> initialPeerIds)
                       throws IOException
Throws:
IOException
Method Detail

getVirtualPeerIDSet

public Set<PeerID> getVirtualPeerIDSet()

start

public void start()
           throws IOException
Description copied from class: AbstractMulticastMessageSender

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

stop

public void stop()
          throws IOException
Description copied from class: AbstractMulticastMessageSender

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

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

removeUnknownInstances

public void removeUnknownInstances()
Remove all PeerID entries added via DISCOVERY_URI_LIST. These entries have "Unknown_" at start for instance name. If there are not removed, then we send to those DISCOVERY_URI_LIST instances multiple times.



Copyright © 2012. All Rights Reserved.