|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.drools.time.impl.PseudoClockScheduler
public class PseudoClockScheduler
A PseudoClockScheduler is a scheduler based on a user controlled clock that allows the user to explicitly control current time.
| Constructor Summary | |
|---|---|
PseudoClockScheduler()
|
|
PseudoClockScheduler(InternalWorkingMemory session)
|
|
| Method Summary | |
|---|---|
long |
advanceTime(long amount,
TimeUnit unit)
Advances the clock time in the specified unit amount. |
long |
getCurrentTime()
Returns the current time from the scheduler clock |
InternalWorkingMemory |
getSession()
|
TimerJobFactoryManager |
getTimerJobFactoryManager()
|
Collection<TimerJobInstance> |
getTimerJobInstances()
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)
|
void |
readExternal(ObjectInput in)
|
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 |
setSession(InternalWorkingMemory session)
|
void |
setStartupTime(long i)
|
void |
setTimerJobFactoryManager(TimerJobFactoryManager timerJobFactoryManager)
|
void |
shutdown()
Shuts the service down |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PseudoClockScheduler()
public PseudoClockScheduler(InternalWorkingMemory session)
| Method Detail |
|---|
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void setTimerJobFactoryManager(TimerJobFactoryManager timerJobFactoryManager)
setTimerJobFactoryManager in interface AcceptsTimerJobFactoryManagerpublic TimerJobFactoryManager getTimerJobFactoryManager()
getTimerJobFactoryManager in interface AcceptsTimerJobFactoryManagerpublic long getCurrentTime()
TimerService
getCurrentTime in interface org.drools.time.SessionClockgetCurrentTime in interface TimerServiceorg.drools.temporal.SessionClock#getCurrentTime()
public JobHandle scheduleJob(Job job,
JobContext ctx,
Trigger trigger)
SchedulerService
scheduleJob in interface SchedulerServiceSchedulerService.scheduleJob(org.drools.time.Job, org.drools.time.JobContext, org.drools.time.Trigger)public void internalSchedule(TimerJobInstance timerJobInstance)
internalSchedule in interface InternalSchedulerServicepublic boolean removeJob(JobHandle jobHandle)
SchedulerService
removeJob in interface SchedulerServicejobHandle - the job identity handle
SchedulerService.removeJob(org.drools.time.JobHandle)
public long advanceTime(long amount,
TimeUnit unit)
SessionPseudoClock
advanceTime in interface SessionPseudoClockamount - the amount of units to advance in the clockunit - the used time unit
public void setStartupTime(long i)
public InternalWorkingMemory getSession()
public void setSession(InternalWorkingMemory session)
session - the session to setpublic void shutdown()
shutdown in interface TimerServicepublic long getTimeToNextJob()
TimerService
getTimeToNextJob in interface TimerServicepublic Collection<TimerJobInstance> getTimerJobInstances()
TimerService
getTimerJobInstances in interface TimerService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||