Class SchedulingServiceImpl
java.lang.Object
com.espertech.esper.runtime.internal.schedulesvcimpl.SchedulingServiceImpl
- All Implemented Interfaces:
com.espertech.esper.common.internal.schedule.SchedulingService
,com.espertech.esper.common.internal.schedule.TimeProvider
,SchedulingServiceSPI
Implements the schedule service by simply keeping a sorted set of long millisecond
values and a set of handles for each.
Synchronized since statement creation and event evaluation by multiple (event send) threads can lead to callbacks added/removed asynchronously.
-
Field Summary
Fields inherited from interface com.espertech.esper.common.internal.schedule.TimeProvider
EPTYPE
-
Constructor Summary
ConstructorDescriptionSchedulingServiceImpl
(int stageId, com.espertech.esper.common.internal.schedule.TimeSourceService timeSourceService, ZoneId defaultFormatterTimeZone) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(long afterTime, com.espertech.esper.common.internal.schedule.ScheduleHandle handle, long slot) void
destroy()
final void
evaluate
(Collection<com.espertech.esper.common.internal.schedule.ScheduleHandle> handles) int
long
getTime()
int
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) final void
remove
(com.espertech.esper.common.internal.schedule.ScheduleHandle handle, long slot) final void
setTime
(long currentTime) void
transfer
(Set<Integer> statementIds, SchedulingServiceSPI schedulingService) void
visitSchedules
(ScheduleVisitor visitor)
-
Constructor Details
-
SchedulingServiceImpl
public SchedulingServiceImpl(int stageId, com.espertech.esper.common.internal.schedule.TimeSourceService timeSourceService, ZoneId defaultFormatterTimeZone) Constructor.- Parameters:
timeSourceService
- time source providerstageId
- stage id or -1 when not applicabledefaultFormatterTimeZone
- time zone for audit formatter
-
-
Method Details
-
destroy
public void destroy()- Specified by:
destroy
in interfacecom.espertech.esper.common.internal.schedule.SchedulingService
-
getTime
public long getTime()- Specified by:
getTime
in interfacecom.espertech.esper.common.internal.schedule.TimeProvider
-
setTime
public final void setTime(long currentTime) - Specified by:
setTime
in interfacecom.espertech.esper.common.internal.schedule.SchedulingService
-
add
public final void add(long afterTime, com.espertech.esper.common.internal.schedule.ScheduleHandle handle, long slot) throws com.espertech.esper.common.internal.schedule.ScheduleServiceException - Specified by:
add
in interfacecom.espertech.esper.common.internal.schedule.SchedulingService
- Throws:
com.espertech.esper.common.internal.schedule.ScheduleServiceException
-
remove
public final void remove(com.espertech.esper.common.internal.schedule.ScheduleHandle handle, long slot) - Specified by:
remove
in interfacecom.espertech.esper.common.internal.schedule.SchedulingService
-
evaluate
public final void evaluate(Collection<com.espertech.esper.common.internal.schedule.ScheduleHandle> handles) - Specified by:
evaluate
in interfacecom.espertech.esper.common.internal.schedule.SchedulingService
-
transfer
- Specified by:
transfer
in interfaceSchedulingServiceSPI
-
init
public void init()Description copied from interface:SchedulingServiceSPI
Initialization is optional and provides a chance to preload things after statements are available.- Specified by:
init
in interfaceSchedulingServiceSPI
-
getTimeHandleCount
public int getTimeHandleCount()- Specified by:
getTimeHandleCount
in interfacecom.espertech.esper.common.internal.schedule.SchedulingService
-
getFurthestTimeHandleDate
-
getNearestTimeHandleDate
-
getFurthestTimeHandle
- Specified by:
getFurthestTimeHandle
in interfacecom.espertech.esper.common.internal.schedule.SchedulingService
-
getScheduleHandleCount
public int getScheduleHandleCount()- Specified by:
getScheduleHandleCount
in interfacecom.espertech.esper.common.internal.schedule.SchedulingService
-
isScheduled
public boolean isScheduled(com.espertech.esper.common.internal.schedule.ScheduleHandle handle) - Specified by:
isScheduled
in interfacecom.espertech.esper.common.internal.schedule.SchedulingService
-
getNearestTimeHandle
- Specified by:
getNearestTimeHandle
in interfaceSchedulingServiceSPI
-
visitSchedules
- Specified by:
visitSchedules
in interfaceSchedulingServiceSPI
-
getDefaultFormatter
- Specified by:
getDefaultFormatter
in interfacecom.espertech.esper.common.internal.schedule.TimeProvider
-