1 /* Copyright (c) 2009 Peter Troshin
\r
3 * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0
\r
5 * This library is free software; you can redistribute it and/or modify it under the terms of the
\r
6 * Apache License version 2 as published by the Apache Software Foundation
\r
8 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
\r
9 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache
\r
10 * License for more details.
\r
12 * A copy of the license is in apache_license.txt. It is also available here:
\r
13 * @see: http://www.apache.org/licenses/LICENSE-2.0.txt
\r
15 * Any republication or derived work distributed in source code form
\r
16 * must include this copyright and license notice.
\r
19 package compbio.engine;
\r
21 import compbio.engine.client.ConfiguredExecutable;
\r
22 import compbio.metadata.JobExecutionException;
\r
23 import compbio.metadata.JobStatus;
\r
24 import compbio.metadata.JobSubmissionException;
\r
27 * Synchronous executor, is an engine to run the Executable synchronously.
\r
32 public interface SyncExecutor {
\r
37 * @return String - job unique identifier
\r
38 * @throws JobSubmissionException
\r
39 * if submission fails
\r
41 void executeJob() throws JobSubmissionException;
\r
44 * Clean up after the job
\r
45 * @return true if all the files created by this job have been removed successfully, false otherwise
\r
52 * Call to this method block for as long as it is required for an executable to finish its job.
\r
53 * If the calculation has been completed already, the this method returns results immediately.
\r
54 * This could return the result directly, but that would be type unsafe
\r
56 * @return object from wich the result can be obtained
\r
57 * @throws JobExecutionException
\r
59 ConfiguredExecutable<?> waitForResult() throws JobExecutionException;
\r
63 * @return working directory if the task
\r
65 String getWorkDirectory();
\r
68 * Stops running job.
\r
69 * Clean up is not performed.
\r
71 * @return true if job was cancelled successfully, false otherwise
\r
73 boolean cancelJob();
\r
76 * Query the status of the job by its id.
\r
77 * @return - JobStatus
\r
79 JobStatus getJobStatus();
\r