|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--scorej.external.CommProtocol
|
+--scorej.external.grid.GridHelper
Protocol that facilitates communication with the CoABS Grid. The ScoreJ Node itself can be registered with the Grid, so that different ScoreJ nodes can send signals back and forth using the grid. Agents can be registered with the Grid also, so that they can send/receive messages from other agents on the Grid.
| Field Summary | |
boolean |
registered
|
| Fields inherited from class scorej.external.CommProtocol |
_props |
| Constructor Summary | |
GridHelper()
Exists for the purposes of S framework instantiation. |
|
GridHelper(java.lang.String id)
GridHelper constructor. |
|
| Method Summary | |
void |
addNodeListener(RemoteNodeListener l)
|
void |
broadcastSignal(Signal sig)
Broadcast a signal to all nodes. |
void |
changeFilters(java.util.Vector newFilters)
Changes the signal filters associated with the node to the new set specified in the arguments. |
void |
changeFilters(java.util.Vector newFilters,
Node n)
Changes the signal filters associated with the node to the new set specified in the arguments. |
void |
closeProtocol()
Extends CommProtocol.closeProtocol. |
static Signal |
convertMessageToSignal(com.globalinfotek.coabsgrid.Message msg)
Convert a Grid Message object to a ScoreJ signal |
com.globalinfotek.coabsgrid.Message |
convertSignalToMessage(Signal sig,
boolean raw)
Convert a scoreJ Signal into a Grid Message. |
java.util.Vector |
findAllAgents(AgentID template)
Find as many agents as possible that matches the template. |
java.util.Vector |
findAllAgentsOnGrid(JiniAgentEntry searchTemplate)
Grid lookup. |
com.globalinfotek.coabsgrid.AgentRep |
findKnownAgentRep(ID idTemplate)
Find an AgentRep that this node already knows about from an ID. |
void |
findOmarNodes()
Find every "agent" registered with a ScoreJiniEntry on the Grid. |
AgentID |
findSingleAgent(AgentID template)
Find one agent that matches the template. |
java.util.Properties |
getDefaultProperties()
Implements CommProtocol.getDefaultProperties |
com.globalinfotek.coabsgrid.Directory |
getDirectory()
|
net.jini.core.entry.Entry[] |
getEntries()
Get entries advertised with the Grid |
static GridNode |
getGridNode()
Returns the GridNode used for this node. |
java.lang.String |
getId()
|
Node |
getLocalNode()
Gets a reference to the local Node object. |
java.util.Vector |
getNodes()
Return a list of discovered Nodes Required by CommProtocol |
protected GridHelper |
initializeGrid()
|
protected GridHelper |
initializeGrid(java.lang.String nodeID)
|
void |
initializeProtocol(java.util.Properties props)
Implements CommProtocol.initializeProtocol(Properties) |
boolean |
isRegistered()
|
void |
messageAdded(com.globalinfotek.coabsgrid.Message msg)
Message added function is the Grid callback that gets invoked whenever a incoming message gets added to this message queue. |
void |
registerAgent(AgentID agent)
Register an agent with the Grid. |
void |
registerAgent(AgentID agent,
boolean independentAgent)
|
void |
registerAgent(java.lang.String name,
net.jini.core.entry.Entry[] attributes)
Register an agent on the Grid as a independent Agent (not part of this ScoreJ Node). |
void |
registerFilter(Filter f)
Add a new signal filter to the local node. |
void |
registerFilter(Filter f,
Node n)
Add a new signal filter to a node. |
protected void |
registerWithGrid()
|
void |
sendSignal(Node node,
Signal sig)
Send a signal to a Node by invoking sendSignal on that node. |
void |
serviceAdded(net.jini.lookup.ServiceDiscoveryEvent event)
Received a notification event from the grid that some node or agent has registered. |
void |
serviceChanged(net.jini.lookup.ServiceDiscoveryEvent event)
Received a serviceChanged event. |
void |
serviceRemoved(net.jini.lookup.ServiceDiscoveryEvent event)
|
void |
shutdownHandler()
Shutdown handler will be called when the JVM exits |
void |
startProtocol()
Implements CommProtocol.startProtocol(Properties) |
boolean |
unregisterAgent(AgentID agent)
Remove a AgentID from the registered agent list |
void |
unregisterAllAgents()
Clean out the registered agent list |
void |
update()
Required by CommProtocol |
void |
updateEntry(net.jini.core.entry.Entry newEntry)
Update the Grid Advertisement for this node by adding a new Entry to it |
| Methods inherited from class scorej.external.CommProtocol |
getProperties, isEnabledRegisterAgent, isEnabledRegisterFilter, setEnabledRegisterAgent, setEnabledRegisterFilter, setProperties |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public boolean registered
| Constructor Detail |
public GridHelper()
public GridHelper(java.lang.String id)
| Method Detail |
public void initializeProtocol(java.util.Properties props)
initializeProtocol in class CommProtocolprops - protocol properties, can be null or empty.public void startProtocol()
startProtocol in class CommProtocolpublic java.util.Properties getDefaultProperties()
getDefaultProperties in class CommProtocolpublic static GridNode getGridNode()
public com.globalinfotek.coabsgrid.Directory getDirectory()
public java.lang.String getId()
protected GridHelper initializeGrid()
protected GridHelper initializeGrid(java.lang.String nodeID)
protected void registerWithGrid()
public static Signal convertMessageToSignal(com.globalinfotek.coabsgrid.Message msg)
public com.globalinfotek.coabsgrid.Message convertSignalToMessage(Signal sig,
boolean raw)
sig - is the Signal object to be convertedraw - boolean determining whether the Signal is stringified or sent
as an object.
public void messageAdded(com.globalinfotek.coabsgrid.Message msg)
messageAdded in interface com.globalinfotek.coabsgrid.MessageListenerpublic void findOmarNodes()
public void addNodeListener(RemoteNodeListener l)
public void serviceAdded(net.jini.lookup.ServiceDiscoveryEvent event)
serviceAdded in interface net.jini.lookup.ServiceDiscoveryListenerpublic void serviceRemoved(net.jini.lookup.ServiceDiscoveryEvent event)
serviceRemoved in interface net.jini.lookup.ServiceDiscoveryListenerpublic void serviceChanged(net.jini.lookup.ServiceDiscoveryEvent event)
serviceChanged in interface net.jini.lookup.ServiceDiscoveryListenerpublic java.util.Vector getNodes()
getNodes in class CommProtocolpublic Node getLocalNode()
Node object.
getLocalNode in class CommProtocolNode
object.public void registerFilter(Filter f)
registerFilter in class CommProtocol
public void registerFilter(Filter f,
Node n)
registerFilter in class CommProtocolf - The Filter object to be registered.n - The Node to associate the filter with.public void changeFilters(java.util.Vector newFilters)
changeFilters in class CommProtocolnewFilters - A Vector of new Filter Objects.
public void changeFilters(java.util.Vector newFilters,
Node n)
changeFilters in class CommProtocolnewFilters - A Vector of new Filter Objects.n - Reference to the Node object.public void updateEntry(net.jini.core.entry.Entry newEntry)
public net.jini.core.entry.Entry[] getEntries()
public void sendSignal(Node node,
Signal sig)
sendSignal in class CommProtocolnode - The node the signal is sent to.sig - The siganl object to be sent.public void broadcastSignal(Signal sig)
public boolean isRegistered()
public void closeProtocol()
closeProtocol in class CommProtocolpublic void registerAgent(AgentID agent)
registerAgent in class CommProtocol
public void registerAgent(AgentID agent,
boolean independentAgent)
public void registerAgent(java.lang.String name,
net.jini.core.entry.Entry[] attributes)
name - String name of the agentpublic boolean unregisterAgent(AgentID agent)
CommProtocol
unregisterAgent in class CommProtocolpublic void unregisterAllAgents()
CommProtocol
unregisterAllAgents in class CommProtocolpublic AgentID findSingleAgent(AgentID template)
findSingleAgent in class CommProtocolpublic java.util.Vector findAllAgents(AgentID template)
findAllAgents in class CommProtocolpublic java.util.Vector findAllAgentsOnGrid(JiniAgentEntry searchTemplate)
public com.globalinfotek.coabsgrid.AgentRep findKnownAgentRep(ID idTemplate)
public void shutdownHandler()
shutdownHandler in class CommProtocolpublic void update()
update in class CommProtocol
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||