public class JDKTimerService extends Object implements TimerService, org.kie.api.time.SessionClock, InternalSchedulerService
| Modifier and Type | Class and Description |
|---|---|
static class |
JDKTimerService.JDKJobHandle |
| Modifier and Type | Field and Description |
|---|---|
protected TimerJobFactoryManager |
jobFactoryManager |
protected ScheduledThreadPoolExecutor |
scheduler |
| Constructor and Description |
|---|
JDKTimerService() |
JDKTimerService(int size) |
| Modifier and Type | Method and Description |
|---|---|
long |
getCurrentTime()
Returns the current time from the scheduler clock
|
TimerJobFactoryManager |
getTimerJobFactoryManager() |
Collection<TimerJobInstance> |
getTimerJobInstances(long id)
This method may return null for some TimerService implementations that do not want the overhead of maintain this.
|
long |
getTimeToNextJob()
Returns the number of time units (usually ms) to
the next scheduled job
|
void |
internalSchedule(TimerJobInstance timerJobInstance) |
boolean |
removeJob(JobHandle jobHandle)
Remove the job identified by the given job handle from the
scheduled queue
|
JobHandle |
scheduleJob(Job job,
JobContext ctx,
Trigger trigger)
Schedule a job for later execution
|
void |
setCounter(long counter) |
void |
setTimerJobFactoryManager(TimerJobFactoryManager timerJobFactoryManager) |
void |
shutdown()
Shuts the service down
|
protected ScheduledThreadPoolExecutor scheduler
protected TimerJobFactoryManager jobFactoryManager
public JDKTimerService()
public JDKTimerService(int size)
public void setTimerJobFactoryManager(TimerJobFactoryManager timerJobFactoryManager)
setTimerJobFactoryManager in interface TimerServicepublic void setCounter(long counter)
public TimerJobFactoryManager getTimerJobFactoryManager()
getTimerJobFactoryManager in interface TimerServicepublic long getCurrentTime()
TimerServicegetCurrentTime in interface TimerServicegetCurrentTime in interface org.kie.api.time.SessionClockpublic void shutdown()
TimerServiceshutdown in interface TimerServicepublic JobHandle scheduleJob(Job job, JobContext ctx, Trigger trigger)
SchedulerServicescheduleJob in interface SchedulerServicepublic void internalSchedule(TimerJobInstance timerJobInstance)
internalSchedule in interface InternalSchedulerServicepublic boolean removeJob(JobHandle jobHandle)
SchedulerServiceremoveJob in interface SchedulerServicejobHandle - the job identity handlepublic long getTimeToNextJob()
TimerServicegetTimeToNextJob in interface TimerServicepublic Collection<TimerJobInstance> getTimerJobInstances(long id)
TimerServicegetTimerJobInstances in interface TimerServiceCopyright © 2001–2016 JBoss by Red Hat. All rights reserved.