ch.javasoft.job
Class ExecJobProcessor

java.lang.Object
  extended by ch.javasoft.job.AbstractJobProcessor<ExecJobMonitor,Void,ExecJob>
      extended by ch.javasoft.job.ExecJobProcessor
All Implemented Interfaces:
JobProcessor<ExecJobMonitor,Void,ExecJob>

public class ExecJobProcessor
extends AbstractJobProcessor<ExecJobMonitor,Void,ExecJob>

The ExecJobProcessor is specifically designed to execute ExecJobs.


Field Summary
static ExecJobProcessor INSTANCE
          Default instance
 
Constructor Summary
ExecJobProcessor()
           
 
Method Summary
 ExecJobMonitor exec(ExecJob job)
          Usually executes the given job and returns immediately, without waiting for completion, corresponding to Executable.exec().
 JobResult<Void> execAndWait(ExecJob job)
          Usually executes the given job and waits for completion, corresponding to Executable.execAndWait().
 
Methods inherited from class ch.javasoft.job.AbstractJobProcessor
addJobTerminatedHandler, execAndWaitThrowException, invokeTerminationExceptionHandlers, invokeTerminationHandlers, removeJobTerminatedHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final ExecJobProcessor INSTANCE
Default instance

Constructor Detail

ExecJobProcessor

public ExecJobProcessor()
Method Detail

exec

public ExecJobMonitor exec(ExecJob 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

execAndWait

public JobResult<Void> execAndWait(ExecJob job)
                            throws InterruptedException
Description copied from interface: JobProcessor
Usually executes the given job and waits for completion, corresponding to Executable.execAndWait(). Note that the exact behaviour is up to the implementor and might diverge from this general description.

Specified by:
execAndWait in interface JobProcessor<ExecJobMonitor,Void,ExecJob>
Overrides:
execAndWait in class AbstractJobProcessor<ExecJobMonitor,Void,ExecJob>
Parameters:
job - the job to execute
Returns:
the job result, giving access to the return value on success, or to the exception if execution caused any.
Throws:
InterruptedException