|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.mgmt.transport.AbstractNetworkManager
com.sun.enterprise.mgmt.transport.jxta.JxtaNetworkManager
public class JxtaNetworkManager
NetworkManager wraps the JXTA plaform lifecycle into a single object. Using the instance name, it encodes a node Peer ID, and provides utilities to derive Peer ID's from an instance name. Given an instance name, this allows any node to independently interpolate a Peer ID.
TODO:REVISIT FOR REFACTORING AND ADDED REQUIRMENTS. TODO: WHEN SPECIFYING INSTANCENAME IN EACH METHOD, IS IT THE INTENTION THAT THE CONSUMING APP COULD POTENTIALLY TODO: PROVIDE DIFFERENT INSTANCE NAMES AT DIFFERENT TIMES DURING A GIVEN LIFETIME OF THE APP? WHAT IMPACT WOULD THERE TODO:BE IF WE REMOVE INSTANCENAME FROM THE PARAMETERS OF THESE METHODS AND BASE INSTANCE NAME FROM THE CONSTRUCTOR'S TODO: CONSTRUCTION FROM PROPERTIES OBJECT?
| Field Summary |
|---|
| Fields inherited from class com.sun.enterprise.mgmt.transport.AbstractNetworkManager |
|---|
localPeerID |
| Fields inherited from interface com.sun.enterprise.mgmt.transport.ShoalMessageSender |
|---|
TCP_TRANSPORT, UDP_TRANSPORT |
| Constructor Summary | |
|---|---|
JxtaNetworkManager()
|
|
| Method Summary | |
|---|---|
void |
addRemotePeer(PeerID id)
Add the peerID to this network manager |
protected void |
afterDispatchingMessage(MessageEvent messageEvent,
Map piggyback)
After executing MessageListener.receiveMessageEvent(MessageEvent)} callback, this method will be called |
protected void |
beforeDispatchingMessage(MessageEvent messageEvent,
Map piggyback)
Before executing MessageListener.receiveMessageEvent(MessageEvent)} callback, this method will be called |
boolean |
broadcast(Message message)
Broadcasts or Multicasts the given Message to all members |
void |
cacheRoute(RouteAdvertisement route)
Caches a route for an instance |
PipeID |
getAppServicePipeID()
Returns the Pipe ID that will be used for application layer to send and receive messages. |
RouteAdvertisement |
getCachedRoute(net.jxta.peer.PeerID peerid)
returns the cached route if any, null otherwise |
PipeID |
getHealthPipeID()
Returns the HealthMonitor PipeID, used for health monitoring purposes. |
File |
getHome()
Returns the home directory. |
PeerGroupID |
getInfraPeerGroupID()
Contructs and returns the Infrastructure PeerGroupID for the ClusterManager. |
String |
getInstanceName()
Returns this instance name. |
net.jxta.peer.PeerID |
getJxtaPeerID(String instanceName)
|
PipeID |
getMasterPipeID()
Returns the MasterNode protocol PipeID. |
MessageSender |
getMessageSender(int transport)
Returns a MessageSender corresponding with transport type |
MulticastMessageSender |
getMulticastMessageSender()
Returns a MulticastMessageSender |
PeerGroup |
getNetPeerGroup()
Returns the netPeerGroup instance for this Cluster. |
PeerGroupID |
getPeerGroupID(String groupName)
Given a instance name, it returns a name encoded PeerID to for binding to specific instance. |
net.jxta.peer.PeerID |
getPeerID()
Gets this instance's PeerID |
PeerID |
getPeerID(String instanceName)
Given a instance name, it returns a name encoded PeerID to for binding to specific instance. |
PipeAdvertisement |
getPipeAdvertisement(String instanceName)
Creates a JxtaBiDiPipe pipe advertisement with a SHA1 encoded instance name pipe ID. |
PipeID |
getPipeID()
Returns this instance name encoded PipeID. |
net.jxta.pipe.PipeID |
getPipeID(String instanceName)
Given a instance name, it returns a name encoded PipeID to for binding JxtaBiDiPipes. |
PipeID |
getSessionQueryPipeID()
Returns the SessionQeuryPipe ID. |
PipeAdvertisement |
getSocketAdvertisement(String instanceName)
Creates a JxtaSocket pipe advertisement with a SHA1 encoded instance name pipe ID. |
net.jxta.pipe.PipeID |
getSocketID(String instanceName)
Given a instance name, it returns a name encoded PipeID to for binding JxtaSockets. |
void |
initialize(String groupName,
String instanceName,
Map properties)
NetworkManager provides a simple interface to configuring and managing the lifecycle of the JXTA platform. |
boolean |
isConnected(PeerID peerID)
Check whether the suspicious peer is alive or not This API is mainly used in HealthMonitor in order to determine the failure member |
void |
removePeerID(PeerID peerID)
Removes the peerID from this network manager |
void |
rendezvousEvent(RendezvousEvent event)
|
boolean |
send(PeerID peerID,
Message message)
Sends the given Message to the destination |
void |
start()
Creates and starts the JXTA NetPeerGroup using a platform configuration template. |
void |
stop()
Stops the NetworkManager and the JXTA platform. |
boolean |
waitForRendezvousConnection(long timeout)
Blocks until a connection to rendezvous node occurs. |
| Methods inherited from class com.sun.enterprise.mgmt.transport.AbstractNetworkManager |
|---|
addMessageListener, getInstance, getLocalPeerID, getLogger, receiveMessage, removeMessageListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JxtaNetworkManager()
| Method Detail |
|---|
public void initialize(String groupName,
String instanceName,
Map properties)
throws IOException
initialize in interface NetworkManagerinitialize in class AbstractNetworkManagergroupName - Group Name, a logical group name that this peer is part of.instanceName - Instance Name, a logical name for this peer.properties - a Properties object that would contain every configuration
element that the employing application wants to specify values for. The
keys in this object must correspond to the constants specified in the
JxtaConfigConstants enum.
IOException - if an unexpected error occurspublic net.jxta.pipe.PipeID getPipeID(String instanceName)
instanceName - instance name
public net.jxta.pipe.PipeID getSocketID(String instanceName)
instanceName - instance name value
public PeerID getPeerID(String instanceName)
instanceName - instance name value
public void removePeerID(PeerID peerID)
NetworkManagerpeerID from this network manager
public boolean isConnected(PeerID peerID)
NetworkManagerHealthMonitor in order to determine the failure member
peerID - peer id
public net.jxta.peer.PeerID getJxtaPeerID(String instanceName)
public PeerGroupID getPeerGroupID(String groupName)
groupName - instance name value
public PipeID getHealthPipeID()
public PipeID getMasterPipeID()
public PipeID getSessionQueryPipeID()
public PipeID getAppServicePipeID()
public PipeAdvertisement getSocketAdvertisement(String instanceName)
instanceName - instance name
public PipeAdvertisement getPipeAdvertisement(String instanceName)
instanceName - instance name
public PeerGroupID getInfraPeerGroupID()
public void start()
throws IOException
start in interface NetworkManagerstart in interface ShoalMessageSenderstart in class AbstractNetworkManagerIOException - if an io error occurs during creation of the cache directorypublic void stop()
stop in interface NetworkManagerstop in interface ShoalMessageSenderstop in class AbstractNetworkManager
public boolean send(PeerID peerID,
Message message)
throws IOException
MessageSenderMessage to the destination
peerID - the destination PeerID. null is not allowedmessage - a message which is sent to the peer
IOException - if I/O error occurs or given parameters are not valid
public boolean broadcast(Message message)
throws IOException
MulticastMessageSenderMessage to all members
message - a message which is sent to all members
IOException - if I/O error occurs or given parameters are not valid
protected void beforeDispatchingMessage(MessageEvent messageEvent,
Map piggyback)
AbstractNetworkManagerMessageListener.receiveMessageEvent(MessageEvent)} callback, this method will be called
beforeDispatchingMessage in class AbstractNetworkManagermessageEvent - a received MessageEventpiggyback - piggyback
protected void afterDispatchingMessage(MessageEvent messageEvent,
Map piggyback)
AbstractNetworkManagerMessageListener.receiveMessageEvent(MessageEvent)} callback, this method will be called
afterDispatchingMessage in class AbstractNetworkManagermessageEvent - a received MessageEventpiggyback - piggybackpublic PeerGroup getNetPeerGroup()
public boolean waitForRendezvousConnection(long timeout)
timeout - timeout in milliseconds
public void rendezvousEvent(RendezvousEvent event)
public net.jxta.peer.PeerID getPeerID()
public PipeID getPipeID()
public String getInstanceName()
public File getHome()
public void cacheRoute(RouteAdvertisement route)
route - the route advertisementpublic RouteAdvertisement getCachedRoute(net.jxta.peer.PeerID peerid)
peerid - the instance id
public MessageSender getMessageSender(int transport)
NetworkManagerMessageSender corresponding with transport type
transport - transport type. ShoalMessageSender.TCP_TRANSPORT or ShoalMessageSender.UDP_TRANSPORT's integer value
MessageSender's instance which this network manager containspublic MulticastMessageSender getMulticastMessageSender()
NetworkManagerMulticastMessageSender
MulticastMessageSender's instance which this network manager containspublic void addRemotePeer(PeerID id)
NetworkManagerpeerID to this network manager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||