com.sun.enterprise.mgmt.transport.jxta
Class JxtaPipeManagerWrapper

java.lang.Object
  extended by com.sun.enterprise.mgmt.transport.AbstractMultiMessageSender
      extended by com.sun.enterprise.mgmt.transport.jxta.JxtaPipeManagerWrapper
All Implemented Interfaces:
MessageSender, MulticastMessageSender, ShoalMessageSender

public class JxtaPipeManagerWrapper
extends AbstractMultiMessageSender

This class wraps JxtaPipeManager and extends AbstractMultiMessageSender which supports both MulticastMessageSender and MessageSender transport layer This stores and caches JxtaPipeManager according to Message's type This implements Jxta's PipeMsgListener, receives Jxta's PipeMsgEvent, parses Jxta's message, converts it into Message and forwards it to NetworkManager

Author:
Bongjae Chang

Field Summary
 
Fields inherited from class com.sun.enterprise.mgmt.transport.AbstractMultiMessageSender
localPeerID
 
Fields inherited from interface com.sun.enterprise.mgmt.transport.ShoalMessageSender
TCP_TRANSPORT, UDP_TRANSPORT
 
Constructor Summary
JxtaPipeManagerWrapper(JxtaNetworkManager networkManager, PeerID<net.jxta.peer.PeerID> localPeerID)
           
 
Method Summary
 void clearPipeCache()
           
protected  boolean doBroadcast(Message message)
          Broadcasts or Multicasts the given Message to all members
protected  boolean doSend(PeerID peerID, Message message)
          Sends the given Message to the destination
 void pipeMsgEvent(PipeMsgEvent event)
           
 void removePipeFromCache(net.jxta.peer.PeerID peerid)
          in the event of a failure or planned shutdown, remove the pipe from the pipeCache
 void start()
          
 void stop()
          
 
Methods inherited from class com.sun.enterprise.mgmt.transport.AbstractMultiMessageSender
broadcast, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JxtaPipeManagerWrapper

public JxtaPipeManagerWrapper(JxtaNetworkManager networkManager,
                              PeerID<net.jxta.peer.PeerID> localPeerID)
Method Detail

start

public void start()
           throws IOException

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

stop

public void stop()
          throws IOException

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

doBroadcast

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

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

doSend

protected boolean doSend(PeerID peerID,
                         Message message)
                  throws IOException
Sends the given Message to the destination

Specified by:
doSend in class AbstractMultiMessageSender
Parameters:
peerID - the destination PeerID. null is not allowed
message - a message which is sent to the peer
Returns:
true if the message is sent to the destination successfully, otherwise false
Throws:
IOException - if I/O error occurs or given parameters are not valid

pipeMsgEvent

public void pipeMsgEvent(PipeMsgEvent event)

removePipeFromCache

public void removePipeFromCache(net.jxta.peer.PeerID peerid)
in the event of a failure or planned shutdown, remove the pipe from the pipeCache

Parameters:
peerid - peerID

clearPipeCache

public void clearPipeCache()


Copyright © 2012. All Rights Reserved.