Package org.drools.core.time
Interface TimerService
- All Superinterfaces:
SchedulerService
- All Known Implementing Classes:
JDKTimerService,PseudoClockScheduler
An interface for all timer service implementations used in a drools session.
-
Method Summary
Modifier and TypeMethodDescriptionlongReturns the current time from the scheduler clockgetTimerJobInstances(long id) This method may return null for some TimerService implementations that do not want the overhead of maintain this.longReturns the number of time units (usually ms) to the next scheduled jobvoidreset()Reset this servicevoidsetTimerJobFactoryManager(TimerJobFactoryManager timerJobFactoryManager) voidshutdown()Shuts the service downMethods inherited from interface org.drools.core.time.SchedulerService
removeJob, scheduleJob
-
Method Details
-
getCurrentTime
long getCurrentTime()Returns the current time from the scheduler clock- Returns:
- the current timestamp
-
reset
void reset()Reset this service -
shutdown
void shutdown()Shuts the service down -
getTimeToNextJob
long getTimeToNextJob()Returns the number of time units (usually ms) to the next scheduled job- Returns:
- the number of time units until the next scheduled job or -1 if there is no job scheduled
-
getTimerJobInstances
This method may return null for some TimerService implementations that do not want the overhead of maintain this.- Returns:
-
setTimerJobFactoryManager
-
getTimerJobFactoryManager
TimerJobFactoryManager getTimerJobFactoryManager()
-