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 boolean
cancelJob(IJob job)
Cancels the execution of a jobboolean
cancelJob(IJobStatus jobStatus)
Cancels the execution of a jobboolean
dismissJob(IJob job)
removes a finished job from the list of statusesboolean
dismissJob(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 statusesIJob
getJob(IJobStatus jobStatus)
Gets the job from a job statusIJobStatus
getJobStatus(IJob job)
Gets the job status for a specific jobjava.util.List<IJob>
getWaitingJobs()
Returns a list of queued jobsvoid
invokeWork(java.util.concurrent.ForkJoinTask topAction, Priority priority)
Blocking execution of the work, returns when work is completevoid
shutdown()
shutsdown the executorboolean
submitJob(IJob job)
submits a job to this executorvoid
submitWork(PriorityWorkTask work)
Non-blocking, submit the task to the work executor
-
-
-
Method Detail
-
getAllJobStatuses
public java.util.List<IJobStatus> getAllJobStatuses()
Description copied from interface:IExecutor
Returns a list of all active, queued or recently finished job statuses- Specified by:
getAllJobStatuses
in interfaceIExecutor
- Returns:
- list of statuses
-
getJob
public IJob getJob(IJobStatus jobStatus)
Description copied from interface:IExecutor
Gets the job from a job status
-
getJobStatus
public IJobStatus getJobStatus(IJob job)
Description copied from interface:IExecutor
Gets the job status for a specific job- Specified by:
getJobStatus
in interfaceIExecutor
- Parameters:
job
- job to get status of- Returns:
- status
-
getWaitingJobs
public java.util.List<IJob> getWaitingJobs()
Description copied from interface:IExecutor
Returns a list of queued jobs- Specified by:
getWaitingJobs
in interfaceIExecutor
- Returns:
- list of jobs
-
invokeWork
public void invokeWork(java.util.concurrent.ForkJoinTask topAction, Priority priority)
Description copied from interface:IPriorityWorkSchedulerWrapper
Blocking execution of the work, returns when work is complete- Specified by:
invokeWork
in interfaceIPriorityWorkSchedulerWrapper
- Parameters:
topAction
- top level recursive action to forkpriority
- work priority level
-
shutdown
public void shutdown()
Description copied from interface:IExecutor
shutsdown the executor
-
submitJob
public boolean submitJob(IJob job)
Description copied from interface:IExecutor
submits a job to this executor
-
dismissJob
public boolean dismissJob(IJobStatus jobStatus)
Description copied from interface:IExecutor
removes a finished job from the list of statuses- Specified by:
dismissJob
in interfaceIExecutor
- Parameters:
jobStatus
- status of finished job to remove from list- Returns:
- successful
-
dismissJob
public boolean dismissJob(IJob job)
Description copied from interface:IExecutor
removes a finished job from the list of statuses- Specified by:
dismissJob
in interfaceIExecutor
- Parameters:
job
- job instance of finished job to remove from list- Returns:
- successful
-
cancelJob
public boolean cancelJob(IJobStatus jobStatus)
Description copied from interface:IExecutor
Cancels the execution of a job
-
cancelJob
public boolean cancelJob(IJob job)
Description copied from interface:IExecutor
Cancels the execution of a job
-
submitWork
public void submitWork(PriorityWorkTask work)
Description copied from interface:IPriorityWorkSchedulerWrapper
Non-blocking, submit the task to the work executor- Specified by:
submitWork
in interfaceIPriorityWorkSchedulerWrapper
- Parameters:
work
- task object to execute
-
-