public final class JobExecutionWrapper extends Object implements ParallelizableJob
ParallelizableJob decorator that wraps exceptions thrown by
the inner ParallelizableJob in a
JobExecutionException.ParallelizableJob,
JobExecutionException,
Serialized Form| Constructor and Description |
|---|
JobExecutionWrapper(ParallelizableJob job)
Creates a new
JobExecutionWrapper. |
| Modifier and Type | Method and Description |
|---|---|
void |
finish()
Performs any final actions required for this
ParallelizableJob. |
Object |
getNextTask()
Gets the next task to be performed.
|
void |
initialize()
Sets up this
ParallelizableJob on the machine hosting the
job (not necessarily the same machine as the one processing the tasks
for this job). |
boolean |
isComplete()
Gets a value that indicates if this job is complete (i.e., if results
for all tasks have been submitted).
|
void |
restoreState(ObjectInput input)
Notifies the job that it is about to be resumed after having been
suspended.
|
void |
saveState(ObjectOutput output)
Notifies the job that it is about to be suspended (for example, if the
server application is about to be shut down).
|
void |
setHostService(HostService host)
Sets the
HostService object that provides secure access
to the file system on the machine hosting this
ParallelizableJob. |
void |
submitTaskResults(Object task,
Object results,
ca.eandb.util.progress.ProgressMonitor monitor)
Submits the results of a task.
|
TaskWorker |
worker()
Gets the task worker to use to process the tasks of this job.
|
public JobExecutionWrapper(ParallelizableJob job)
JobExecutionWrapper.job - The inner ParallelizableJob.public void setHostService(HostService host)
ParallelizableJobHostService object that provides secure access
to the file system on the machine hosting this
ParallelizableJob.setHostService in interface ParallelizableJobhost - The HostService to use.public void finish()
throws JobExecutionException
ParallelizableJobParallelizableJob.finish in interface ParallelizableJobJobExecutionExceptionpublic Object getNextTask() throws JobExecutionException
ParallelizableJobgetNextTask in interface ParallelizableJobObject describing the next task to be
performed, or null if there are no remaining
tasks.JobExecutionExceptionpublic void initialize()
throws JobExecutionException
ParallelizableJobParallelizableJob on the machine hosting the
job (not necessarily the same machine as the one processing the tasks
for this job).initialize in interface ParallelizableJobJobExecutionExceptionpublic void saveState(ObjectOutput output) throws JobExecutionException
ParallelizableJobsaveState in interface ParallelizableJoboutput - The ObjectOutput to save state to.JobExecutionExceptionpublic void restoreState(ObjectInput input) throws JobExecutionException
ParallelizableJobrestoreState in interface ParallelizableJobinput - The ObjectInput to restore state from.JobExecutionExceptionpublic boolean isComplete()
throws JobExecutionException
ParallelizableJobisComplete in interface ParallelizableJobJobExecutionExceptionpublic void submitTaskResults(Object task, Object results, ca.eandb.util.progress.ProgressMonitor monitor) throws JobExecutionException
ParallelizableJobsubmitTaskResults in interface ParallelizableJobtask - The Object describing the task for which
results are being submitted (must have been obtained from a
previous call to ParallelizableJob.getNextTask().results - The Object containing the results of
a task.monitor - The ProgressMonitor to update with the
progress of this Job.JobExecutionExceptionParallelizableJob.getNextTask()public TaskWorker worker() throws JobExecutionException
ParallelizableJobworker in interface ParallelizableJobJobExecutionExceptionCopyright © 2016. All rights reserved.