public final class SchedulingServiceImpl extends Object implements SchedulingServiceSPI
Synchronized since statement creation and event evaluation by multiple (event send) threads can lead to callbacks added/removed asynchronously.
Constructor and Description |
---|
SchedulingServiceImpl(com.espertech.esper.common.internal.schedule.TimeSourceService timeSourceService)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(long afterTime,
com.espertech.esper.common.internal.schedule.ScheduleHandle handle,
long slot) |
void |
apply(ScheduleSet scheduleSet)
Apply the set of schedules.
|
void |
destroy() |
void |
evaluate(Collection<com.espertech.esper.common.internal.schedule.ScheduleHandle> handles) |
Long |
getFurthestTimeHandle() |
String |
getFurthestTimeHandleDate() |
Long |
getNearestTimeHandle() |
String |
getNearestTimeHandleDate() |
int |
getScheduleHandleCount() |
long |
getTime() |
int |
getTimeHandleCount() |
void |
init()
Initialization is optional and provides a chance to preload things after statements are available.
|
boolean |
isScheduled(com.espertech.esper.common.internal.schedule.ScheduleHandle handle) |
void |
remove(com.espertech.esper.common.internal.schedule.ScheduleHandle handle,
long slot) |
void |
setTime(long currentTime) |
ScheduleSet |
take(Set<Integer> statementIds)
Take a statement's schedules out of the currently active set of schedules.
|
void |
visitSchedules(ScheduleVisitor visitor) |
public SchedulingServiceImpl(com.espertech.esper.common.internal.schedule.TimeSourceService timeSourceService)
timeSourceService
- time source providerpublic void destroy()
destroy
in interface com.espertech.esper.common.internal.schedule.SchedulingService
public long getTime()
getTime
in interface com.espertech.esper.common.internal.schedule.TimeProvider
public final void setTime(long currentTime)
setTime
in interface com.espertech.esper.common.internal.schedule.SchedulingService
public final void add(long afterTime, com.espertech.esper.common.internal.schedule.ScheduleHandle handle, long slot) throws com.espertech.esper.common.internal.schedule.ScheduleServiceException
add
in interface com.espertech.esper.common.internal.schedule.SchedulingService
com.espertech.esper.common.internal.schedule.ScheduleServiceException
public final void remove(com.espertech.esper.common.internal.schedule.ScheduleHandle handle, long slot)
remove
in interface com.espertech.esper.common.internal.schedule.SchedulingService
public final void evaluate(Collection<com.espertech.esper.common.internal.schedule.ScheduleHandle> handles)
evaluate
in interface com.espertech.esper.common.internal.schedule.SchedulingService
public ScheduleSet take(Set<Integer> statementIds)
SchedulingServiceSPI
take
in interface SchedulingServiceSPI
statementIds
- statements to take outpublic void apply(ScheduleSet scheduleSet)
SchedulingServiceSPI
apply
in interface SchedulingServiceSPI
scheduleSet
- to applypublic void init()
SchedulingServiceSPI
init
in interface SchedulingServiceSPI
public int getTimeHandleCount()
getTimeHandleCount
in interface com.espertech.esper.common.internal.schedule.SchedulingService
public String getFurthestTimeHandleDate()
public String getNearestTimeHandleDate()
public Long getFurthestTimeHandle()
getFurthestTimeHandle
in interface com.espertech.esper.common.internal.schedule.SchedulingService
public int getScheduleHandleCount()
getScheduleHandleCount
in interface com.espertech.esper.common.internal.schedule.SchedulingService
public boolean isScheduled(com.espertech.esper.common.internal.schedule.ScheduleHandle handle)
isScheduled
in interface com.espertech.esper.common.internal.schedule.SchedulingService
public Long getNearestTimeHandle()
getNearestTimeHandle
in interface SchedulingServiceSPI
public void visitSchedules(ScheduleVisitor visitor)
visitSchedules
in interface SchedulingServiceSPI
Copyright © 2005–2018. All rights reserved.