public void SetUp()
        {
            _container = SupportContainer.Reset();
            MetricReportingPath.IsMetricsEnabled = false;

            _listenerOne = new SupportUpdateListener();
            _listenerTwo = new SupportUpdateListener();
    
            var listenerSet = new EPStatementListenerSet();
            listenerSet.Events.Add(_listenerOne.Update);
            listenerSet.Events.Add(_listenerTwo.Update);
    
            _dispatchService = new DispatchServiceImpl(
                _container.ThreadLocalManager());

            _statementResultService = new StatementResultServiceImpl(
                "name", null, null,
                new ThreadingServiceImpl(new ConfigurationEngineDefaults.ThreadingConfig()),
                _container.ThreadLocalManager());
            _statementResultService.SetUpdateListeners(listenerSet, false);
            _statementResultService.SetSelectClause(
                new Type[1], new String[1], false, 
                new ExprEvaluator[1], new SupportExprEvaluatorContext(_container, null));
            _statementResultService.SetContext(new SupportEPStatementSPI(), null, false, false, false, false, null);

            _updateDispatchView = new UpdateDispatchViewBlockingWait(
                _statementResultService, _dispatchService, 1000, _container.ThreadLocalManager());
        }
        public void SetUpdateListeners(
            EPStatementListenerSet listenerSet,
            bool isRecovery)
        {
            // indicate that listeners were updated for potential persistence of listener set, once the statement context is known
            if (_epStatement != null) {
                if (!isRecovery) {
                    var stmtCtx = _epStatement.StatementContext;
                    _epServicesContext.EpServicesHA.ListenerRecoveryService.Put(
                        stmtCtx.StatementId, 
                        stmtCtx.StatementName, 
                        listenerSet.Listeners);
                }
            }

            StatementListenerSet = listenerSet;

            IsMakeNatural = StatementListenerSet.Subscriber != null;
            IsMakeSynthetic = StatementListenerSet.Listeners.Length != 0 
                              || _statementInformationals.IsAlwaysSynthesizeOutputEvents;

            if (StatementListenerSet.Subscriber == null) {
                _statementResultNaturalStrategy = null;
                IsMakeNatural = false;
                return;
            }

            try {
                _statementResultNaturalStrategy = ResultDeliveryStrategyFactory.Create(
                    _epStatement,
                    StatementListenerSet.Subscriber, 
                    StatementListenerSet.SubscriberMethodName,
                    _selectClauseTypes, 
                    _selectClauseColumnNames, 
                    _runtime.URI, 
                    _runtime.ServicesContext.ImportServiceRuntime);
                IsMakeNatural = true;
            }
            catch (ResultDeliveryStrategyInvalidException ex) {
                throw new EPSubscriberException(ex.Message, ex);
            }
        }
Esempio n. 3
0
 public void SetListenerSet(EPStatementListenerSet value, bool isRecovery)
 {
 }