コード例 #1
0
        public static StatementContext MakeContext(int statementId, SchedulingService stub)
        {
            Configuration config = new Configuration();

            config.EngineDefaults.ViewResourcesConfig.IsAllowMultipleExpiryPolicies = true;

            TimeSourceServiceImpl          timeSourceService  = new TimeSourceServiceImpl();
            StatementContextEngineServices stmtEngineServices = new StatementContextEngineServices(
                "engURI",
                SupportEventAdapterService.GetService(),
                new NamedWindowMgmtServiceImpl(false, null),
                null, new TableServiceImpl(),
                new EngineSettingsService(new Configuration().EngineDefaults, new Uri[0]),
                new ValueAddEventServiceImpl(),
                config,
                null,
                null,
                null,
                null,
                new StatementEventTypeRefImpl(), null, null, null, null, null, new ViewServicePreviousFactoryImpl(), null,
                new PatternNodeFactoryImpl(), new FilterBooleanExpressionFactoryImpl(), timeSourceService,
                SupportEngineImportServiceFactory.Make(), AggregationFactoryFactoryDefault.INSTANCE,
                new SchedulingServiceImpl(timeSourceService));

            return(new StatementContext(
                       stmtEngineServices,
                       stub,
                       new ScheduleBucket(1),
                       new EPStatementHandle(statementId, "name1", "epl1", StatementType.SELECT, "epl1", false, null, 0, false, false, new MultiMatchHandlerFactoryImpl().GetDefaultHandler()),
                       new ViewResolutionServiceImpl(new PluggableObjectRegistryImpl(new PluggableObjectCollection[] { ViewEnumHelper.BuiltinViews }), null, null),
                       new PatternObjectResolutionServiceImpl(null),
                       null,
                       null,
                       null,
                       null,
                       new StatementResultServiceImpl("name", null, null, new ThreadingServiceImpl(new ConfigurationEngineDefaults.Threading())), // statement result svc
                       null,
                       null,
                       null,
                       null,
                       null,
                       null,
                       null,
                       false,
                       null,
                       null,
                       AggregationServiceFactoryServiceImpl.DEFAULT_FACTORY,
                       null,
                       false,
                       null, new StatementSemiAnonymousTypeRegistryImpl(), 0));
        }
コード例 #2
0
        public static StatementContext MakeContext(IContainer container, int statementId, SchedulingService stub)
        {
            var lockManager         = container.Resolve <ILockManager>();
            var rwLockManager       = container.Resolve <IReaderWriterLockManager>();
            var threadLocalManager  = container.Resolve <IThreadLocalManager>();
            var classLoaderProvider = container.Resolve <ClassLoaderProvider>();

            var config = new Configuration(container);

            config.EngineDefaults.ViewResources.IsAllowMultipleExpiryPolicies = true;

            var timeSourceService  = new TimeSourceServiceImpl();
            var stmtEngineServices = new StatementContextEngineServices(
                container,
                "engURI",
                container.Resolve <EventAdapterService>(),
                new NamedWindowMgmtServiceImpl(false, null),
                null, new TableServiceImpl(rwLockManager, threadLocalManager),
                new EngineSettingsService(new Configuration(container).EngineDefaults, new Uri[0]),
                new ValueAddEventServiceImpl(lockManager),
                config,
                null,
                null,
                null,
                null,
                new StatementEventTypeRefImpl(rwLockManager),
                null, null, null, null, null,
                new ViewServicePreviousFactoryImpl(), null,
                new PatternNodeFactoryImpl(),
                new FilterBooleanExpressionFactoryImpl(),
                timeSourceService,
                SupportEngineImportServiceFactory.Make(classLoaderProvider),
                AggregationFactoryFactoryDefault.INSTANCE,
                new SchedulingServiceImpl(timeSourceService, lockManager),
                null);

            return(new StatementContext(
                       container,
                       stmtEngineServices,
                       stub,
                       new ScheduleBucket(1),
                       new EPStatementHandle(statementId, "name1", "epl1", StatementType.SELECT, "epl1", false, null, 0, false, false, new MultiMatchHandlerFactoryImpl().GetDefaultHandler()),
                       new ViewResolutionServiceImpl(new PluggableObjectRegistryImpl(new PluggableObjectCollection[] { ViewEnumHelper.BuiltinViews }), null, null),
                       new PatternObjectResolutionServiceImpl(container, null),
                       null,
                       null,
                       null,
                       null,
                       new StatementResultServiceImpl("name", null, null, new ThreadingServiceImpl(new ConfigurationEngineDefaults.ThreadingConfig()), threadLocalManager), // statement result svc
                       null,
                       null,
                       null,
                       null,
                       null,
                       null,
                       null,
                       false,
                       null,
                       null,
                       AggregationServiceFactoryServiceImpl.DEFAULT_FACTORY,
                       null,
                       false,
                       null, new StatementSemiAnonymousTypeRegistryImpl(), 0));
        }