public class PseudoClockScheduler extends Object implements TimerService, SessionPseudoClock, Externalizable, InternalSchedulerService
| Constructor and Description |
|---|
PseudoClockScheduler() |
PseudoClockScheduler(InternalWorkingMemory session) |
| Modifier and Type | Method and Description |
|---|---|
long |
advanceTime(long amount,
TimeUnit unit) |
long |
getCurrentTime()
Returns the current time from the scheduler clock
|
InternalWorkingMemory |
getSession() |
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) |
void |
readExternal(ObjectInput in) |
boolean |
removeJob(JobHandle jobHandle)
Remove the job identified by the given job handle from the
scheduled queue
|
void |
reset()
Reset this service
|
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) |
public PseudoClockScheduler()
public PseudoClockScheduler(InternalWorkingMemory session)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void setTimerJobFactoryManager(TimerJobFactoryManager timerJobFactoryManager)
setTimerJobFactoryManager in interface TimerServicepublic TimerJobFactoryManager getTimerJobFactoryManager()
getTimerJobFactoryManager in interface TimerServicepublic long getCurrentTime()
TimerServicegetCurrentTime in interface TimerServicegetCurrentTime in interface org.kie.api.time.SessionClockSessionClock.getCurrentTime()public JobHandle scheduleJob(Job job, JobContext ctx, Trigger trigger)
SchedulerServicescheduleJob in interface SchedulerServiceSchedulerService.scheduleJob(Job, JobContext, Trigger)public void internalSchedule(TimerJobInstance timerJobInstance)
internalSchedule in interface InternalSchedulerServicepublic boolean removeJob(JobHandle jobHandle)
SchedulerServiceremoveJob in interface SchedulerServicejobHandle - the job identity handleSchedulerService.removeJob(JobHandle)public long advanceTime(long amount,
TimeUnit unit)
advanceTime in interface org.kie.api.time.SessionPseudoClockpublic void setStartupTime(long i)
public InternalWorkingMemory getSession()
public void setSession(InternalWorkingMemory session)
session - the session to setpublic void reset()
TimerServicereset in interface TimerServicepublic void shutdown()
TimerServiceshutdown in interface TimerServicepublic long getTimeToNextJob()
TimerServicegetTimeToNextJob in interface TimerServicepublic Collection<TimerJobInstance> getTimerJobInstances(long id)
TimerServicegetTimerJobInstances in interface TimerServiceCopyright © 2001–2019 JBoss by Red Hat. All rights reserved.