public final class LocalRunner extends java.lang.Object implements SyncExecutor
Modifier and Type | Field and Description |
---|---|
private ConfiguredExecutable<?> |
executable |
private java.util.concurrent.ExecutorService |
executor |
private java.util.concurrent.Future<ConfiguredExecutable<?>> |
future |
private static org.apache.log4j.Logger |
log |
private java.lang.String |
workDirectory |
Constructor and Description |
---|
LocalRunner(ConfiguredExecutable<?> executable) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancelJob()
Stops running job.
|
boolean |
cleanup()
Clean up after the job
|
void |
executeJob()
Execute the job
|
(package private) java.util.concurrent.Future<ConfiguredExecutable<?>> |
getFuture() |
JobStatus |
getJobStatus()
Query the status of the job by its id.
|
java.lang.String |
getWorkDirectory() |
ConfiguredExecutable<?> |
waitForResult()
Call to this method block for as long as it is required for an executable to finish its job.
|
private static final org.apache.log4j.Logger log
private final java.util.concurrent.ExecutorService executor
private final ConfiguredExecutable<?> executable
private java.util.concurrent.Future<ConfiguredExecutable<?>> future
private final java.lang.String workDirectory
public LocalRunner(ConfiguredExecutable<?> executable)
public java.lang.String getWorkDirectory()
getWorkDirectory
in interface SyncExecutor
public boolean cancelJob()
SyncExecutor
cancelJob
in interface SyncExecutor
java.util.concurrent.Future<ConfiguredExecutable<?>> getFuture()
public JobStatus getJobStatus()
SyncExecutor
getJobStatus
in interface SyncExecutor
public void executeJob() throws JobSubmissionException
SyncExecutor
executeJob
in interface SyncExecutor
JobSubmissionException
- if submission failspublic ConfiguredExecutable<?> waitForResult() throws JobExecutionException
SyncExecutor
waitForResult
in interface SyncExecutor
java.util.concurrent.CancellationException
JobExecutionException
public boolean cleanup()
SyncExecutor
cleanup
in interface SyncExecutor