compbio.engine.local
Class LocalRunner

java.lang.Object
  extended by compbio.engine.local.LocalRunner
All Implemented Interfaces:
SyncExecutor

public final class LocalRunner
extends Object
implements SyncExecutor


Constructor Summary
LocalRunner(ConfiguredExecutable<?> executable)
           
 
Method Summary
 boolean cancelJob()
          Stops running job.
 boolean cleanup()
          Clean up after the job
 void executeJob()
          Execute the job
 JobStatus getJobStatus()
          Query the status of the job by its id.
 String getWorkDirectory()
           
 ConfiguredExecutable<?> waitForResult()
          Call to this method block for as long as it is required for an executable to finish its job.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalRunner

public LocalRunner(ConfiguredExecutable<?> executable)
Method Detail

getWorkDirectory

public String getWorkDirectory()
Specified by:
getWorkDirectory in interface SyncExecutor
Returns:
working directory if the task

cancelJob

public boolean cancelJob()
Description copied from interface: SyncExecutor
Stops running job. Clean up is not performed.

Specified by:
cancelJob in interface SyncExecutor
Returns:
true if job was cancelled successfully, false otherwise

getJobStatus

public JobStatus getJobStatus()
Description copied from interface: SyncExecutor
Query the status of the job by its id.

Specified by:
getJobStatus in interface SyncExecutor
Returns:
- JobStatus

executeJob

public void executeJob()
                throws JobSubmissionException
Description copied from interface: SyncExecutor
Execute the job

Specified by:
executeJob in interface SyncExecutor
Throws:
JobSubmissionException - if submission fails

waitForResult

public ConfiguredExecutable<?> waitForResult()
                                      throws JobExecutionException
Description copied from interface: SyncExecutor
Call to this method block for as long as it is required for an executable to finish its job. If the calculation has been completed already, the this method returns results immediately. This could return the result directly, but that would be type unsafe

Specified by:
waitForResult in interface SyncExecutor
Returns:
object from wich the result can be obtained
Throws:
CancellationException
JobExecutionException

cleanup

public boolean cleanup()
Description copied from interface: SyncExecutor
Clean up after the job

Specified by:
cleanup in interface SyncExecutor
Returns:
true if all the files created by this job have been removed successfully, false otherwise