The Encog Project

org.encog.util.concurrency.job
Class ConcurrentJob

java.lang.Object
  extended by org.encog.util.concurrency.job.ConcurrentJob
Direct Known Subclasses:
PruneIncremental

public abstract class ConcurrentJob
extends java.lang.Object

This class forms the basis for a job that can be run concurrently.


Constructor Summary
ConcurrentJob(StatusReportable report)
          Construct a concurrent job.
 
Method Summary
abstract  int loadWorkload()
          Load the subtasks.
abstract  void performJobUnit(JobUnitContext context)
          Perform one job unit.
 void process()
          Process the job.
 void reportStatus(JobUnitContext context, java.lang.String status)
          Report the status for this job.
abstract  java.lang.Object requestNextTask()
          Request the next task to be processed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentJob

public ConcurrentJob(StatusReportable report)
Construct a concurrent job.

Parameters:
report - The object to report status to.
Method Detail

loadWorkload

public abstract int loadWorkload()
Load the subtasks.

Returns:
The total number of subtasks.

performJobUnit

public abstract void performJobUnit(JobUnitContext context)
Perform one job unit.

Parameters:
context - The context for the job unit.

process

public void process()
Process the job.


reportStatus

public void reportStatus(JobUnitContext context,
                         java.lang.String status)
Report the status for this job.

Parameters:
context - The job context.
status - The status to report.

requestNextTask

public abstract java.lang.Object requestNextTask()
Request the next task to be processed.

Returns:
The next task to be processed.

The Encog Project