public class GridComputeJobWrapper extends GridMetadataAwareAdapter implements GridComputeJob, Callable<Object>, GridPeerDeployAware
| Constructor and Description |
|---|
GridComputeJobWrapper(GridComputeJob job,
boolean cpMeta)
Creates a wrapper with given grid
job. |
| Modifier and Type | Method and Description |
|---|---|
Object |
call() |
void |
cancel()
This method is called when system detects that completion of this
job can no longer alter the overall outcome (for example, when parent task
has already reduced the results).
|
ClassLoader |
classLoader()
Gets class loader for the class.
|
Class<?> |
deployClass()
Gets top level user class being deployed.
|
Object |
execute()
Executes this job.
|
String |
toString() |
GridComputeJob |
wrappedJob()
Gets wrapped job.
|
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, readExternalMeta, removeMeta, removeMeta, replaceMeta, writeExternalMetapublic GridComputeJobWrapper(GridComputeJob job, boolean cpMeta)
job. If job implements GridMetadataAware
interface and copyMeta is true - the metadata information will be
copied from given job to this wrapper.job - Job to wrap.cpMeta - Whether or not to copy metadata in case when job
implements GridMetadataAware interface.public GridComputeJob wrappedJob()
public Class<?> deployClass()
deployClass in interface GridPeerDeployAwarepublic ClassLoader classLoader()
GridPeerDeployAware.deployClass() as well as all of its
dependencies.
Note that in most cases the class loader returned from this method
and the class loader for the class returned from GridPeerDeployAware.deployClass() method
will be the same. If they are not the same, it is required that the class loader
returned from this method still has to be able to load the deploy class and all its
dependencies.
classLoader in interface GridPeerDeployAwarepublic void cancel()
GridFuture.cancel() is called.
Note that job cancellation is only a hint, and just like with
Thread.interrupt() method, it is really up to the actual job
instance to gracefully finish execution and exit.
cancel in interface GridComputeJobpublic Object execute() throws GridException
execute in interface GridComputeJobnull). This result will be returned
in GridComputeJobResult.getData() method passed into
GridComputeTask.result(GridComputeJobResult, List) task method on caller node.GridException - If job execution caused an exception. This exception will be
returned in GridComputeJobResult.getException() method passed into
GridComputeTask.result(GridComputeJobResult, List) task method on caller node.
If execution produces a RuntimeException or Error, then
it will be wrapped into GridException.Copyright © 2014. All rights reserved.