|
GridGain 2.0.3
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Apache20LicenseCompatible public interface GridSpiContext
TODO: add file description.
See Also:
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.0.3
| Method Summary | |
|---|---|
void |
addDiscoveryListener(GridDiscoveryListener listener)
Adds a listener for discovery events. |
void |
addLocalEventListener(GridLocalEventListener listener)
Adds an event listener for local events. |
void |
addMessageListener(GridMessageListener listener,
String topic)
Register a message listener to receive messages sent by remote nodes. |
Collection<GridNode> |
getAllNodes()
Gets a collection of all grid nodes. |
GridNode |
getLocalNode()
Gets local grid node. |
GridNode |
getNode(UUID nodeId)
Gets a node instance based on its ID. |
Collection<GridNode> |
getRemoteNodes()
Gets a collection of remote grid nodes. |
Collection<GridNode> |
getTopology(GridTaskSession taskSes,
Collection<GridNode> grid)
Obtain grid node topology for a given task. |
boolean |
pingNode(UUID nodeId)
Pings a remote node. |
boolean |
removeDiscoveryListener(GridDiscoveryListener listener)
Removes discovery event listener. |
boolean |
removeLocalEventListener(GridLocalEventListener listener)
Removes local event listener. |
boolean |
removeMessageListener(GridMessageListener listener,
String topic)
Removes a previously registered message listener. |
void |
sendMessage(Collection<GridNode> nodes,
Serializable msg,
String topic)
Sends a message to a group of remote nodes. |
void |
sendMessage(GridNode node,
Serializable msg,
String topic)
Sends a message to a remote node. |
| Method Detail |
|---|
Collection<GridNode> getRemoteNodes()
GridDiscoverySpi implementation used. Unlike GridSpiContext.getAllNodes(),
this method does not include local grid node.
GridSpiContext.getLocalNode(),
GridSpiContext.getAllNodes(),
GridDiscoverySpiCollection<GridNode> getAllNodes()
GridDiscoverySpi implementation used. Unlike GridSpiContext.getRemoteNodes(),
this method does include local grid node.
GridSpiContext.getLocalNode(),
GridSpiContext.getRemoteNodes(),
GridDiscoverySpiGridNode getLocalNode()
GridDiscoverySpi
implementation used.
GridDiscoverySpiGridNode getNode(UUID nodeId)
nodeId - ID of a node to get.
GridDiscoverySpiboolean pingNode(UUID nodeId)
GridDiscoverySpi.pingNode(UUID) implementation.
Discovery SPIs usually have some latency in discovering failed nodes. Hence, communication to remote nodes may fail at times if an attempt was made to establish communication with a failed node. This method can be used to check if communication has failed due to node failure or due to some other reason.
nodeId - ID of a node to ping.
GridDiscoverySpivoid addDiscoveryListener(GridDiscoveryListener listener)
GridDiscoveryEventType
for a set of all possible discovery events.
listener - Listener to discovery events.boolean removeDiscoveryListener(GridDiscoveryListener listener)
listener - Discovery event listener to remove.
void sendMessage(GridNode node,
Serializable msg,
String topic)
throws GridException
GridCommunicationSpi implementation used.
This method can be used by jobs to communicate with other nodes in the grid. Remote nodes
can receive messages by registering a listener through GridSpiContext.addMessageListener(GridMessageListener, String)
method.
GridException - If failed to send a message to remote node.node - Node to send a message to.msg - Message to send.topic - Topic to send message to.GridCommunicationSpi,
GridSpiContext.addMessageListener(GridMessageListener, String),
GridSpiContext.removeMessageListener(GridMessageListener, String)
void sendMessage(Collection<GridNode> nodes,
Serializable msg,
String topic)
throws GridException
GridCommunicationSpi implementation used.
This method can be used by jobs to communicate with other nodes in the grid. Remote nodes
can receive messages by registering a listener through GridSpiContext.addMessageListener(GridMessageListener, String)
method.
GridException - If failed to send a message to any of the remote nodes.nodes - Group of nodes to send a message to.msg - Message to send.topic - Topic to send message to.GridCommunicationSpi,
GridSpiContext.addMessageListener(GridMessageListener, String),
GridSpiContext.removeMessageListener(GridMessageListener, String)
void addMessageListener(GridMessageListener listener,
String topic)
GridCommunicationSpi implementation used.
This method can be used by jobs to communicate with other nodes in the grid. Remote nodes
can send messages by calling GridSpiContext.sendMessage(GridNode, Serializable, String) or
GridSpiContext.sendMessage(Collection, Serializable, String) methods.
listener - Message listener to register.topic - Topic to register listener for.GridCommunicationSpi,
GridSpiContext.sendMessage(GridNode, Serializable, String),
GridSpiContext.sendMessage(Collection, Serializable, String),
GridSpiContext.removeMessageListener(GridMessageListener, String)
boolean removeMessageListener(GridMessageListener listener,
String topic)
listener - Message listener to remove.topic - Topic to unregister listener for.
GridSpiContext.addMessageListener(GridMessageListener, String)void addLocalEventListener(GridLocalEventListener listener)
GridEventType
for a set of all possible events.
listener - Event listener for local events.GridEventTypeboolean removeLocalEventListener(GridLocalEventListener listener)
listener - Local event listener to remove.
Collection<GridNode> getTopology(GridTaskSession taskSes,
Collection<GridNode> grid)
throws GridException
GridException - If failed to get topology.taskSes - Task session.grid - Available grid nodes.
|
GridGain 2.0.3
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Grid Computing Made Simple, ver. 2.0.3.20052008
2005-2008 Copyright © GridGain Systems. All Rights Reserved. |
|