public static ContextControllerCondition GetEndpoint(String contextName,
                                                      EPServicesContext servicesContext,
                                                      AgentInstanceContext agentInstanceContext,
                                                      ContextDetailCondition endpoint,
                                                      ContextControllerConditionCallback callback,
                                                      ContextInternalFilterAddendum filterAddendum,
                                                      bool isStartEndpoint,
                                                      int nestingLevel,
                                                      int pathId,
                                                      int subpathId) {
     if (endpoint is ContextDetailConditionCrontab) {
         var crontab = (ContextDetailConditionCrontab) endpoint;
         var scheduleSlot = agentInstanceContext.StatementContext.ScheduleBucket.AllocateSlot();
         return new ContextControllerConditionCrontab(agentInstanceContext.StatementContext, scheduleSlot, crontab, callback, filterAddendum);
     }
     else if (endpoint is ContextDetailConditionFilter) {
         var filter = (ContextDetailConditionFilter) endpoint;
         return new ContextControllerConditionFilter(servicesContext, agentInstanceContext, filter, callback, filterAddendum);
     }
     else if (endpoint is ContextDetailConditionPattern) {
         var key = new ContextStatePathKey(nestingLevel, pathId, subpathId);
         var pattern = (ContextDetailConditionPattern) endpoint;
         return new ContextControllerConditionPattern(servicesContext, agentInstanceContext, pattern, callback, filterAddendum, isStartEndpoint, key);
     }
     else if (endpoint is ContextDetailConditionTimePeriod) {
         var timePeriod = (ContextDetailConditionTimePeriod) endpoint;
         var scheduleSlot = agentInstanceContext.StatementContext.ScheduleBucket.AllocateSlot();
         return new ContextControllerConditionTimePeriod(contextName, agentInstanceContext, scheduleSlot, timePeriod, callback, filterAddendum);
     }
     else if (endpoint is ContextDetailConditionImmediate) {
         return new ContextControllerConditionImmediate();
     }
     throw new IllegalStateException("Unrecognized context range endpoint " + endpoint.GetType());
 }
Exemple #2
0
        public static ContextControllerConditionNonHA GetEndpoint(
            IntSeqKey conditionPath,
            object[] partitionKeys,
            ContextConditionDescriptor endpoint,
            ContextControllerConditionCallback callback,
            ContextController controller,
            bool isStartEndpoint)
        {
            if (endpoint is ContextConditionDescriptorFilter) {
                ContextConditionDescriptorFilter filter = (ContextConditionDescriptorFilter) endpoint;
                return new ContextControllerConditionFilter(conditionPath, partitionKeys, filter, callback, controller);
            }

            if (endpoint is ContextConditionDescriptorTimePeriod) {
                ContextConditionDescriptorTimePeriod timePeriod = (ContextConditionDescriptorTimePeriod) endpoint;
                long scheduleSlot = controller.Realization.AgentInstanceContextCreate.ScheduleBucket.AllocateSlot();
                return new ContextControllerConditionTimePeriod(
                    scheduleSlot,
                    timePeriod,
                    conditionPath,
                    callback,
                    controller);
            }

            if (endpoint is ContextConditionDescriptorCrontab) {
                ContextConditionDescriptorCrontab crontab = (ContextConditionDescriptorCrontab) endpoint;
                ScheduleSpec schedule = ScheduleExpressionUtil.CrontabScheduleBuild(
                    crontab.Evaluators,
                    controller.Realization.AgentInstanceContextCreate);
                long scheduleSlot = controller.Realization.AgentInstanceContextCreate.ScheduleBucket.AllocateSlot();
                return new ContextControllerConditionCrontabImpl(
                    conditionPath,
                    scheduleSlot,
                    schedule,
                    crontab,
                    callback,
                    controller);
            }

            if (endpoint is ContextConditionDescriptorPattern) {
                ContextConditionDescriptorPattern pattern = (ContextConditionDescriptorPattern) endpoint;
                return new ContextControllerConditionPattern(
                    conditionPath,
                    partitionKeys,
                    pattern,
                    callback,
                    controller);
            }

            if (endpoint is ContextConditionDescriptorNever) {
                return ContextControllerConditionNever.INSTANCE;
            }

            if (endpoint is ContextConditionDescriptorImmediate) {
                return ContextControllerConditionImmediate.INSTANCE;
            }

            throw new IllegalStateException("Unrecognized context range endpoint " + endpoint.GetType());
        }
 public ContextControllerConditionCrontab(StatementContext statementContext, ScheduleSlot scheduleSlot, ContextDetailConditionCrontab spec, ContextControllerConditionCallback callback, ContextInternalFilterAddendum filterAddendum)
 {
     _statementContext = statementContext;
     _scheduleSlot     = scheduleSlot;
     _spec             = spec;
     _callback         = callback;
     _filterAddendum   = filterAddendum;
 }
Exemple #4
0
 public ContextControllerConditionFilter(EPServicesContext servicesContext, AgentInstanceContext agentInstanceContext, ContextDetailConditionFilter endpointFilterSpec, ContextControllerConditionCallback callback, ContextInternalFilterAddendum filterAddendum)
 {
     _servicesContext      = servicesContext;
     _agentInstanceContext = agentInstanceContext;
     _endpointFilterSpec   = endpointFilterSpec;
     _callback             = callback;
     _filterAddendum       = filterAddendum;
 }
 public ContextControllerConditionPattern(EPServicesContext servicesContext, AgentInstanceContext agentInstanceContext, ContextDetailConditionPattern endpointPatternSpec, ContextControllerConditionCallback callback, ContextInternalFilterAddendum filterAddendum, bool startEndpoint, ContextStatePathKey contextStatePathKey)
 {
     _servicesContext      = servicesContext;
     _agentInstanceContext = agentInstanceContext;
     _endpointPatternSpec  = endpointPatternSpec;
     _callback             = callback;
     _filterAddendum       = filterAddendum;
     _isStartEndpoint      = startEndpoint;
     _contextStatePathKey  = contextStatePathKey;
 }
Exemple #6
0
 public ContextControllerConditionPattern(
     IntSeqKey conditionPath,
     object[] partitionKeys,
     ContextConditionDescriptorPattern pattern,
     ContextControllerConditionCallback callback,
     ContextController controller)
 {
     this.conditionPath = conditionPath;
     this.partitionKeys = partitionKeys;
     this.pattern = pattern;
     this.callback = callback;
     this.controller = controller;
 }
Exemple #7
0
 public ContextControllerConditionFilter(
     IntSeqKey conditionPath,
     object[] partitionKeys,
     ContextConditionDescriptorFilter filter,
     ContextControllerConditionCallback callback,
     ContextController controller)
 {
     this.conditionPath = conditionPath;
     this.partitionKeys = partitionKeys;
     this.filter = filter;
     this.callback = callback;
     this.controller = controller;
 }
 public ContextControllerConditionTimePeriod(
     long scheduleSlot,
     ContextConditionDescriptorTimePeriod timePeriod,
     IntSeqKey conditionPath,
     ContextControllerConditionCallback callback,
     ContextController controller)
 {
     this.scheduleSlot = scheduleSlot;
     this.timePeriod = timePeriod;
     this.conditionPath = conditionPath;
     this.callback = callback;
     this.controller = controller;
 }
Exemple #9
0
 public ContextControllerConditionTimePeriod(
     String contextName,
     AgentInstanceContext agentInstanceContext,
     long scheduleSlot,
     ContextDetailConditionTimePeriod spec,
     ContextControllerConditionCallback callback,
     ContextInternalFilterAddendum filterAddendum)
 {
     _contextName          = contextName;
     _agentInstanceContext = agentInstanceContext;
     _scheduleSlot         = scheduleSlot;
     _spec           = spec;
     _callback       = callback;
     _filterAddendum = filterAddendum;
 }
Exemple #10
0
 public ContextControllerConditionCrontabImpl(
     IntSeqKey conditionPath,
     long scheduleSlot,
     ScheduleSpec scheduleSpec,
     ContextConditionDescriptorCrontab crontab,
     ContextControllerConditionCallback callback,
     ContextController controller)
 {
     this.conditionPath = conditionPath;
     this.scheduleSlot = scheduleSlot;
     Schedule = scheduleSpec;
     this.crontab = crontab;
     this.callback = callback;
     this.controller = controller;
 }