|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridgain.grid.GridSpringBean
public class GridSpringBean
Grid Spring bean allows to bypass GridFactory methods.
In other words, this bean class allows to inject new grid instance from
Spring configuration file directly without invoking static
GridFactory methods. This class can be wired directly from
Spring and can be referenced from within other Spring beans.
By virtue of implementing DisposableBean and InitializingBean
interfaces, GridSpringBean automatically starts and stops underlying
grid instance.
GridSpringBean has following configuration parameters.
GridSpringBean.setConfiguration(GridConfiguration))
<bean id="mySpringBean" class="org.gridgain.grid.GridSpringBean" scope="singleton">
<property name="configuration">
<bean id="grid.cfg" class="org.gridgain.grid.GridConfigurationAdapter" scope="singleton">
<property name="gridName" value="mySpringGrid"/>
</bean>
</property>
</bean>
Or use default configuration:
<bean id="mySpringBean" class="org.gridgain.grid.GridSpringBean" scope="singleton"/>
AbstractApplicationContext ctx = new FileSystemXmlApplicationContext("/path/to/spring/file");
// Register Spring hook to destroy bean automatically.
ctx.registerShutdownHook();
Grid grid = (Grid)ctx.getBean("mySpringBean");
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.1.0
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Constructor Summary | |
|---|---|
GridSpringBean()
|
|
| 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)
Register a message listener to receive messages sent by remote nodes. |
|
void |
afterPropertiesSet()
|
|
void |
deployTask(Class<? extends GridTask> taskCls)
Explicitely deploys given grid task on the local node. |
|
void |
deployTask(Class<? extends GridTask> taskCls,
ClassLoader clsLoader)
Explicitely deploys given grid task on the local node. |
|
void |
destroy()
|
|
|
execute(Class<? extends GridTask<T,R>> taskCls,
T arg)
Executes a task on the grid. |
|
|
execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
GridTaskListener listener)
Asynchronously executes a task on the grid. |
|
|
execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
long timeout)
Executes a task on the grid. |
|
|
execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
long timeout,
GridTaskListener listener)
Asynchronously executes a task on the grid. |
|
|
execute(GridTask<T,R> task,
T arg)
Executes a task on the grid. |
|
|
execute(GridTask<T,R> task,
T arg,
GridTaskListener listener)
Asynchronously executes a task on the grid. |
|
|
execute(GridTask<T,R> task,
T arg,
long timeout)
Executes a task on the grid. |
|
|
execute(GridTask<T,R> task,
T arg,
long timeout,
GridTaskListener listener)
Asynchronously executes a task on the grid. |
|
|
execute(String taskName,
T arg)
Executes a task on the grid. |
|
|
execute(String taskName,
T arg,
GridTaskListener listener)
Asynchronously executes a task on the grid. |
|
|
execute(String taskName,
T arg,
long timeout)
Executes a task on the grid. |
|
|
execute(String taskName,
T arg,
long timeout,
GridTaskListener listener)
Asynchronously executes a task on the grid. |
|
Collection<GridNode> |
getAllNodes()
Gets a collection of all grid nodes. |
|
long |
getAllTopologyHash()
This method calculates hash all the nodes in the topology. |
|
GridConfiguration |
getConfiguration()
Gets grid configuration. |
|
GridNode |
getLocalNode()
Gets local grid node. |
|
Map<String,Class<? extends GridTask<?,?>>> |
getLocalTasks()
Gets map of all locally deployed tasks keyed by their task name. |
|
String |
getName()
Gets the name of the grid this grid instance (and correspondently its local node) belongs to. |
|
GridNode |
getNode(UUID nodeId)
Gets a node instance based on its ID. |
|
Collection<GridNode> |
getNodes(GridNodeFilter filter)
Gets all grid nodes accepted by the filter. |
|
Collection<GridNode> |
getRemoteNodes()
Gets a collection of remote grid nodes. |
|
long |
getTopologyHash(Collection<GridNode> nodes)
This method calculates hash value of the given set of nodes (a topology). |
|
ExecutorService |
newGridExecutorService()
Creates ExecutorService which will execute all submitted
Callable and Runnable tasks on the grid. |
|
boolean |
pingNode(UUID nodeId)
Pings a remote node. |
|
List<GridEvent> |
queryEvents(GridEventFilter filter,
Collection<GridNode> nodes,
long timeout)
Queries all remote nodes for events using passed in filter for event selection. |
|
List<GridEvent> |
queryLocalEvents(GridEventFilter filter)
Queries local node for events using passed-in filter for event selection. |
|
boolean |
removeDiscoveryListener(GridDiscoveryListener listener)
Removes discovery event listener. |
|
boolean |
removeLocalEventListener(GridLocalEventListener listener)
Removes local event listener. |
|
boolean |
removeMessageListener(GridMessageListener listener)
Removes a previously registered message listener. |
|
void |
sendMessage(Collection<GridNode> nodes,
Serializable msg)
Sends a message to a group of remote nodes. |
|
void |
sendMessage(GridNode node,
Serializable msg)
Sends a message to a remote node. |
|
void |
setApplicationContext(org.springframework.context.ApplicationContext ctx)
|
|
void |
setConfiguration(GridConfiguration cfg)
Sets grid configuration. |
|
void |
undeployTask(String taskName)
Makes the best attempt to undeploy a task from the whole grid. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GridSpringBean()
| Method Detail |
|---|
public GridConfiguration getConfiguration()
public void setConfiguration(GridConfiguration cfg)
cfg - Grid configuration.public void addDiscoveryListener(GridDiscoveryListener listener)
GridDiscoveryEventType
for a set of all possible discovery events.
addDiscoveryListener in interface Gridlistener - Listener to discovery events.public void addLocalEventListener(GridLocalEventListener listener)
GridEventType
for a set of all possible events.
addLocalEventListener in interface Gridlistener - Event listener for local events.GridEventTypepublic void addMessageListener(GridMessageListener listener)
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 Grid.sendMessage(GridNode, Serializable) or
Grid.sendMessage(Collection, Serializable) methods.
addMessageListener in interface Gridlistener - Message listener to register.GridCommunicationSpi,
Grid.sendMessage(GridNode, Serializable),
Grid.sendMessage(Collection, Serializable),
Grid.removeMessageListener(GridMessageListener)
public void deployTask(Class<? extends GridTask> taskCls)
throws GridException
GridConfiguration.isPeerClassLoadingEnabled()), then other nodes
will automatically deploy task upon execution request from the originating node without
having to manually deploy it.
Another way of class deployment which is supported is deployment from local class path. Class from local class path has a priority over P2P deployed. Following describes task class deployment:
GridConfiguration.isPeerClassLoadingEnabled())
GridConfiguration.getP2PLocalClassPathExclude()).GridConfiguration.isPeerClassLoadingEnabled())
Note that this is an alternative deployment method additionally to deployment SPI that
provides more formal method of deploying a task, e.g. deployment of GAR files and/or URI-based
deployment. See GridDeploymentSpi for detailed information about grid task deployment.
Note that class can be deployed multiple times on remote nodes, i.e. re-deployed. GridGain maintains internal version of deployment for each instance of deployment (analogous to class and class loader in Java). Execution happens always on the latest deployed instance (latest that is on the node where execution request is originated). This allows a very convenient development model when a developer can execute a task on the grid from IDE, then realize that he made a mistake, stop his node in IDE, fix mistake and re-execute the task. Grid will automatically detect that task got renewed and redeploy it on all remote nodes upon execution.
This method has no effect if the class passed in was already deployed. Implementation checks for this condition and returns immediately.
deployTask in interface GridGridException - If task is invalid and cannot be deployed.taskCls - Task class to deploy. If task class has GridTaskName annotation,
then task will be deployed under a name specified within annotation. Otherwise, full
class name will be used as task's name.GridDeploymentSpi
public void deployTask(Class<? extends GridTask> taskCls,
ClassLoader clsLoader)
throws GridException
GridConfiguration.isPeerClassLoadingEnabled()), then other nodes
will automatically deploy task upon execution request from the originating node without
having to manually deploy it.
Another way of class deployment which is supported is deployment from local class path. Class from local class path has a priority over P2P deployed. Following describes task class deployment:
GridConfiguration.isPeerClassLoadingEnabled())
GridConfiguration.getP2PLocalClassPathExclude()).GridConfiguration.isPeerClassLoadingEnabled())
Note that this is an alternative deployment method additionally to deployment SPI that
provides more formal method of deploying a task, e.g. deployment of GAR files and/or URI-based
deployment. See GridDeploymentSpi for detailed information about grid task deployment.
Note that class can be deployed multiple times on remote nodes, i.e. re-deployed. GridGain maintains internal version of deployment for each instance of deployment (analogous to class and class loader in Java). Execution happens always on the latest deployed instance (latest that is on the node where execution request is originated). This allows a very convenient development model when a developer can execute a task on the grid from IDE, then realize that he made a mistake, stop his node in IDE, fix mistake and re-execute the task. Grid will automatically detect that task got renewed and redeploy it on all remote nodes upon execution.
This method has no effect if the class passed in was already deployed. Implementation checks for this condition and returns immediately.
deployTask in interface GridGridException - If task is invalid and cannot be deployed.taskCls - Task class to deploy. If task class has GridTaskName annotation,
then task will be deployed under a name specified within annotation. Otherwise, full
class name will be used as task's name.clsLoader - Task resources/classes class loader. This class loader is in charge
of loading all necessary resources.GridDeploymentSpi
public <T,R> GridTaskFuture<R> execute(String taskName,
T arg)
GridTask documentation.
This method assumes indefinite wait for task completion. To provide a timeout, use
Grid.execute(String, Object, long) method. It is always recommended to specify
explicit task timeout.
If task for given name has not been deployed yet, then taskName will be used as task class name to auto-deploy the task (see Grid#deployTask() method for deployment algorithm).
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskName - Name of the task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.
for information about task execution.
public <T,R> GridTaskFuture<R> execute(String taskName,
T arg,
long timeout)
GridTask documentation.
If task for given name has not been deployed yet, then taskName will be used as task class name to auto-deploy the task(see Grid#deployTask() method for deployment algorithm).
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskName - Name of the task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0 the system will wait indefinitely for execution completion.
for information about task execution.
public <T,R> GridTaskFuture<R> execute(String taskName,
T arg,
GridTaskListener listener)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridTaskFuture.isDone() will always return true.
This method assumes indefinite wait for task completion. To provide a timeout, use
Grid.execute(String, Object, long, GridTaskListener) method. It is always
recommended to specify explicit task timeout.
If task for given name has not been deployed yet, then taskName will be used as task class name to auto-deploy the task(see Grid#deployTask() method for deployment algorithm).
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskName - Name of the task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.listener - Grid task result listener that will be called once the execution is completed
(successfully or not).
for information about task execution.
public <T,R> GridTaskFuture<R> execute(String taskName,
T arg,
long timeout,
GridTaskListener listener)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridTaskFuture.isDone() will always return true.
If task for given name has not been deployed yet, then taskName will be used as task class name to auto-deploy the task(see Grid#deployTask() method for deployment algorithm).
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskName - Name of the task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0, then the system will wait indefinitely for execution completion.listener - Grid task result listener that will be called once the execution is completed
(successfully or not).
for information about task execution.
public <T,R> GridTaskFuture<R> execute(Class<? extends GridTask<T,R>> taskCls,
T arg)
GridTask documentation.
This method assumes indefinite wait for task completion. To provide a timeout, use
Grid.execute(String, Object, long) method. It is always recommended to specify
explicit task timeout.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskCls - Class of the task to execute. If class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.
for information about task execution.
public <T,R> GridTaskFuture<R> execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
long timeout)
GridTask documentation.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskCls - Class of the task to execute. If class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0 the system will wait indefinitely for execution completion.
for information about task execution.
public <T,R> GridTaskFuture<R> execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
GridTaskListener listener)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridTaskFuture.isDone() will always return true.
This method assumes indefinite wait for task completion. To provide a timeout, use
Grid.execute(String, Object, long, GridTaskListener) method. It is always
recommended to specify explicit task timeout.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
execute in interface GridT - Type of the task argument.R - Type of the task result returning from GridTask.reduce(List) method.taskCls - Class of the task to execute. If class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.listener - Grid task result listener that will be called once the execution is completed
(successfully or not).
for information about task execution.
public <T,R> GridTaskFuture<R> execute(Class<? extends GridTask<T,R>> taskCls,
T arg,
long timeout,
GridTaskListener listener)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridTaskFuture.isDone() will always return true.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.taskCls - Class of the task to execute. If class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0, then the system will wait indefinitely for execution completion.listener - Grid task result listener that will be called once the execution is completed
(successfully or not).
for information about task execution.
public <T,R> GridTaskFuture<R> execute(GridTask<T,R> task,
T arg)
GridTask documentation.
This method assumes indefinite wait for task completion. To provide a timeout, use
Grid.execute(String, Object, long) method. It is always recommended to specify
explicit task timeout.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.task - Instance of task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.
for information about task execution.
public <T,R> GridTaskFuture<R> execute(GridTask<T,R> task,
T arg,
long timeout)
GridTask documentation.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.task - Instance of task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0 the system will wait indefinitely for execution completion.
for information about task execution.
public <T,R> GridTaskFuture<R> execute(GridTask<T,R> task,
T arg,
GridTaskListener listener)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridTaskFuture.isDone() will always return true.
This method assumes indefinite wait for task completion. To provide a timeout, use
Grid.execute(String, Object, long, GridTaskListener) method. It is always
recommended to specify explicit task timeout.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.task - Instance of task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.listener - Grid task result listener that will be called once the execution is completed
(successfully or not).
for information about task execution.
public <T,R> GridTaskFuture<R> execute(GridTask<T,R> task,
T arg,
long timeout,
GridTaskListener listener)
GridTask
documentation. Once task execution is complete, GridTaskListener.onFinished(GridTaskFuture)
gets called. In that case GridTaskFuture.isDone() will always return true.
This method is extremely useful when task class is already loaded, for example, in J2EE application server environment. Since application servers already support deployment and hot-redeployment, it is convenient to deploy all task related classes via standard J2EE deployment and then use task classes directly.
When using this method task will be deployed automatically, so no explicit deployment step is required.
execute in interface GridT - Type of the task's argument.R - Type of the task result returning from GridTask.reduce(List) method.task - Instance of task to execute. If task class has GridTaskName annotation,
then task is deployed under a name specified within annotation. Otherwise, full
class name is used as task's name.arg - Optional argument of task execution, can be null.timeout - Optional timeout for this task execution in milliseconds.
If 0, then the system will wait indefinitely for execution completion.listener - Grid task result listener that will be called once the execution is completed
(successfully or not).
for information about task execution.public Collection<GridNode> getAllNodes()
GridDiscoverySpi implementation used. Unlike Grid.getRemoteNodes(),
this method does include local grid node.
getAllNodes in interface GridGrid.getLocalNode(),
Grid.getRemoteNodes(),
GridDiscoverySpipublic long getAllTopologyHash()
Grid.getTopologyHash(Collection) with all grid nodes.
Note that since GridGain topology architecture is peer-to-peer (without centralized coordination) there is still a small window in which different nodes would have different version for the same topology. Therefore, this version cannot be used in strict ACID context. Values returned by this method are not guaranteed to be sequential. Standard implementation uses CRC32 hash method.
getAllTopologyHash in interface Gridpublic GridNode getLocalNode()
GridDiscoverySpi
implementation used.
getLocalNode in interface GridGridDiscoverySpipublic Map<String,Class<? extends GridTask<?,?>>> getLocalTasks()
getLocalTasks in interface Gridpublic String getName()
If default grid instance is used, then
null is returned. Refer to GridFactory documentation
for information on how to start named grids.
getName in interface Gridpublic GridNode getNode(UUID nodeId)
getNode in interface GridnodeId - ID of a node to get.
GridDiscoverySpipublic Collection<GridNode> getNodes(GridNodeFilter filter)
getNodes in interface Gridfilter - Filter for grid nodes.
public Collection<GridNode> getRemoteNodes()
GridDiscoverySpi implementation used. Unlike Grid.getAllNodes(),
this method does not include local grid node.
getRemoteNodes in interface GridGrid.getLocalNode(),
Grid.getAllNodes(),
GridDiscoverySpipublic long getTopologyHash(Collection<GridNode> nodes)
Note that since GridGain topology architecture is peer-to-peer (without centralized coordination) there is still a small window in which different nodes would have different version for the same topology. Therefore, this version cannot be used in strict ACID context. Values returned by this method are not guaranteed to be sequential. Standard implementation uses CRC32 hash method.
getTopologyHash in interface Gridnodes - Collection of grid nodes. Note that this can be either full topology or
any subset of it.
public ExecutorService newGridExecutorService()
ExecutorService which will execute all submitted
Callable and Runnable tasks on the grid.
User may run Callable and Runnable tasks
just like normally with java.util.ExecutorService,
but these tasks must implement Serializable interface.
The execution will happen either locally or remotely, depending on
configuration of GridLoadBalancingSpi and GridTopologySpi.
The typical Java example could be:
ExecutorService exec = grid.newGridExecutorService(); Future<String> future = exec.submit(new MyCallable()); ... String res = future.get();
newGridExecutorService in interface Gridpublic boolean 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.
pingNode in interface GridnodeId - ID of a node to ping.
GridDiscoverySpi
public List<GridEvent> queryEvents(GridEventFilter filter,
Collection<GridNode> nodes,
long timeout)
throws GridException
Starting with version 2.1 peer-class-loading is enabled for event filters. You can simply call this method and your event filter will be automatically loaded and executed on all remote nodes. You no longer need to manually add it to the class path on all remote nodes.
queryEvents in interface GridGridException - If query failed to execute.filter - Filter used to query events on remote nodes (must implement Serializable.nodes - Nodes to query.timeout - Maximum time to wait for result, 0 to wait forever.
public List<GridEvent> queryLocalEvents(GridEventFilter filter)
queryLocalEvents in interface Gridfilter - Filter used to query events on remote nodes.
public boolean removeDiscoveryListener(GridDiscoveryListener listener)
removeDiscoveryListener in interface Gridlistener - Discovery event listener to remove.
public boolean removeLocalEventListener(GridLocalEventListener listener)
removeLocalEventListener in interface Gridlistener - Local event listener to remove.
public boolean removeMessageListener(GridMessageListener listener)
removeMessageListener in interface Gridlistener - Message listener to remove.
Grid.addMessageListener(GridMessageListener)
public void sendMessage(GridNode node,
Serializable msg)
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 Grid.addMessageListener(GridMessageListener)
method.
sendMessage in interface GridGridException - If failed to send a message to remote node.node - Node to send a message to.msg - Message to send.GridCommunicationSpi,
Grid.addMessageListener(GridMessageListener),
Grid.removeMessageListener(GridMessageListener)
public void sendMessage(Collection<GridNode> nodes,
Serializable msg)
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 Grid.addMessageListener(GridMessageListener)
method.
sendMessage in interface GridGridException - 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.GridCommunicationSpi,
Grid.addMessageListener(GridMessageListener),
Grid.removeMessageListener(GridMessageListener)
public void undeployTask(String taskName)
throws GridException
Note that GridGain maintains internal versions for grid tasks in case of redeployment. This method will attempt to undeploy all versions on the grid task with given name.
undeployTask in interface GridGridException - Thrown if undeploy failed.taskName - Name of the task to undeploy. If task class has GridTaskName annotation,
then task was deployed under a name specified within annotation. Otherwise, full
class name should be used as task's name.
public void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeanException
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanException
public void setApplicationContext(org.springframework.context.ApplicationContext ctx)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansException
|
GridGain 2.1.0
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.1.0.19122008
2005-2008 Copyright © GridGain Systems. All Rights Reserved. |
|
|