Class BaseExecutor
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.engine.executor.BaseExecutor
-
- All Implemented Interfaces:
IExecutor,IPriorityWorkSchedulerWrapper
public class BaseExecutor extends java.lang.Object implements IExecutor, IPriorityWorkSchedulerWrapper
Basic executor implementation
-
-
Constructor Summary
Constructors Constructor Description BaseExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancelJob(IJob job)Cancels the execution of a jobbooleancancelJob(IJobStatus jobStatus)Cancels the execution of a jobbooleandismissJob(IJob job)removes a finished job from the list of statusesbooleandismissJob(IJobStatus jobStatus)removes a finished job from the list of statusesjava.util.List<IJobStatus>getAllJobStatuses()Returns a list of all active, queued or recently finished job statusesIJobgetJob(IJobStatus jobStatus)Gets the job from a job statusIJobStatusgetJobStatus(IJob job)Gets the job status for a specific jobjava.util.List<IJob>getWaitingJobs()Returns a list of queued jobsvoidinvokeWork(java.util.concurrent.ForkJoinTask topAction, Priority priority)Blocking execution of the work, returns when work is completevoidshutdown()shutsdown the executorbooleansubmitJob(IJob job)submits a job to this executorvoidsubmitWork(PriorityWorkTask work)Non-blocking, submit the task to the work executor
-
-
-
Method Detail
-
getAllJobStatuses
public java.util.List<IJobStatus> getAllJobStatuses()
Description copied from interface:IExecutorReturns a list of all active, queued or recently finished job statuses- Specified by:
getAllJobStatusesin interfaceIExecutor- Returns:
- list of statuses
-
getJob
public IJob getJob(IJobStatus jobStatus)
Description copied from interface:IExecutorGets the job from a job status
-
getJobStatus
public IJobStatus getJobStatus(IJob job)
Description copied from interface:IExecutorGets the job status for a specific job- Specified by:
getJobStatusin interfaceIExecutor- Parameters:
job- job to get status of- Returns:
- status
-
getWaitingJobs
public java.util.List<IJob> getWaitingJobs()
Description copied from interface:IExecutorReturns a list of queued jobs- Specified by:
getWaitingJobsin interfaceIExecutor- Returns:
- list of jobs
-
invokeWork
public void invokeWork(java.util.concurrent.ForkJoinTask topAction, Priority priority)Description copied from interface:IPriorityWorkSchedulerWrapperBlocking execution of the work, returns when work is complete- Specified by:
invokeWorkin interfaceIPriorityWorkSchedulerWrapper- Parameters:
topAction- top level recursive action to forkpriority- work priority level
-
shutdown
public void shutdown()
Description copied from interface:IExecutorshutsdown the executor
-
submitJob
public boolean submitJob(IJob job)
Description copied from interface:IExecutorsubmits a job to this executor
-
dismissJob
public boolean dismissJob(IJobStatus jobStatus)
Description copied from interface:IExecutorremoves a finished job from the list of statuses- Specified by:
dismissJobin interfaceIExecutor- Parameters:
jobStatus- status of finished job to remove from list- Returns:
- successful
-
dismissJob
public boolean dismissJob(IJob job)
Description copied from interface:IExecutorremoves a finished job from the list of statuses- Specified by:
dismissJobin interfaceIExecutor- Parameters:
job- job instance of finished job to remove from list- Returns:
- successful
-
cancelJob
public boolean cancelJob(IJobStatus jobStatus)
Description copied from interface:IExecutorCancels the execution of a job
-
cancelJob
public boolean cancelJob(IJob job)
Description copied from interface:IExecutorCancels the execution of a job
-
submitWork
public void submitWork(PriorityWorkTask work)
Description copied from interface:IPriorityWorkSchedulerWrapperNon-blocking, submit the task to the work executor- Specified by:
submitWorkin interfaceIPriorityWorkSchedulerWrapper- Parameters:
work- task object to execute
-
-