Package com.espertech.esper.schedule

Examples of com.espertech.esper.schedule.ScheduleSlot


        EPServiceProviderSPI spi = (EPServiceProviderSPI)epService;
        StatementMetricHandle metricsHandle = spi.getMetricReportingService().getStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter");
        EPStatementHandle stmtHandle = new EPStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter", null, "AbstractCoordinatedAdapter", false, metricsHandle, 0, false);
        EPStatementAgentInstanceHandle agentInstanceHandle = new EPStatementAgentInstanceHandle(stmtHandle, new StatementAgentInstanceRWLockImpl("CSV", false), null, new StatementAgentInstanceFilterVersion());
        EPStatementHandleCallback scheduleCSVHandle = new EPStatementHandleCallback(agentInstanceHandle, nextScheduleCallback);
        ScheduleSlot nextScheduleSlot;

    if(eventsToSend.isEmpty())
    {
            if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()))
            {
          log.debug(".scheduleNextCallback no events to send, scheduling callback in 100 ms");
            }
            nextScheduleSlot = new ScheduleSlot(0,0);
      schedulingService.add(100, scheduleCSVHandle, nextScheduleSlot);
    }
    else
    {
            // Offset is not a function of the currentTime alone.
View Full Code Here


                                                         int nestingLevel,
                                                         int pathId,
                                                         int subpathId) {
        if (endpoint instanceof ContextDetailConditionCrontab) {
            ContextDetailConditionCrontab crontab = (ContextDetailConditionCrontab) endpoint;
            ScheduleSlot scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
            return new ContextControllerConditionCrontab(agentInstanceContext.getStatementContext(), scheduleSlot, crontab, callback, filterAddendum);
        }
        else if (endpoint instanceof ContextDetailConditionFilter) {
            ContextDetailConditionFilter filter = (ContextDetailConditionFilter) endpoint;
            return new ContextControllerConditionFilter(servicesContext, agentInstanceContext, filter, callback, filterAddendum);
        }
        else if (endpoint instanceof ContextDetailConditionPattern) {
            ContextStatePathKey key = new ContextStatePathKey(nestingLevel, pathId, subpathId);
            ContextDetailConditionPattern pattern = (ContextDetailConditionPattern) endpoint;
            return new ContextControllerConditionPattern(servicesContext, agentInstanceContext, pattern, callback, filterAddendum, isStartEndpoint, key);
        }
        else if (endpoint instanceof ContextDetailConditionTimePeriod) {
            ContextDetailConditionTimePeriod timePeriod = (ContextDetailConditionTimePeriod) endpoint;
            ScheduleSlot scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
            return new ContextControllerConditionTimePeriod(contextName, agentInstanceContext, scheduleSlot, timePeriod, callback, filterAddendum);
        }
        throw new IllegalStateException("Unrecognized context range endpoint " + endpoint.getClass());
    }
View Full Code Here

            AgentInstance result = startAgentInstance(statement, agentInstanceId, scheduleAndContext.getContextEvent());
            instanceList.add(result);

            // schedule a termination callback unless it is already scheduled
            if (scheduleAndContext.getContextScheduleCallbackHandle() == null) {
                ScheduleSlot scheduleSlot = createContextContext.getStatementContext().getScheduleBucket().allocateSlot();
                long timeOffset = servicesContext.getSchedulingService().getTime() - scheduleAndContext.getStartTime();
                EPStatementHandleCallback callback = scheduleCallback(agentInstanceId, scheduleSlot, timeOffset);
                scheduleAndContext.setContextScheduleCallbackHandle(callback, scheduleSlot);
            }
        }
View Full Code Here

        // save state if required
        contextStateService.addContext(contextName, agentInstanceId, scheduleAndContext, contextStateServiceBinding);

        // schedule callback, save for removal
        ScheduleSlot scheduleSlot = createContextContext.getStatementContext().getScheduleBucket().allocateSlot();
        EPStatementHandleCallback scheduleHandle = scheduleCallback(agentInstanceId, scheduleSlot, 0);
        scheduleAndContext.setContextScheduleCallbackHandle(scheduleHandle, scheduleSlot);

        // for all current statements, start an instance
        for (ContextManagedStatementBase statement : statements.values()) {
View Full Code Here

  {
    ScheduleHandleCallback nextScheduleCallback = new ScheduleHandleCallback() { public void scheduledTrigger(ExtensionServicesContext extensionServicesContext) { continueSendingEvents(); } };
        EPServiceProviderSPI spi = (EPServiceProviderSPI)epService;
        StatementMetricHandle metricsHandle = spi.getMetricReportingService().getStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter");
        EPStatementHandleCallback scheduleCSVHandle = new EPStatementHandleCallback(new EPStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter", null, new StatementRWLockImpl("CSV", false), "AbstractCoordinatedAdapter", false, metricsHandle, 0, false, new StatementFilterVersion()), nextScheduleCallback);
        ScheduleSlot nextScheduleSlot;

    if(eventsToSend.isEmpty())
    {
            if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()))
            {
          log.debug(".scheduleNextCallback no events to send, scheduling callback in 100 ms");
            }
            nextScheduleSlot = new ScheduleSlot(0,0);
      schedulingService.add(100, scheduleCSVHandle, nextScheduleSlot);
    }
    else
    {
            // Offset is not a function of the currentTime alone.
View Full Code Here

public class ContextControllerConditionFactory {

    public static ContextControllerCondition getEndpoint(String contextName, EPServicesContext servicesContext, AgentInstanceContext agentInstanceContext, ContextDetailCondition endpoint, ContextControllerConditionCallback callback) {
        if (endpoint instanceof ContextDetailConditionCrontab) {
            ContextDetailConditionCrontab crontab = (ContextDetailConditionCrontab) endpoint;
            ScheduleSlot scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
            return new ContextControllerConditionCrontab(agentInstanceContext.getStatementContext(), scheduleSlot, crontab, callback);
        }
        else if (endpoint instanceof ContextDetailConditionFilter) {
            ContextDetailConditionFilter filter = (ContextDetailConditionFilter) endpoint;
            return new ContextControllerConditionFilter(servicesContext, agentInstanceContext, filter, callback);
        }
        else if (endpoint instanceof ContextDetailConditionPattern) {
            ContextDetailConditionPattern pattern = (ContextDetailConditionPattern) endpoint;
            return new ContextControllerConditionPattern(servicesContext, agentInstanceContext, pattern, callback);
        }
        else if (endpoint instanceof ContextDetailConditionTimePeriod) {
            ContextDetailConditionTimePeriod timePeriond = (ContextDetailConditionTimePeriod) endpoint;
            ScheduleSlot scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
            return new ContextControllerConditionTimePeriod(contextName, agentInstanceContext, scheduleSlot, timePeriond, callback);
        }
        throw new IllegalStateException("Unrecognized context range endpoint " + endpoint.getClass());
    }
View Full Code Here

        EPServiceProviderSPI spi = (EPServiceProviderSPI)epService;
        StatementMetricHandle metricsHandle = spi.getMetricReportingService().getStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter");
        EPStatementHandle stmtHandle = new EPStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter", null, "AbstractCoordinatedAdapter", false, metricsHandle, 0, false);
        EPStatementAgentInstanceHandle agentInstanceHandle = new EPStatementAgentInstanceHandle(stmtHandle, new StatementAgentInstanceRWLockImpl(false), -1, new StatementAgentInstanceFilterVersion());
        EPStatementHandleCallback scheduleCSVHandle = new EPStatementHandleCallback(agentInstanceHandle, nextScheduleCallback);
        ScheduleSlot nextScheduleSlot;

    if(eventsToSend.isEmpty())
    {
            if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()))
            {
          log.debug(".scheduleNextCallback no events to send, scheduling callback in 100 ms");
            }
            nextScheduleSlot = new ScheduleSlot(0,0);
      schedulingService.add(100, scheduleCSVHandle, nextScheduleSlot);
    }
    else
    {
            // Offset is not a function of the currentTime alone.
View Full Code Here

public class ContextControllerConditionFactory {

    public static ContextControllerCondition getEndpoint(String contextName, EPServicesContext servicesContext, AgentInstanceContext agentInstanceContext, ContextDetailCondition endpoint, ContextControllerConditionCallback callback, ContextInternalFilterAddendum filterAddendum, boolean isStartEndpoint, int subPathId) {
        if (endpoint instanceof ContextDetailConditionCrontab) {
            ContextDetailConditionCrontab crontab = (ContextDetailConditionCrontab) endpoint;
            ScheduleSlot scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
            return new ContextControllerConditionCrontab(agentInstanceContext.getStatementContext(), scheduleSlot, crontab, callback, filterAddendum);
        }
        else if (endpoint instanceof ContextDetailConditionFilter) {
            ContextDetailConditionFilter filter = (ContextDetailConditionFilter) endpoint;
            return new ContextControllerConditionFilter(servicesContext, agentInstanceContext, filter, callback, filterAddendum);
        }
        else if (endpoint instanceof ContextDetailConditionPattern) {
            ContextDetailConditionPattern pattern = (ContextDetailConditionPattern) endpoint;
            return new ContextControllerConditionPattern(servicesContext, agentInstanceContext, pattern, callback, filterAddendum, isStartEndpoint, subPathId);
        }
        else if (endpoint instanceof ContextDetailConditionTimePeriod) {
            ContextDetailConditionTimePeriod timePeriond = (ContextDetailConditionTimePeriod) endpoint;
            ScheduleSlot scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
            return new ContextControllerConditionTimePeriod(contextName, agentInstanceContext, scheduleSlot, timePeriond, callback, filterAddendum);
        }
        throw new IllegalStateException("Unrecognized context range endpoint " + endpoint.getClass());
    }
View Full Code Here

        EPServiceProviderSPI spi = (EPServiceProviderSPI)epService;
        StatementMetricHandle metricsHandle = spi.getMetricReportingService().getStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter");
        EPStatementHandle stmtHandle = new EPStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter", null, "AbstractCoordinatedAdapter", false, metricsHandle, 0, false);
        EPStatementAgentInstanceHandle agentInstanceHandle = new EPStatementAgentInstanceHandle(stmtHandle, new StatementAgentInstanceRWLockImpl("CSV", false), -1, new StatementAgentInstanceFilterVersion());
        EPStatementHandleCallback scheduleCSVHandle = new EPStatementHandleCallback(agentInstanceHandle, nextScheduleCallback);
        ScheduleSlot nextScheduleSlot;

    if(eventsToSend.isEmpty())
    {
            if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()))
            {
          log.debug(".scheduleNextCallback no events to send, scheduling callback in 100 ms");
            }
            nextScheduleSlot = new ScheduleSlot(0,0);
      schedulingService.add(100, scheduleCSVHandle, nextScheduleSlot);
    }
    else
    {
            // Offset is not a function of the currentTime alone.
View Full Code Here

        EPServiceProviderSPI spi = (EPServiceProviderSPI)epService;
        StatementMetricHandle metricsHandle = spi.getMetricReportingService().getStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter");
        EPStatementHandle stmtHandle = new EPStatementHandle("AbstractCoordinatedAdapter", "AbstractCoordinatedAdapter", null, "AbstractCoordinatedAdapter", false, metricsHandle, 0, false);
        EPStatementAgentInstanceHandle agentInstanceHandle = new EPStatementAgentInstanceHandle(stmtHandle, new StatementAgentInstanceRWLockImpl("CSV", false), -1, new StatementAgentInstanceFilterVersion());
        EPStatementHandleCallback scheduleCSVHandle = new EPStatementHandleCallback(agentInstanceHandle, nextScheduleCallback);
        ScheduleSlot nextScheduleSlot;

    if(eventsToSend.isEmpty())
    {
            if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()))
            {
          log.debug(".scheduleNextCallback no events to send, scheduling callback in 100 ms");
            }
            nextScheduleSlot = new ScheduleSlot(0,0);
      schedulingService.add(100, scheduleCSVHandle, nextScheduleSlot);
    }
    else
    {
            // Offset is not a function of the currentTime alone.
View Full Code Here

TOP

Related Classes of com.espertech.esper.schedule.ScheduleSlot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.