|
Drools :: Core 6.1.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.drools.core.time.impl.JDKTimerService
public class JDKTimerService
A default Scheduler implementation that uses the JDK built-in ScheduledThreadPoolExecutor as the scheduler and the system clock as the clock.
| Nested Class Summary | |
|---|---|
static class |
JDKTimerService.JDKJobHandle
|
| Field Summary | |
|---|---|
protected TimerJobFactoryManager |
jobFactoryManager
|
protected ScheduledThreadPoolExecutor |
scheduler
|
| Constructor Summary | |
|---|---|
JDKTimerService()
|
|
JDKTimerService(int size)
|
|
| Method Summary | |
|---|---|
long |
getCurrentTime()
Returns the current time from the scheduler clock |
TimerJobFactoryManager |
getTimerJobFactoryManager()
|
Collection<TimerJobInstance> |
getTimerJobInstances(int 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ScheduledThreadPoolExecutor scheduler
protected TimerJobFactoryManager jobFactoryManager
| Constructor Detail |
|---|
public JDKTimerService()
public JDKTimerService(int size)
| Method Detail |
|---|
public void setTimerJobFactoryManager(TimerJobFactoryManager timerJobFactoryManager)
setTimerJobFactoryManager in interface AcceptsTimerJobFactoryManagerpublic void setCounter(long counter)
public TimerJobFactoryManager getTimerJobFactoryManager()
getTimerJobFactoryManager in interface AcceptsTimerJobFactoryManagerpublic long getCurrentTime()
TimerService
getCurrentTime in interface TimerServicegetCurrentTime in interface org.kie.api.time.SessionClockpublic void shutdown()
TimerService
shutdown in interface TimerService
public JobHandle scheduleJob(Job job,
JobContext ctx,
Trigger trigger)
SchedulerService
scheduleJob in interface SchedulerServicepublic void internalSchedule(TimerJobInstance timerJobInstance)
internalSchedule in interface InternalSchedulerServicepublic boolean removeJob(JobHandle jobHandle)
SchedulerService
removeJob in interface SchedulerServicejobHandle - the job identity handle
public long getTimeToNextJob()
TimerService
getTimeToNextJob in interface TimerServicepublic Collection<TimerJobInstance> getTimerJobInstances(int id)
TimerService
getTimerJobInstances in interface TimerService
|
Drools :: Core 6.1.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||