ch.javasoft.job
Class NewThreadJobProcessor<R>

java.lang.Object
  extended by ch.javasoft.job.AbstractJobProcessor<R,R,Job<? extends R>>
      extended by ch.javasoft.job.NewThreadJobProcessor<R>
Type Parameters:
R - The final result returned by the job after successful termination.
All Implemented Interfaces:
JobProcessor<R,R,Job<? extends R>>

public class NewThreadJobProcessor<R>
extends AbstractJobProcessor<R,R,Job<? extends R>>

The NewThreadJobProcessor executes jobs asynchroneously in a new thread.


Constructor Summary
NewThreadJobProcessor()
           
 
Method Summary
 JobMonitor<R> exec(Job<? extends R> job)
          Usually executes the given job and returns immediately, without waiting for completion, corresponding to Executable.exec().
 
Methods inherited from class ch.javasoft.job.AbstractJobProcessor
addJobTerminatedHandler, execAndWait, execAndWaitThrowException, invokeTerminationExceptionHandlers, invokeTerminationHandlers, removeJobTerminatedHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewThreadJobProcessor

public NewThreadJobProcessor()
Method Detail

exec

public JobMonitor<R> exec(Job<? extends R> job)
Description copied from interface: JobProcessor
Usually executes the given job and returns immediately, without waiting for completion, corresponding to Executable.exec(). Note that the exact behaviour is up to the implementor and might diverge from this general description.

Parameters:
job - the job to execute
Returns:
the job status, which also allows access to the result when execution completed