|
GridGain 2.0.3
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridgain.grid.GridJobAdapter<G>
org.gridgain.grid.spi.loadbalancing.affinity.GridAffinityJobAdapter<A,G>
A - Affinity key type.G - Job argument type.public abstract class GridAffinityJobAdapter<A extends Serializable,G extends Serializable>
Convenience adapter for GridAffinityJob interface that provides
default implementation of GridJob.cancel() method and allows
to add arguments.
Here is example of how job affinity adapter could be used:
public class MyGridAffinityJob extends GridAffinityJobAdapter<Integer, Serializable> {
public MyGridAffinityJob(Integer cacheKey) {
// Pass cache key as a job argument.
super(cacheKey);
}
public Serializable execute() throws GridException {
...
// Access data by the same key returned
// in 'getAffinityKey()' method.
mycache.get(getAffinityKey());
...
}
}
For more information and examples, see GridAffinityLoadBalancingSpi.
See Also:
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.0.3
![]() |
![]() |
| Constructor Summary | |
|---|---|
protected |
GridAffinityJobAdapter()
No-arg constructor. |
protected |
GridAffinityJobAdapter(A affKey)
Creates affinity job with a given key. |
protected |
GridAffinityJobAdapter(A affKey,
G... args)
Creates a fully initialized affinity job with a given key and specified job argument(s). |
| Method Summary | |
|---|---|
A |
getAffinityKey()
Gets affinity key for this job. |
void |
setAffinityKey(A affKey)
Sets affinity key. |
| Methods inherited from class org.gridgain.grid.GridJobAdapter |
|---|
addArgument, cancel, getAllArguments, getArgument, getArgument, isCancelled, setArgument |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.gridgain.grid.GridJob |
|---|
cancel, execute |
| Constructor Detail |
|---|
protected GridAffinityJobAdapter()
Note that job argument(s) and affinity key will be null. Please use
GridJobAdapter.setArgument(Serializable) to set job argument(s) and
GridAffinityJobAdapter.setAffinityKey(Serializable) to set affinity key.
protected GridAffinityJobAdapter(A affKey)
Note that job argument(s) and affinity key will be null. Please use
GridJobAdapter.setArgument(Serializable) to set job argument(s).
affKey - Affinity key.
protected GridAffinityJobAdapter(A affKey,
G... args)
affKey - Affinity key.args - Job arguments.| Method Detail |
|---|
public A getAffinityKey()
getAffinityKey in interface GridAffinityJob<A extends Serializable>public void setAffinityKey(A affKey)
affKey - Affinity key
|
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. |
|