|
||||||||||
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.
Nested Class Summary | |
---|---|
static class |
PseudoClockScheduler.ScheduledJob
An Scheduled Job class with all fields final to make it multi-thread safe. |
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()
|
long |
getTimeToNextJob()
Returns the number of time units (usually ms) to the next scheduled job |
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 |
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 Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public long getCurrentTime()
TimerService
getCurrentTime
in interface org.drools.time.SessionClock
getCurrentTime
in interface TimerService
org.drools.temporal.SessionClock#getCurrentTime()
public JobHandle scheduleJob(Job job, JobContext ctx, Trigger trigger)
SchedulerService
scheduleJob
in interface SchedulerService
SchedulerService.scheduleJob(org.drools.time.Job, org.drools.time.JobContext, org.drools.time.Trigger)
public boolean removeJob(JobHandle jobHandle)
SchedulerService
removeJob
in interface SchedulerService
jobHandle
- the job identity handle
SchedulerService.removeJob(org.drools.time.JobHandle)
public long advanceTime(long amount, TimeUnit unit)
SessionPseudoClock
advanceTime
in interface SessionPseudoClock
amount
- 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 TimerService
public long getTimeToNextJob()
TimerService
getTimeToNextJob
in interface TimerService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |