Class JxtaPipeManagerWrapper
- java.lang.Object
-
- com.sun.enterprise.mgmt.transport.AbstractMultiMessageSender
-
- com.sun.enterprise.mgmt.transport.jxta.JxtaPipeManagerWrapper
-
- All Implemented Interfaces:
MessageSender,MulticastMessageSender,ShoalMessageSender,java.util.EventListener,net.jxta.pipe.PipeMsgListener
public class JxtaPipeManagerWrapper extends AbstractMultiMessageSender implements net.jxta.pipe.PipeMsgListener
This class wrapsJxtaPipeManagerand extendsAbstractMultiMessageSenderwhich supports bothMulticastMessageSenderandMessageSendertransport layer This stores and cachesJxtaPipeManageraccording toMessage's type This implements Jxta's PipeMsgListener, receives Jxta's PipeMsgEvent, parses Jxta's message, converts it intoMessageand forwards it toNetworkManager- 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
Constructors Constructor Description JxtaPipeManagerWrapper(JxtaNetworkManager networkManager, PeerID<net.jxta.peer.PeerID> localPeerID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearPipeCache()protected booleandoBroadcast(Message message)Broadcasts or Multicasts the givenMessageto all membersprotected booleandoSend(PeerID peerID, Message message)Sends the givenMessageto the destinationvoidpipeMsgEvent(net.jxta.pipe.PipeMsgEvent event)voidremovePipeFromCache(net.jxta.peer.PeerID peerid)in the event of a failure or planned shutdown, remove the pipe from the pipeCachevoidstart()voidstop()-
Methods inherited from class com.sun.enterprise.mgmt.transport.AbstractMultiMessageSender
broadcast, send
-
-
-
-
Constructor Detail
-
JxtaPipeManagerWrapper
public JxtaPipeManagerWrapper(JxtaNetworkManager networkManager, PeerID<net.jxta.peer.PeerID> localPeerID)
-
-
Method Detail
-
start
public void start() throws java.io.IOException- Specified by:
startin interfaceShoalMessageSender- Overrides:
startin classAbstractMultiMessageSender- Throws:
java.io.IOException
-
stop
public void stop() throws java.io.IOException- Specified by:
stopin interfaceShoalMessageSender- Overrides:
stopin classAbstractMultiMessageSender- Throws:
java.io.IOException
-
doBroadcast
protected boolean doBroadcast(Message message) throws java.io.IOException
Broadcasts or Multicasts the givenMessageto all members- Specified by:
doBroadcastin classAbstractMultiMessageSender- 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
-
doSend
protected boolean doSend(PeerID peerID, Message message) throws java.io.IOException
Sends the givenMessageto the destination- Specified by:
doSendin classAbstractMultiMessageSender- Parameters:
peerID- the destinationPeerID.nullis not allowedmessage- a message which is sent to the peer- Returns:
- true if the message is sent to the destination successfully, otherwise false
- Throws:
java.io.IOException- if I/O error occurs or given parameters are not valid
-
pipeMsgEvent
public void pipeMsgEvent(net.jxta.pipe.PipeMsgEvent event)
- Specified by:
pipeMsgEventin interfacenet.jxta.pipe.PipeMsgListener
-
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()
-
-