compbio.engine
Interface SyncExecutor

All Known Implementing Classes:
JobRunner, LocalRunner

public interface SyncExecutor

Synchronous executor, is an engine to run the Executable synchronously.

Author:
pvtroshin Date October 2009

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.
 

Method Detail

executeJob

void executeJob()
                throws JobSubmissionException
Execute the job

Throws:
JobSubmissionException - if submission fails

cleanup

boolean cleanup()
Clean up after the job

Returns:
true if all the files created by this job have been removed successfully, false otherwise

waitForResult

ConfiguredExecutable<?> waitForResult()
                                      throws JobExecutionException
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

Returns:
object from wich the result can be obtained
Throws:
JobExecutionException

getWorkDirectory

String getWorkDirectory()
Returns:
working directory if the task

cancelJob

boolean cancelJob()
Stops running job. Clean up is not performed.

Returns:
true if job was cancelled successfully, false otherwise

getJobStatus

JobStatus getJobStatus()
Query the status of the job by its id.

Returns:
- JobStatus