|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IOneTimeScheduler
An scheduler, which is based on an Executor
and executes
one-time tasks.
Method Summary | ||
---|---|---|
IJobStatus |
cancelJob(UUID jobId,
boolean mayInterrupt)
Cancels the given job. |
|
List<UUID> |
getAllJobsIds()
|
|
IJobStatus |
getJobStatus(UUID jobId)
Query the job status, if the scheduled job implemented HasCallback ,
the returned status will be an instance of IJobStatusWithCallback . |
|
IJobStatus |
purgeResult(UUID jobId)
Purges the results of the given job. |
|
|
scheduleJob(Callable<V> callable)
Schedule the start of a job that returns a result. |
|
UUID |
scheduleJob(org.aopalliance.intercept.Joinpoint joinpoint)
Schedule the start of a job that returns a result. |
|
UUID |
scheduleJob(Runnable runnable)
Schedule the start of a job that returns no result. |
|
IJobStatus |
waitForFinish(UUID jobId)
Waits until the given job has finished. |
|
IJobStatus |
waitForFinish(UUID jobId,
long timeoutMillis)
Waits until the given job has finished, but no longer than the given timeout. |
Method Detail |
---|
UUID scheduleJob(Runnable runnable)
Schedule the start of a job that returns no result.
The passed instance may implement ITimedJob
in
which case, the job is called repeatedly according to the
results of ITimedJob.getNextExecutionDelay()
.
If runnable
moreover implements HasCallback
,
the job status will be IJobStatusWithCallback
instance,
which bears additional application-specific information.
runnable
- Teh runnbel to schedule.
<V> UUID scheduleJob(Callable<V> callable)
Schedule the start of a job that returns a result.
The passed instance may implement ITimedJob
in
which case, the job is called repeatedly according to the
results of ITimedJob.getNextExecutionDelay()
.
If callable
moreover implements HasCallback
,
the job status will be IJobStatusWithCallback
instance,
which bears additional application-specific information.
callable
- The callable to be scheduled.
UUID scheduleJob(org.aopalliance.intercept.Joinpoint joinpoint)
Schedule the start of a job that returns a result.
This method exists in order to schedule AOP instances like
ReflectiveMethodInvocation
. If you have the choice,
please implement Callable
in favor of Joinpoint
,
because this avoids an internal indirection layer.
The passed instance may implement ITimedJob
in
which case, the job is called repeatedly according to the
results of ITimedJob.getNextExecutionDelay()
.
If joinpoint
moreover implements HasCallback
,
the job status will be IJobStatusWithCallback
instance,
which bears additional application-specific information.
runnable
- The joinpoint to schedule.
List<UUID> getAllJobsIds()
IJobStatus getJobStatus(UUID jobId)
HasCallback
,
the returned status will be an instance of IJobStatusWithCallback
.
jobId
- The ID of the job as returned by scheduleJob(Callable)
or scheduleJob(Runnable)
.
null
if no such job status exists (e.g.
because the job has completed and was already garbage collected, or
because the scheduler was shut down)IJobStatus waitForFinish(UUID jobId) throws InterruptedException, ExecutionException
null
if no such job exists, e.g. because the scheduler does no
longer run.
jobId
- job id
null
if no such job status exists
InterruptedException
ExecutionException
IJobStatus waitForFinish(UUID jobId, long timeoutMillis) throws InterruptedException, ExecutionException, TimeoutException
null
if no such job exists,
e.g. because the scheduler does no longer run.
jobId
- job idtimeoutMillis
- timeout
null
if no such job status exists
InterruptedException
ExecutionException
TimeoutException
IJobStatus cancelJob(UUID jobId, boolean mayInterrupt)
null
if no such job exists,
e.g. because the scheduler does no longer run.
jobId
- job idmayInterrupt
- true
if and only if the job is allowed to be interrupted
null
if no such job status existsIJobStatus purgeResult(UUID jobId)
jobId
- job id
null
if no such job status exists
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |