org.encog.engine.concurrency.job
Class ConcurrentJob

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

public abstract class ConcurrentJob
extends 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
 boolean getShouldStop()
           
abstract  int loadWorkload()
          Load the subtasks.
abstract  void performJobUnit(JobUnitContext context)
          Perform one job unit.
 void process()
          Process the job.
 void reportStatus(JobUnitContext context, String status)
          Report the status for this job.
abstract  Object requestNextTask()
          Request the next task to be processed.
 void stop()
          Request the process to stop.
 
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,
                         String status)
Report the status for this job.

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

requestNextTask

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

Returns:
The next task to be processed.

getShouldStop

public boolean getShouldStop()
Returns:
True if the process should stop.

stop

public void stop()
Request the process to stop.



Copyright © 2011. All Rights Reserved.