com.sun.enterprise.mgmt.transport.jxta
Class JxtaPipeManagerWrapper
java.lang.Object
com.sun.enterprise.mgmt.transport.AbstractMultiMessageSender
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JxtaPipeManagerWrapper
public JxtaPipeManagerWrapper(JxtaNetworkManager networkManager,
PeerID<net.jxta.peer.PeerID> localPeerID)
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 allowedmessage - 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.