public static void BuildBeanTypes( BeanEventTypeStemService beanEventTypeStemService, EventTypeRepositoryImpl repo, IDictionary<string, Type> beanTypes, BeanEventTypeFactoryPrivate privateFactory, IDictionary<string, ConfigurationCommonEventTypeBean> configs) { if (beanTypes.IsEmpty()) { beanTypes = new Dictionary<string, Type>(); } AddPredefinedBeanEventTypes(beanTypes); foreach (var beanType in beanTypes) { if (repo.GetTypeByName(beanType.Key) == null) { BuildPublicBeanType( beanEventTypeStemService, repo, beanType.Key, beanType.Value, privateFactory, configs); } } }
protected override EventTypeFactory MakeEventTypeFactory( RuntimeExtensionServices runtimeExt, EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, DeploymentLifecycleServiceImpl deploymentLifecycleService, EventBeanTypedEventFactory eventBeanTypedEventFactory) { return EventTypeFactoryImpl.GetInstance(_container); }
public EventBeanServiceImpl( EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, PathRegistry<string, EventType> pathEventTypes, EventBeanTypedEventFactory typedEventFactory) { this.eventTypeRepositoryPreconfigured = eventTypeRepositoryPreconfigured; this.pathEventTypes = pathEventTypes; this.typedEventFactory = typedEventFactory; }
public EventTypeCompileTimeResolver( string moduleName, ICollection<string> moduleUses, EventTypeCompileTimeRegistry locals, EventTypeRepositoryImpl publics, PathRegistry<string, EventType> path, ModuleDependenciesCompileTime moduleDependencies, bool isFireAndForget) { this.moduleName = moduleName; this.moduleUses = moduleUses; this.locals = locals; this.publics = publics; Path = path; this.moduleDependencies = moduleDependencies; this.isFireAndForget = isFireAndForget; }
public static VariableMetaData CompileVariable( String variableName, String variableModuleName, NameAccessModifier variableVisibility, String optionalContextName, NameAccessModifier? optionalContextVisibility, String optionalModuleName, ClassIdentifierWArray variableType, bool isConstant, bool compileTimeConstant, Object initializationValue, ImportService importService, ExtensionClass extensionClass, EventBeanTypedEventFactory eventBeanTypedEventFactory, EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, BeanEventTypeFactory beanEventTypeFactory) { try { return GetTypeInfo( variableName, variableModuleName, variableVisibility, optionalContextName, optionalContextVisibility, optionalModuleName, variableType, false, isConstant, compileTimeConstant, initializationValue, importService, extensionClass, eventBeanTypedEventFactory, eventTypeRepositoryPreconfigured, beanEventTypeFactory); } catch (VariableTypeException t) { throw new ExprValidationException(t.Message, t); } catch (Exception t) { throw new ExprValidationException("Failed to compile variable '" + variableName + "': " + t.Message, t); } }
public static void ConfigureVariables( VariableRepositoryPreconfigured repo, IDictionary<string, ConfigurationCommonVariable> variables, ImportService importService, EventBeanTypedEventFactory eventBeanTypedEventFactory, EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, BeanEventTypeFactory beanEventTypeFactory) { foreach (var entry in variables) { string variableName = entry.Key.Trim(); if (repo.GetMetadata(variableName) != null) { continue; } VariableMetaData meta; try { var variableType = ClassIdentifierWArray.ParseSODA(entry.Value.VariableType); meta = GetTypeInfo( variableName, null, NameAccessModifier.PRECONFIGURED, null, null, null, variableType, true, entry.Value.IsConstant, entry.Value.IsConstant, entry.Value.InitializationValue, importService, ExtensionClassEmpty.INSTANCE, eventBeanTypedEventFactory, eventTypeRepositoryPreconfigured, beanEventTypeFactory); } catch (Exception t) { throw new ConfigurationException("Error configuring variable '" + entry.Key + "': " + t.Message, t); } repo.AddVariable(entry.Key, meta); } }
public EPCompilerPathableImpl( PathRegistry<string, VariableMetaData> variablePathRegistry, PathRegistry<string, EventType> eventTypePathRegistry, PathRegistry<string, ExpressionDeclItem> exprDeclaredPathRegistry, PathRegistry<string, NamedWindowMetaData> namedWindowPathRegistry, PathRegistry<string, TableMetaData> tablePathRegistry, PathRegistry<string, ContextMetaData> contextPathRegistry, PathRegistry<NameAndParamNum, ExpressionScriptProvided> scriptPathRegistry, PathRegistry<string, ClassProvided> classProvidedPathRegistry, EventTypeRepositoryImpl eventTypePreconfigured, VariableRepositoryPreconfigured variablePreconfigured) { VariablePathRegistry = variablePathRegistry; EventTypePathRegistry = eventTypePathRegistry; ExprDeclaredPathRegistry = exprDeclaredPathRegistry; NamedWindowPathRegistry = namedWindowPathRegistry; TablePathRegistry = tablePathRegistry; ContextPathRegistry = contextPathRegistry; ScriptPathRegistry = scriptPathRegistry; ClassProvidedPathRegistry = classProvidedPathRegistry; EventTypePreconfigured = eventTypePreconfigured; VariablePreconfigured = variablePreconfigured; }
public StatementContextRuntimeServices( IContainer container, ContextManagementService contextManagementService, ContextServiceFactory contextServiceFactory, DatabaseConfigServiceRuntime databaseConfigService, DataFlowFilterServiceAdapter dataFlowFilterServiceAdapter, EPDataFlowServiceImpl dataflowService, string runtimeURI, INamingContext runtimeEnvContext, ImportServiceRuntime importServiceRuntime, RuntimeSettingsService runtimeSettingsService, RuntimeExtensionServices runtimeExtensionServices, object epRuntime, EPRenderEventService epRuntimeRenderEvent, EventServiceSendEventCommon eventServiceSendEventInternal, EPRuntimeEventProcessWrapped epRuntimeEventProcessWrapped, EventBeanService eventBeanService, EventBeanTypedEventFactory eventBeanTypedEventFactory, EventTableIndexService eventTableIndexService, EventTypeAvroHandler eventTypeAvroHandler, PathRegistry<string, EventType> eventTypePathRegistry, EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, EventTypeResolvingBeanFactory eventTypeResolvingBeanFactory, ExceptionHandlingService exceptionHandlingService, ExpressionResultCacheService expressionResultCacheService, FilterBooleanExpressionFactory filterBooleanExpressionFactory, FilterSharedBoolExprRepository filterSharedBoolExprRepository, FilterSharedLookupableRepository filterSharedLookupableRepository, HistoricalDataCacheFactory historicalDataCacheFactory, InternalEventRouter internalEventRouter, MetricReportingService metricReportingService, NamedWindowConsumerManagementService namedWindowConsumerManagementService, NamedWindowManagementService namedWindowManagementService, PathRegistry<string, ContextMetaData> pathContextRegistry, PathRegistry<string, NamedWindowMetaData> pathNamedWindowRegistry, RowRecogStateRepoFactory rowRecogStateRepoFactory, ResultSetProcessorHelperFactory resultSetProcessorHelperFactory, StatementAgentInstanceLockFactory statementAgentInstanceLockFactory, StatementResourceHolderBuilder statementResourceHolderBuilder, TableExprEvaluatorContext tableExprEvaluatorContext, TableManagementService tableManagementService, VariableManagementService variableManagementService, ViewFactoryService viewFactoryService, ViewServicePreviousFactory viewServicePreviousFactory) { Container = container; ContextManagementService = contextManagementService; ContextServiceFactory = contextServiceFactory; DatabaseConfigService = databaseConfigService; DataFlowFilterServiceAdapter = dataFlowFilterServiceAdapter; DataflowService = dataflowService; RuntimeURI = runtimeURI; RuntimeEnvContext = runtimeEnvContext; ImportServiceRuntime = importServiceRuntime; RuntimeSettingsService = runtimeSettingsService; RuntimeExtensionServices = runtimeExtensionServices; Runtime = epRuntime; EPRuntimeRenderEvent = epRuntimeRenderEvent; EventServiceSendEventInternal = eventServiceSendEventInternal; EPRuntimeEventProcessWrapped = epRuntimeEventProcessWrapped; EventBeanService = eventBeanService; EventBeanTypedEventFactory = eventBeanTypedEventFactory; EventTableIndexService = eventTableIndexService; EventTypeAvroHandler = eventTypeAvroHandler; EventTypePathRegistry = eventTypePathRegistry; EventTypeRepositoryPreconfigured = eventTypeRepositoryPreconfigured; EventTypeResolvingBeanFactory = eventTypeResolvingBeanFactory; ExceptionHandlingService = exceptionHandlingService; ExpressionResultCacheService = expressionResultCacheService; FilterBooleanExpressionFactory = filterBooleanExpressionFactory; FilterSharedBoolExprRepository = filterSharedBoolExprRepository; FilterSharedLookupableRepository = filterSharedLookupableRepository; HistoricalDataCacheFactory = historicalDataCacheFactory; InternalEventRouter = internalEventRouter; MetricReportingService = metricReportingService; NamedWindowConsumerManagementService = namedWindowConsumerManagementService; NamedWindowManagementService = namedWindowManagementService; PathContextRegistry = pathContextRegistry; PathNamedWindowRegistry = pathNamedWindowRegistry; RowRecogStateRepoFactory = rowRecogStateRepoFactory; ResultSetProcessorHelperFactory = resultSetProcessorHelperFactory; StatementAgentInstanceLockFactory = statementAgentInstanceLockFactory; StatementResourceHolderBuilder = statementResourceHolderBuilder; TableExprEvaluatorContext = tableExprEvaluatorContext; TableManagementService = tableManagementService; VariableManagementService = variableManagementService; ViewFactoryService = viewFactoryService; ViewServicePreviousFactory = viewServicePreviousFactory; }
public ModuleCompileTimeServices( IContainer container, CompilerServices compilerServices, Configuration configuration, ContextCompileTimeRegistry contextCompileTimeRegistry, ContextCompileTimeResolver contextCompileTimeResolver, BeanEventTypeStemService beanEventTypeStemService, BeanEventTypeFactoryPrivate beanEventTypeFactoryPrivate, ClassProvidedCompileTimeRegistry classProvidedCompileTimeRegistry, ClassProvidedCompileTimeResolver classProvidedCompileTimeResolver, DatabaseConfigServiceCompileTime databaseConfigServiceCompileTime, ImportServiceCompileTime importService, ExprDeclaredCompileTimeRegistry exprDeclaredCompileTimeRegistry, ExprDeclaredCompileTimeResolver exprDeclaredCompileTimeResolver, EventTypeAvroHandler eventTypeAvroHandler, EventTypeCompileTimeRegistry eventTypeCompileTimeRegistry, EventTypeCompileTimeResolver eventTypeCompileTimeResolver, EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, bool fireAndForget, IndexCompileTimeRegistry indexCompileTimeRegistry, ModuleDependenciesCompileTime moduleDependencies, ModuleAccessModifierService moduleVisibilityRules, NamedWindowCompileTimeResolver namedWindowCompileTimeResolver, NamedWindowCompileTimeRegistry namedWindowCompileTimeRegistry, ParentClassLoader parentClassLoader, PatternObjectResolutionService patternObjectResolutionService, ScriptCompileTimeRegistry scriptCompileTimeRegistry, ScriptCompileTimeResolver scriptCompileTimeResolver, ScriptCompiler scriptCompiler, SerdeEventTypeCompileTimeRegistry serdeEventTypeRegistry, SerdeCompileTimeResolver serdeResolver, TableCompileTimeRegistry tableCompileTimeRegistry, TableCompileTimeResolver tableCompileTimeResolver, VariableCompileTimeRegistry variableCompileTimeRegistry, VariableCompileTimeResolver variableCompileTimeResolver, ViewResolutionService viewResolutionService, XMLFragmentEventTypeFactory xmlFragmentEventTypeFactory) { var generation = Interlocked.Increment(ref _generation); Namespace = $"generation_{generation}"; Container = container; CompilerServices = compilerServices; Configuration = configuration; ContextCompileTimeRegistry = contextCompileTimeRegistry; ContextCompileTimeResolver = contextCompileTimeResolver; BeanEventTypeStemService = beanEventTypeStemService; BeanEventTypeFactoryPrivate = beanEventTypeFactoryPrivate; DatabaseConfigServiceCompileTime = databaseConfigServiceCompileTime; ImportServiceCompileTime = importService; ExprDeclaredCompileTimeRegistry = exprDeclaredCompileTimeRegistry; ExprDeclaredCompileTimeResolver = exprDeclaredCompileTimeResolver; EventTypeAvroHandler = eventTypeAvroHandler; EventTypeCompileTimeRegistry = eventTypeCompileTimeRegistry; EventTypeCompileTimeResolver = eventTypeCompileTimeResolver; EventTypeRepositoryPreconfigured = eventTypeRepositoryPreconfigured; IndexCompileTimeRegistry = indexCompileTimeRegistry; ModuleDependencies = moduleDependencies; ModuleVisibilityRules = moduleVisibilityRules; NamedWindowCompileTimeResolver = namedWindowCompileTimeResolver; NamedWindowCompileTimeRegistry = namedWindowCompileTimeRegistry; ParentClassLoader = parentClassLoader; PatternObjectResolutionService = patternObjectResolutionService; ScriptCompileTimeRegistry = scriptCompileTimeRegistry; ScriptCompileTimeResolver = scriptCompileTimeResolver; ScriptCompiler = scriptCompiler; TableCompileTimeRegistry = tableCompileTimeRegistry; TableCompileTimeResolver = tableCompileTimeResolver; VariableCompileTimeRegistry = variableCompileTimeRegistry; VariableCompileTimeResolver = variableCompileTimeResolver; ViewResolutionService = viewResolutionService; XmlFragmentEventTypeFactory = xmlFragmentEventTypeFactory; #region ESPER_8.5.1 ClassProvidedCompileTimeRegistry = classProvidedCompileTimeRegistry; ClassProvidedCompileTimeResolver = classProvidedCompileTimeResolver; SerdeEventTypeRegistry = serdeEventTypeRegistry; SerdeResolver = serdeResolver; IsFireAndForget = fireAndForget; #endregion }
public EPServicesContext( IContainer container, AggregationServiceFactoryService aggregationServiceFactoryService, BeanEventTypeFactoryPrivate beanEventTypeFactoryPrivate, BeanEventTypeStemService beanEventTypeStemService, ClassForNameProvider classForNameProvider, ParentClassLoader classLoaderParent, PathRegistry <string, ClassProvided> classProvidedPathRegistry, Configuration configSnapshot, ContextManagementService contextManagementService, PathRegistry <string, ContextMetaData> contextPathRegistry, ContextServiceFactory contextServiceFactory, EPDataFlowServiceImpl dataflowService, DataFlowFilterServiceAdapter dataFlowFilterServiceAdapter, DatabaseConfigServiceRuntime databaseConfigServiceRuntime, DeploymentLifecycleService deploymentLifecycleService, DispatchService dispatchService, RuntimeEnvContext runtimeEnvContext, RuntimeSettingsService runtimeSettingsService, string runtimeURI, ImportServiceRuntime importServiceRuntime, EPStatementFactory epStatementFactory, PathRegistry <string, ExpressionDeclItem> exprDeclaredPathRegistry, IReaderWriterLock eventProcessingRWLock, EPServicesHA epServicesHA, EPRuntimeSPI epRuntime, EventBeanService eventBeanService, EventBeanTypedEventFactory eventBeanTypedEventFactory, EPRenderEventServiceImpl eventRenderer, EventSerdeFactory eventSerdeFactory, EventTableIndexService eventTableIndexService, EventTypeAvroHandler eventTypeAvroHandler, EventTypeFactory eventTypeFactory, EventTypeIdResolver eventTypeIdResolver, PathRegistry <string, EventType> eventTypePathRegistry, EventTypeRepositoryImpl eventTypeRepositoryBus, EventTypeResolvingBeanFactory eventTypeResolvingBeanFactory, EventTypeSerdeRepository eventTypeSerdeRepository, ExceptionHandlingService exceptionHandlingService, ExpressionResultCacheService expressionResultCacheService, FilterBooleanExpressionFactory filterBooleanExpressionFactory, FilterServiceSPI filterService, FilterSharedBoolExprRepository filterSharedBoolExprRepository, FilterSharedLookupableRepository filterSharedLookupableRepository, HistoricalDataCacheFactory historicalDataCacheFactory, InternalEventRouterImpl internalEventRouter, MetricReportingService metricReportingService, MultiMatchHandlerFactory multiMatchHandlerFactory, NamedWindowConsumerManagementService namedWindowConsumerManagementService, NamedWindowDispatchService namedWindowDispatchService, NamedWindowFactoryService namedWindowFactoryService, NamedWindowManagementService namedWindowManagementService, PathRegistry <string, NamedWindowMetaData> namedWindowPathRegistry, PatternFactoryService patternFactoryService, PatternSubexpressionPoolRuntimeSvc patternSubexpressionPoolEngineSvc, ResultSetProcessorHelperFactory resultSetProcessorHelperFactory, RowRecogStateRepoFactory rowRecogStateRepoFactory, RowRecogStatePoolRuntimeSvc rowRecogStatePoolEngineSvc, SchedulingServiceSPI schedulingService, PathRegistry <NameAndParamNum, ExpressionScriptProvided> scriptPathRegistry, ScriptCompiler scriptCompiler, StageRecoveryService stageRecoveryService, StatementLifecycleService statementLifecycleService, StatementAgentInstanceLockFactory statementAgentInstanceLockFactory, StatementResourceHolderBuilder statementResourceHolderBuilder, TableExprEvaluatorContext tableExprEvaluatorContext, TableManagementService tableManagementService, PathRegistry <string, TableMetaData> tablePathRegistry, ThreadingService threadingService, TimeAbacus timeAbacus, TimeSourceService timeSourceService, TimerService timerService, VariableManagementService variableManagementService, PathRegistry <string, VariableMetaData> variablePathRegistry, ViewableActivatorFactory viewableActivatorFactory, ViewFactoryService viewFactoryService, ViewServicePreviousFactory viewServicePreviousFactory, XMLFragmentEventTypeFactory xmlFragmentEventTypeFactory) { _container = container; _aggregationServiceFactoryService = aggregationServiceFactoryService; _beanEventTypeFactoryPrivate = beanEventTypeFactoryPrivate; _beanEventTypeStemService = beanEventTypeStemService; _classForNameProvider = classForNameProvider; _classLoaderParent = classLoaderParent; _classProvidedPathRegistry = classProvidedPathRegistry; _configSnapshot = configSnapshot; _contextManagementService = contextManagementService; _contextPathRegistry = contextPathRegistry; _contextServiceFactory = contextServiceFactory; _dataflowService = dataflowService; _dataFlowFilterServiceAdapter = dataFlowFilterServiceAdapter; _databaseConfigServiceRuntime = databaseConfigServiceRuntime; _deploymentLifecycleService = deploymentLifecycleService; _dispatchService = dispatchService; _runtimeEnvContext = runtimeEnvContext; _runtimeSettingsService = runtimeSettingsService; _runtimeUri = runtimeURI; _importServiceRuntime = importServiceRuntime; _epStatementFactory = epStatementFactory; _exprDeclaredPathRegistry = exprDeclaredPathRegistry; _eventProcessingRWLock = eventProcessingRWLock; _epServicesHA = epServicesHA; _epRuntime = epRuntime; _eventBeanService = eventBeanService; _eventBeanTypedEventFactory = eventBeanTypedEventFactory; _eventRenderer = eventRenderer; _eventSerdeFactory = eventSerdeFactory; _eventTableIndexService = eventTableIndexService; _eventTypeAvroHandler = eventTypeAvroHandler; _eventTypeFactory = eventTypeFactory; _eventTypeIdResolver = eventTypeIdResolver; _eventTypePathRegistry = eventTypePathRegistry; _eventTypeRepositoryBus = eventTypeRepositoryBus; _eventTypeResolvingBeanFactory = eventTypeResolvingBeanFactory; _eventTypeSerdeRepository = eventTypeSerdeRepository; _exceptionHandlingService = exceptionHandlingService; _expressionResultCacheService = expressionResultCacheService; _filterBooleanExpressionFactory = filterBooleanExpressionFactory; _filterService = filterService; _filterSharedBoolExprRepository = filterSharedBoolExprRepository; _filterSharedLookupableRepository = filterSharedLookupableRepository; _historicalDataCacheFactory = historicalDataCacheFactory; _internalEventRouter = internalEventRouter; _metricReportingService = metricReportingService; _multiMatchHandlerFactory = multiMatchHandlerFactory; _namedWindowConsumerManagementService = namedWindowConsumerManagementService; _namedWindowDispatchService = namedWindowDispatchService; _namedWindowFactoryService = namedWindowFactoryService; _namedWindowManagementService = namedWindowManagementService; _namedWindowPathRegistry = namedWindowPathRegistry; _patternFactoryService = patternFactoryService; _patternSubexpressionPoolEngineSvc = patternSubexpressionPoolEngineSvc; _resultSetProcessorHelperFactory = resultSetProcessorHelperFactory; _rowRecogStateRepoFactory = rowRecogStateRepoFactory; _rowRecogStatePoolEngineSvc = rowRecogStatePoolEngineSvc; _schedulingService = schedulingService; _scriptPathRegistry = scriptPathRegistry; _stageRecoveryService = stageRecoveryService; _statementLifecycleService = statementLifecycleService; _statementAgentInstanceLockFactory = statementAgentInstanceLockFactory; _statementResourceHolderBuilder = statementResourceHolderBuilder; _tableExprEvaluatorContext = tableExprEvaluatorContext; _tableManagementService = tableManagementService; _tablePathRegistry = tablePathRegistry; _threadingService = threadingService; _timeAbacus = timeAbacus; _timeSourceService = timeSourceService; _timerService = timerService; _variableManagementService = variableManagementService; _variablePathRegistry = variablePathRegistry; _viewableActivatorFactory = viewableActivatorFactory; _viewFactoryService = viewFactoryService; _viewServicePreviousFactory = viewServicePreviousFactory; _xmlFragmentEventTypeFactory = xmlFragmentEventTypeFactory; _scriptCompiler = scriptCompiler; }
public EPServicesContext CreateServicesContext( EPRuntimeSPI epRuntime, Configuration configs) { var container = epRuntime.Container; var runtimeEnvContext = new RuntimeEnvContext(); var eventProcessingRWLock = epRuntime.Container.RWLockManager().CreateLock("EventProcLock"); var deploymentLifecycleService = new DeploymentLifecycleServiceImpl(-1); var runtimeSettingsService = MakeRuntimeSettingsService(configs); var scriptCompiler = new ScriptCompilerImpl(container, configs.Common); var timeAbacus = TimeAbacusFactory.Make(configs.Common.TimeSource.TimeUnit); var timeZone = configs.Runtime.Expression.TimeZone ?? TimeZoneInfo.Utc; var importServiceRuntime = new ImportServiceRuntime( container, configs.Common.TransientConfiguration, timeAbacus, configs.Common.EventTypeAutoNameNamespaces, timeZone, configs.Common.MethodInvocationReferences, configs.Common.Imports, configs.Common.AnnotationImports); var epServicesHA = InitHA(epRuntime.URI, configs, runtimeEnvContext, eventProcessingRWLock, runtimeSettingsService); var eventTypeAvroHandler = MakeEventTypeAvroHandler( importServiceRuntime, configs.Common.EventMeta.AvroSettings, epServicesHA.RuntimeExtensionServices); var resolvedBeanEventTypes = BeanEventTypeRepoUtil.ResolveBeanEventTypes(configs.Common.EventTypeNames, importServiceRuntime); var eventBeanTypedEventFactory = MakeEventBeanTypedEventFactory(eventTypeAvroHandler); var beanEventTypeStemService = BeanEventTypeRepoUtil.MakeBeanEventTypeStemService(configs, resolvedBeanEventTypes, eventBeanTypedEventFactory); var eventTypeRepositoryPreconfigured = new EventTypeRepositoryImpl(false); var eventTypeFactory = MakeEventTypeFactory( epServicesHA.RuntimeExtensionServices, eventTypeRepositoryPreconfigured, deploymentLifecycleService, eventBeanTypedEventFactory); var beanEventTypeFactoryPrivate = new BeanEventTypeFactoryPrivate(eventBeanTypedEventFactory, eventTypeFactory, beanEventTypeStemService); EventTypeRepositoryBeanTypeUtil.BuildBeanTypes( beanEventTypeStemService, eventTypeRepositoryPreconfigured, resolvedBeanEventTypes, beanEventTypeFactoryPrivate, configs.Common.EventTypesBean); EventTypeRepositoryMapTypeUtil.BuildMapTypes( eventTypeRepositoryPreconfigured, configs.Common.MapTypeConfigurations, configs.Common.EventTypesMapEvents, configs.Common.EventTypesNestableMapEvents, beanEventTypeFactoryPrivate, importServiceRuntime); EventTypeRepositoryOATypeUtil.BuildOATypes( eventTypeRepositoryPreconfigured, configs.Common.ObjectArrayTypeConfigurations, configs.Common.EventTypesNestableObjectArrayEvents, beanEventTypeFactoryPrivate, importServiceRuntime); var xmlFragmentEventTypeFactory = new XMLFragmentEventTypeFactory(beanEventTypeFactoryPrivate, null, eventTypeRepositoryPreconfigured); EventTypeRepositoryXMLTypeUtil.BuildXMLTypes( eventTypeRepositoryPreconfigured, configs.Common.EventTypesXMLDOM, beanEventTypeFactoryPrivate, xmlFragmentEventTypeFactory, container.ResourceManager()); //importServiceRuntime EventTypeRepositoryAvroTypeUtil.BuildAvroTypes( eventTypeRepositoryPreconfigured, configs.Common.EventTypesAvro, eventTypeAvroHandler, beanEventTypeFactoryPrivate.EventBeanTypedEventFactory); EventTypeRepositoryVariantStreamUtil.BuildVariantStreams( eventTypeRepositoryPreconfigured, configs.Common.VariantStreams, eventTypeFactory); var eventTypeResolvingBeanFactory = MakeEventTypeResolvingBeanFactory(eventTypeRepositoryPreconfigured, eventTypeAvroHandler); var viewableActivatorFactory = InitViewableActivatorFactory(); var statementLifecycleService = new StatementLifecycleServiceImpl(); EventTypeIdResolver eventTypeIdResolver = new ProxyEventTypeIdResolver { ProcGetTypeById = ( eventTypeIdPublic, eventTypeIdProtected) => { if (eventTypeIdProtected == -1) { return eventTypeRepositoryPreconfigured.GetTypeById(eventTypeIdPublic); } var deployerResult = deploymentLifecycleService.GetDeploymentByCRC(eventTypeIdPublic); return deployerResult.DeploymentTypes.Get(eventTypeIdProtected); } }; var filterSharedBoolExprRepository = MakeFilterSharedBoolExprRepository(); var filterSharedLookupableRepository = MakeFilterSharedLookupableRepository(); var filterServiceSPI = MakeFilterService( epServicesHA.RuntimeExtensionServices, eventTypeRepositoryPreconfigured, statementLifecycleService, runtimeSettingsService, eventTypeIdResolver, filterSharedLookupableRepository); var filterBooleanExpressionFactory = MakeFilterBooleanExpressionFactory(statementLifecycleService); var statementResourceHolderBuilder = MakeStatementResourceHolderBuilder(); var aggregationServiceFactoryService = MakeAggregationServiceFactoryService(epServicesHA.RuntimeExtensionServices); var viewFactoryService = MakeViewFactoryService(); var patternFactoryService = MakePatternFactoryService(); var exceptionHandlingService = InitExceptionHandling( epRuntime.URI, configs.Runtime.ExceptionHandling, configs.Runtime.ConditionHandling, ClassForNameProviderDefault.INSTANCE); var timeSourceService = MakeTimeSource(configs); var schedulingService = MakeSchedulingService( epServicesHA, timeSourceService, epServicesHA.RuntimeExtensionServices, runtimeSettingsService, statementLifecycleService, importServiceRuntime.TimeZone.Id); var internalEventRouter = new InternalEventRouterImpl(eventBeanTypedEventFactory); var multiMatchHandlerFactory = MakeMultiMatchHandlerFactory(configs); var dispatchService = new DispatchService(); var contextServiceFactory = MakeContextServiceFactory(epServicesHA.RuntimeExtensionServices); ContextManagementService contextManagementService = new ContextManagementServiceImpl(); var viewServicePreviousFactory = MakeViewServicePreviousFactory(epServicesHA.RuntimeExtensionServices); var epStatementFactory = MakeEPStatementFactory(); var msecTimerResolution = configs.Runtime.Threading.InternalTimerMsecResolution; if (msecTimerResolution <= 0) { throw new ConfigurationException("Timer resolution configuration not set to a valid value, expecting a non-zero value"); } TimerService timerService = new TimerServiceImpl(epRuntime.URI, msecTimerResolution); StatementAgentInstanceLockFactory statementAgentInstanceLockFactory = new StatementAgentInstanceLockFactoryImpl( configs.Runtime.Execution.IsFairlock, configs.Runtime.Execution.IsDisableLocking); var eventTableIndexService = MakeEventTableIndexService(epServicesHA.RuntimeExtensionServices); var expressionResultCacheSharable = new ExpressionResultCacheService( configs.Runtime.Execution.DeclaredExprValueCacheSize, epRuntime.Container.ThreadLocalManager()); var resultSetProcessorHelperFactory = MakeResultSetProcessorHelperFactory(epServicesHA.RuntimeExtensionServices); var variableRepositoryPreconfigured = new VariableRepositoryPreconfigured(); VariableUtil.ConfigureVariables( variableRepositoryPreconfigured, configs.Common.Variables, importServiceRuntime, eventBeanTypedEventFactory, eventTypeRepositoryPreconfigured, beanEventTypeFactoryPrivate); var variableManagementService = MakeVariableManagementService( configs, schedulingService, eventBeanTypedEventFactory, runtimeSettingsService, epServicesHA); foreach (var publicVariable in variableRepositoryPreconfigured.Metadata) { variableManagementService.AddVariable(null, publicVariable.Value, null, null); variableManagementService.AllocateVariableState( null, publicVariable.Key, DEFAULT_AGENT_INSTANCE_ID, false, null, eventBeanTypedEventFactory); } var variablePathRegistry = new PathRegistry<string, VariableMetaData>(PathRegistryObjectType.VARIABLE); var tableExprEvaluatorContext = new TableExprEvaluatorContext( epRuntime.Container.ThreadLocalManager()); var tableManagementService = MakeTableManagementService(epServicesHA.RuntimeExtensionServices, tableExprEvaluatorContext); var tablePathRegistry = new PathRegistry<string, TableMetaData>(PathRegistryObjectType.TABLE); var metricsReporting = new MetricReportingServiceImpl( configs.Runtime.MetricsReporting, epRuntime.URI, container.RWLockManager()); var namedWindowFactoryService = MakeNamedWindowFactoryService(); var namedWindowDispatchService = MakeNamedWindowDispatchService( schedulingService, configs, eventProcessingRWLock, exceptionHandlingService, variableManagementService, tableManagementService, metricsReporting); NamedWindowManagementService namedWindowManagementService = new NamedWindowManagementServiceImpl(); var namedWindowConsumerManagementService = MakeNamedWindowConsumerManagementService(namedWindowManagementService); var pathNamedWindowRegistry = new PathRegistry<string, NamedWindowMetaData>(PathRegistryObjectType.NAMEDWINDOW); var eventTypePathRegistry = new PathRegistry<string, EventType>(PathRegistryObjectType.EVENTTYPE); var pathContextRegistry = new PathRegistry<string, ContextMetaData>(PathRegistryObjectType.CONTEXT); EventBeanService eventBeanService = new EventBeanServiceImpl( eventTypeRepositoryPreconfigured, eventTypePathRegistry, eventBeanTypedEventFactory); PatternSubexpressionPoolRuntimeSvc patternSubexpressionPoolSvc; if (configs.Runtime.Patterns.MaxSubexpressions != null) { patternSubexpressionPoolSvc = new PatternSubexpressionPoolRuntimeSvcImpl( configs.Runtime.Patterns.MaxSubexpressions.Value, configs.Runtime.Patterns.IsMaxSubexpressionPreventStart); } else { patternSubexpressionPoolSvc = PatternSubexpressionPoolRuntimeSvcNoOp.INSTANCE; } var exprDeclaredPathRegistry = new PathRegistry<string, ExpressionDeclItem>(PathRegistryObjectType.EXPRDECL); var scriptPathRegistry = new PathRegistry<NameAndParamNum, ExpressionScriptProvided>(PathRegistryObjectType.SCRIPT); RowRecogStatePoolRuntimeSvc rowRecogStatePoolEngineSvc = null; if (configs.Runtime.MatchRecognize.MaxStates != null) { rowRecogStatePoolEngineSvc = new RowRecogStatePoolRuntimeSvc( configs.Runtime.MatchRecognize.MaxStates.Value, configs.Runtime.MatchRecognize.IsMaxStatesPreventStart); } var rowRecogStateRepoFactory = MakeRowRecogStateRepoFactory(); DatabaseConfigServiceRuntime databaseConfigServiceRuntime = new DatabaseConfigServiceImpl( container, configs.Common.DatabaseReferences, importServiceRuntime); var historicalDataCacheFactory = MakeHistoricalDataCacheFactory(epServicesHA.RuntimeExtensionServices); var dataflowService = new EPDataFlowServiceImpl(container); var dataFlowFilterServiceAdapter = MakeDataFlowFilterServiceAdapter(); var threadingService = MakeThreadingService(configs); var eventRenderer = new EPRenderEventServiceImpl(); var eventSerdeFactory = MakeEventSerdeFactory(epServicesHA.RuntimeExtensionServices); var eventTypeSerdeRepository = MakeEventTypeSerdeRepository(eventTypeRepositoryPreconfigured, eventTypePathRegistry); var classLoaderParent = new ParentClassLoader(importServiceRuntime.ClassLoader); var stageRecoveryService = MakeStageRecoveryService(epServicesHA); var classProvidedPathRegistry = new PathRegistry<string, ClassProvided>(PathRegistryObjectType.CLASSPROVIDED); return new EPServicesContext( container, aggregationServiceFactoryService, beanEventTypeFactoryPrivate, beanEventTypeStemService, ClassForNameProviderDefault.INSTANCE, classLoaderParent, classProvidedPathRegistry, configs, contextManagementService, pathContextRegistry, contextServiceFactory, dataflowService, dataFlowFilterServiceAdapter, databaseConfigServiceRuntime, deploymentLifecycleService, dispatchService, runtimeEnvContext, runtimeSettingsService, epRuntime.URI, importServiceRuntime, epStatementFactory, exprDeclaredPathRegistry, eventProcessingRWLock, epServicesHA, epRuntime, eventBeanService, eventBeanTypedEventFactory, eventRenderer, eventSerdeFactory, eventTableIndexService, eventTypeAvroHandler, eventTypeFactory, eventTypeIdResolver, eventTypePathRegistry, eventTypeRepositoryPreconfigured, eventTypeResolvingBeanFactory, eventTypeSerdeRepository, exceptionHandlingService, expressionResultCacheSharable, filterBooleanExpressionFactory, filterServiceSPI, filterSharedBoolExprRepository, filterSharedLookupableRepository, historicalDataCacheFactory, internalEventRouter, metricsReporting, multiMatchHandlerFactory, namedWindowConsumerManagementService, namedWindowDispatchService, namedWindowFactoryService, namedWindowManagementService, pathNamedWindowRegistry, patternFactoryService, patternSubexpressionPoolSvc, resultSetProcessorHelperFactory, rowRecogStateRepoFactory, rowRecogStatePoolEngineSvc, schedulingService, scriptPathRegistry, scriptCompiler, stageRecoveryService, statementLifecycleService, statementAgentInstanceLockFactory, statementResourceHolderBuilder, tableExprEvaluatorContext, tableManagementService, tablePathRegistry, threadingService, timeAbacus, timeSourceService, timerService, variableManagementService, variablePathRegistry, viewableActivatorFactory, viewFactoryService, viewServicePreviousFactory, xmlFragmentEventTypeFactory); }
protected abstract EventTypeFactory MakeEventTypeFactory( RuntimeExtensionServices runtimeExt, EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, DeploymentLifecycleServiceImpl deploymentLifecycleService, EventBeanTypedEventFactory eventBeanTypedEventFactory);
public ModuleCompileTimeServices( IContainer container, CompilerServices compilerServices, Configuration configuration, ContextCompileTimeRegistry contextCompileTimeRegistry, ContextCompileTimeResolver contextCompileTimeResolver, BeanEventTypeStemService beanEventTypeStemService, BeanEventTypeFactoryPrivate beanEventTypeFactoryPrivate, DatabaseConfigServiceCompileTime databaseConfigServiceCompileTime, ImportServiceCompileTime importService, ExprDeclaredCompileTimeRegistry exprDeclaredCompileTimeRegistry, ExprDeclaredCompileTimeResolver exprDeclaredCompileTimeResolver, EventTypeAvroHandler eventTypeAvroHandler, EventTypeCompileTimeRegistry eventTypeCompileTimeRegistry, EventTypeCompileTimeResolver eventTypeCompileTimeResolver, EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, IndexCompileTimeRegistry indexCompileTimeRegistry, ModuleDependenciesCompileTime moduleDependencies, ModuleAccessModifierService moduleVisibilityRules, NamedWindowCompileTimeResolver namedWindowCompileTimeResolver, NamedWindowCompileTimeRegistry namedWindowCompileTimeRegistry, PatternObjectResolutionService patternObjectResolutionService, ScriptCompileTimeRegistry scriptCompileTimeRegistry, ScriptCompileTimeResolver scriptCompileTimeResolver, ScriptServiceCompileTime scriptServiceCompileTime, TableCompileTimeRegistry tableCompileTimeRegistry, TableCompileTimeResolver tableCompileTimeResolver, VariableCompileTimeRegistry variableCompileTimeRegistry, VariableCompileTimeResolver variableCompileTimeResolver, ViewResolutionService viewResolutionService, XMLFragmentEventTypeFactory xmlFragmentEventTypeFactory) { Container = container; CompilerServices = compilerServices; Configuration = configuration; ContextCompileTimeRegistry = contextCompileTimeRegistry; ContextCompileTimeResolver = contextCompileTimeResolver; BeanEventTypeStemService = beanEventTypeStemService; BeanEventTypeFactoryPrivate = beanEventTypeFactoryPrivate; DatabaseConfigServiceCompileTime = databaseConfigServiceCompileTime; ImportServiceCompileTime = importService; ExprDeclaredCompileTimeRegistry = exprDeclaredCompileTimeRegistry; ExprDeclaredCompileTimeResolver = exprDeclaredCompileTimeResolver; EventTypeAvroHandler = eventTypeAvroHandler; EventTypeCompileTimeRegistry = eventTypeCompileTimeRegistry; EventTypeCompileTimeResolver = eventTypeCompileTimeResolver; EventTypeRepositoryPreconfigured = eventTypeRepositoryPreconfigured; IndexCompileTimeRegistry = indexCompileTimeRegistry; ModuleDependencies = moduleDependencies; ModuleVisibilityRules = moduleVisibilityRules; NamedWindowCompileTimeResolver = namedWindowCompileTimeResolver; NamedWindowCompileTimeRegistry = namedWindowCompileTimeRegistry; PatternObjectResolutionService = patternObjectResolutionService; ScriptServiceCompileTime = scriptServiceCompileTime; ScriptCompileTimeRegistry = scriptCompileTimeRegistry; ScriptCompileTimeResolver = scriptCompileTimeResolver; TableCompileTimeRegistry = tableCompileTimeRegistry; TableCompileTimeResolver = tableCompileTimeResolver; VariableCompileTimeRegistry = variableCompileTimeRegistry; VariableCompileTimeResolver = variableCompileTimeResolver; ViewResolutionService = viewResolutionService; XmlFragmentEventTypeFactory = xmlFragmentEventTypeFactory; }
private static VariableMetaData GetTypeInfo( string variableName, string variableModuleName, NameAccessModifier variableVisibility, string optionalContextName, NameAccessModifier? optionalContextVisibility, string optionalContextModule, ClassIdentifierWArray variableTypeWArray, bool preconfigured, bool constant, bool compileTimeConstant, object valueAsProvided, ImportService importService, ExtensionClass extensionClass, EventBeanTypedEventFactory eventBeanTypedEventFactory, EventTypeRepositoryImpl eventTypeRepositoryPreconfigured, BeanEventTypeFactory beanEventTypeFactory) { // Determine the variable type var primitiveType = TypeHelper.GetPrimitiveTypeForName(variableTypeWArray.ClassIdentifier); var type = TypeHelper.GetTypeForSimpleName(variableTypeWArray.ClassIdentifier).GetBoxedType(); Type arrayType = null; EventType eventType = null; if (type == null) { if (variableTypeWArray.ClassIdentifier.Equals("object", StringComparison.InvariantCultureIgnoreCase)) { type = TypeHelper.GetArrayType(typeof(object), variableTypeWArray.ArrayDimensions); } if (type == null) { eventType = eventTypeRepositoryPreconfigured.GetTypeByName(variableTypeWArray.ClassIdentifier); if (eventType != null) { type = eventType.UnderlyingType; } } ImportException lastException = null; if (type == null) { try { type = importService.ResolveClass(variableTypeWArray.ClassIdentifier, false, extensionClass); type = TypeHelper.GetArrayType(type, variableTypeWArray.ArrayDimensions); } catch (ImportException e) { Log.Debug("Not found '" + type + "': " + e.Message, e); lastException = e; // expected } } if (type == null) { throw new VariableTypeException( "Cannot create variable '" + variableName + "', type '" + variableTypeWArray.ClassIdentifier + "' is not a recognized type", lastException); } if (variableTypeWArray.ArrayDimensions > 0 && eventType != null) { throw new VariableTypeException( "Cannot create variable '" + variableName + "', type '" + variableTypeWArray.ClassIdentifier + "' cannot be declared as an array type as it is an event type", lastException); } } else { if (variableTypeWArray.ArrayDimensions > 0) { if (variableTypeWArray.IsArrayOfPrimitive) { if (primitiveType == null) { throw new VariableTypeException( "Cannot create variable '" + variableName + "', type '" + variableTypeWArray.ClassIdentifier + "' is not a primitive type"); } arrayType = TypeHelper.GetArrayType(primitiveType, variableTypeWArray.ArrayDimensions); } else { arrayType = TypeHelper.GetArrayType(type, variableTypeWArray.ArrayDimensions); } } } if (eventType == null && !type.IsBuiltinDataType() && type != typeof(object) && !type.IsArray && !type.IsEnum) { if (variableTypeWArray.ArrayDimensions > 0) { throw new VariableTypeException( "Cannot create variable '" + variableName + "', type '" + variableTypeWArray.ClassIdentifier + "' cannot be declared as an array, only scalar types can be array"); } eventType = beanEventTypeFactory.GetCreateBeanType(type, false); } if (arrayType != null) { type = arrayType; } var coerced = GetCoercedValue(valueAsProvided, eventType, variableName, type, eventBeanTypedEventFactory); return new VariableMetaData( variableName, variableModuleName, variableVisibility, optionalContextName, optionalContextVisibility, optionalContextModule, type, eventType, preconfigured, constant, compileTimeConstant, coerced, true); }
private static ModuleCompileTimeServices GetServices( CompilerArguments arguments, string moduleName, ICollection<string> moduleUses, bool isFireAndForget) { var configuration = arguments.Configuration; var path = arguments.Path; var options = arguments.Options; // script var scriptCompiler = MakeScriptCompiler(configuration); // imports var importServiceCompileTime = MakeImportService(configuration); var classLoaderParent = new ParentClassLoader(importServiceCompileTime.ClassLoader); var container = importServiceCompileTime.Container; // resolve pre-configured bean event types, make bean-stem service var resolvedBeanEventTypes = BeanEventTypeRepoUtil.ResolveBeanEventTypes( configuration.Common.EventTypeNames, importServiceCompileTime); var beanEventTypeStemService = BeanEventTypeRepoUtil.MakeBeanEventTypeStemService( configuration, resolvedBeanEventTypes, EventBeanTypedEventFactoryCompileTime.INSTANCE); // allocate repositories var eventTypeRepositoryPreconfigured = new EventTypeRepositoryImpl(true); var eventTypeCompileRegistry = new EventTypeCompileTimeRegistry(eventTypeRepositoryPreconfigured); var beanEventTypeFactoryPrivate = new BeanEventTypeFactoryPrivate( EventBeanTypedEventFactoryCompileTime.INSTANCE, EventTypeFactoryImpl.GetInstance(container), beanEventTypeStemService); var variableRepositoryPreconfigured = new VariableRepositoryPreconfigured(); // allocate path registries var pathEventTypes = new PathRegistry<string, EventType>(PathRegistryObjectType.EVENTTYPE); var pathNamedWindows = new PathRegistry<string, NamedWindowMetaData>(PathRegistryObjectType.NAMEDWINDOW); var pathTables = new PathRegistry<string, TableMetaData>(PathRegistryObjectType.TABLE); var pathContexts = new PathRegistry<string, ContextMetaData>(PathRegistryObjectType.CONTEXT); var pathVariables = new PathRegistry<string, VariableMetaData>(PathRegistryObjectType.VARIABLE); var pathExprDeclared = new PathRegistry<string, ExpressionDeclItem>(PathRegistryObjectType.EXPRDECL); var pathScript = new PathRegistry<NameAndParamNum, ExpressionScriptProvided>(PathRegistryObjectType.SCRIPT); var pathClassProvided = new PathRegistry<string, ClassProvided>(PathRegistryObjectType.CLASSPROVIDED); // add runtime-path which is the information an existing runtime may have if (path.CompilerPathables != null) { foreach (EPCompilerPathable pathable in path.CompilerPathables) { EPCompilerPathableImpl impl = (EPCompilerPathableImpl) pathable; pathVariables.MergeFrom(impl.VariablePathRegistry); pathEventTypes.MergeFrom(impl.EventTypePathRegistry); pathExprDeclared.MergeFrom(impl.ExprDeclaredPathRegistry); pathNamedWindows.MergeFrom(impl.NamedWindowPathRegistry); pathTables.MergeFrom(impl.TablePathRegistry); pathContexts.MergeFrom(impl.ContextPathRegistry); pathScript.MergeFrom(impl.ScriptPathRegistry); pathClassProvided.MergeFrom(impl.ClassProvidedPathRegistry); eventTypeRepositoryPreconfigured.MergeFrom(impl.EventTypePreconfigured); variableRepositoryPreconfigured.MergeFrom(impl.VariablePreconfigured); JsonEventTypeUtility.AddJsonUnderlyingClass(pathEventTypes, classLoaderParent); } } // build preconfigured type system EventTypeRepositoryBeanTypeUtil.BuildBeanTypes( beanEventTypeStemService, eventTypeRepositoryPreconfigured, resolvedBeanEventTypes, beanEventTypeFactoryPrivate, configuration.Common.EventTypesBean); EventTypeRepositoryMapTypeUtil.BuildMapTypes( eventTypeRepositoryPreconfigured, configuration.Common.MapTypeConfigurations, configuration.Common.EventTypesMapEvents, configuration.Common.EventTypesNestableMapEvents, beanEventTypeFactoryPrivate, importServiceCompileTime); EventTypeRepositoryOATypeUtil.BuildOATypes( eventTypeRepositoryPreconfigured, configuration.Common.ObjectArrayTypeConfigurations, configuration.Common.EventTypesNestableObjectArrayEvents, beanEventTypeFactoryPrivate, importServiceCompileTime); XMLFragmentEventTypeFactory xmlFragmentEventTypeFactory = new XMLFragmentEventTypeFactory( beanEventTypeFactoryPrivate, eventTypeCompileRegistry, eventTypeRepositoryPreconfigured); EventTypeRepositoryXMLTypeUtil.BuildXMLTypes( eventTypeRepositoryPreconfigured, configuration.Common.EventTypesXMLDOM, beanEventTypeFactoryPrivate, xmlFragmentEventTypeFactory, container.ResourceManager()); EventTypeAvroHandler eventTypeAvroHandler = EventTypeAvroHandlerFactory.Resolve( importServiceCompileTime, configuration.Common.EventMeta.AvroSettings, EventTypeAvroHandlerConstants.COMPILE_TIME_HANDLER_IMPL); EventTypeRepositoryAvroTypeUtil.BuildAvroTypes( eventTypeRepositoryPreconfigured, configuration.Common.EventTypesAvro, eventTypeAvroHandler, beanEventTypeFactoryPrivate.EventBeanTypedEventFactory); EventTypeRepositoryVariantStreamUtil.BuildVariantStreams( eventTypeRepositoryPreconfigured, configuration.Common.VariantStreams, EventTypeFactoryImpl.GetInstance(container)); // build preconfigured variables VariableUtil.ConfigureVariables( variableRepositoryPreconfigured, configuration.Common.Variables, importServiceCompileTime, EventBeanTypedEventFactoryCompileTime.INSTANCE, eventTypeRepositoryPreconfigured, beanEventTypeFactoryPrivate); var deploymentNumber = -1; foreach (var unit in path.Compileds) { deploymentNumber++; var provider = ModuleProviderUtil.Analyze(unit, classLoaderParent, pathClassProvided); var unitModuleName = provider.ModuleProvider.ModuleName; // initialize event types var moduleTypes = new Dictionary<string, EventType>(); var eventTypeResolver = new EventTypeResolverImpl( moduleTypes, pathEventTypes, eventTypeRepositoryPreconfigured, beanEventTypeFactoryPrivate, EventSerdeFactoryDefault.INSTANCE); var eventTypeCollector = new EventTypeCollectorImpl( container, moduleTypes, beanEventTypeFactoryPrivate, provider.ClassLoader, EventTypeFactoryImpl.GetInstance(container), beanEventTypeStemService, eventTypeResolver, xmlFragmentEventTypeFactory, eventTypeAvroHandler, EventBeanTypedEventFactoryCompileTime.INSTANCE, importServiceCompileTime); try { provider.ModuleProvider.InitializeEventTypes( new EPModuleEventTypeInitServicesImpl(eventTypeCollector, eventTypeResolver)); } catch (Exception e) { throw new EPException(e); } JsonEventTypeUtility.AddJsonUnderlyingClass(moduleTypes, classLoaderParent, null); // initialize named windows var moduleNamedWindows = new Dictionary<string, NamedWindowMetaData>(); var namedWindowCollector = new NamedWindowCollectorImpl(moduleNamedWindows); try { provider.ModuleProvider.InitializeNamedWindows( new EPModuleNamedWindowInitServicesImpl(namedWindowCollector, eventTypeResolver)); } catch (Exception e) { throw new EPException(e); } // initialize tables var moduleTables = new Dictionary<string, TableMetaData>(); var tableCollector = new TableCollectorImpl(moduleTables); try { provider.ModuleProvider.InitializeTables( new EPModuleTableInitServicesImpl(tableCollector, eventTypeResolver)); } catch (Exception e) { throw new EPException(e); } // initialize create-index indexes var indexCollector = new IndexCollectorCompileTime( moduleNamedWindows, moduleTables, pathNamedWindows, pathTables); try { provider.ModuleProvider.InitializeIndexes(new EPModuleIndexInitServicesImpl(indexCollector)); } catch (Exception e) { throw new EPException(e); } // initialize create-contexts var moduleContexts = new Dictionary<string, ContextMetaData>(); var contextCollector = new ContextCollectorImpl(moduleContexts); try { provider.ModuleProvider.InitializeContexts( new EPModuleContextInitServicesImpl(contextCollector, eventTypeResolver)); } catch (Exception e) { throw new EPException(e); } // initialize variables var moduleVariables = new Dictionary<string, VariableMetaData>(); var variableCollector = new VariableCollectorImpl(moduleVariables); try { provider.ModuleProvider.InitializeVariables( new EPModuleVariableInitServicesImpl(variableCollector, eventTypeResolver)); } catch (Exception e) { throw new EPException(e); } // initialize module expressions var moduleExprDeclareds = new Dictionary<string, ExpressionDeclItem>(); var exprDeclaredCollector = new ExprDeclaredCollectorCompileTime(moduleExprDeclareds); try { provider.ModuleProvider.InitializeExprDeclareds( new EPModuleExprDeclaredInitServicesImpl(exprDeclaredCollector)); } catch (Exception e) { throw new EPException(e); } // initialize module scripts var moduleScripts = new Dictionary<NameAndParamNum, ExpressionScriptProvided>(); var scriptCollector = new ScriptCollectorCompileTime(moduleScripts); try { provider.ModuleProvider.InitializeScripts(new EPModuleScriptInitServicesImpl(scriptCollector)); } catch (Exception e) { throw new EPException(e); } // initialize inlined classes var moduleClassProvideds = new Dictionary<string, ClassProvided>(); var classProvidedCollector = new ClassProvidedCollectorCompileTime(moduleClassProvideds, classLoaderParent); try { provider.ModuleProvider.InitializeClassProvided(new EPModuleClassProvidedInitServicesImpl(classProvidedCollector)); } catch (Exception e) { throw new EPException(e); } // save path-visibility event types and named windows to the path var deploymentId = "D" + deploymentNumber; try { foreach (var type in moduleTypes) { if (type.Value.Metadata.AccessModifier.IsNonPrivateNonTransient()) { pathEventTypes.Add(type.Key, unitModuleName, type.Value, deploymentId); } } foreach (var entry in moduleNamedWindows) { if (entry.Value.EventType.Metadata.AccessModifier.IsNonPrivateNonTransient()) { pathNamedWindows.Add(entry.Key, unitModuleName, entry.Value, deploymentId); } } foreach (var entry in moduleTables) { if (entry.Value.TableVisibility.IsNonPrivateNonTransient()) { pathTables.Add(entry.Key, unitModuleName, entry.Value, deploymentId); } } foreach (var entry in moduleContexts) { if (entry.Value.ContextVisibility.IsNonPrivateNonTransient()) { pathContexts.Add(entry.Key, unitModuleName, entry.Value, deploymentId); } } foreach (var entry in moduleVariables) { if (entry.Value.VariableVisibility.IsNonPrivateNonTransient()) { pathVariables.Add(entry.Key, unitModuleName, entry.Value, deploymentId); } } foreach (var entry in moduleExprDeclareds) { if (entry.Value.Visibility.IsNonPrivateNonTransient()) { pathExprDeclared.Add(entry.Key, unitModuleName, entry.Value, deploymentId); } } foreach (var entry in moduleScripts) { if (entry.Value.Visibility.IsNonPrivateNonTransient()) { pathScript.Add(entry.Key, unitModuleName, entry.Value, deploymentId); } } foreach (var entry in moduleClassProvideds) { if (entry.Value.Visibility.IsNonPrivateNonTransient()) { pathClassProvided.Add(entry.Key, unitModuleName, entry.Value, deploymentId); } } } catch (PathException ex) { throw new EPCompileException( "Invalid path: " + ex.Message, ex, new EmptyList<EPCompileExceptionItem>()); } } var moduleDependencies = new ModuleDependenciesCompileTime(); // build bean space of public and protected var eventTypeCompileTimeResolver = new EventTypeCompileTimeResolver( moduleName, moduleUses, eventTypeCompileRegistry, eventTypeRepositoryPreconfigured, pathEventTypes, moduleDependencies, isFireAndForget); // build named window registry var namedWindowCompileTimeRegistry = new NamedWindowCompileTimeRegistry(); var namedWindowCompileTimeResolver = new NamedWindowCompileTimeResolverImpl( moduleName, moduleUses, namedWindowCompileTimeRegistry, pathNamedWindows, moduleDependencies, isFireAndForget); // build context registry var contextCompileTimeRegistry = new ContextCompileTimeRegistry(); var contextCompileTimeResolver = new ContextCompileTimeResolverImpl( moduleName, moduleUses, contextCompileTimeRegistry, pathContexts, moduleDependencies, isFireAndForget); // build variable registry var variableCompileTimeRegistry = new VariableCompileTimeRegistry(); var variableCompileTimeResolver = new VariableCompileTimeResolverImpl( moduleName, moduleUses, variableRepositoryPreconfigured, variableCompileTimeRegistry, pathVariables, moduleDependencies, isFireAndForget); // build declared-expression registry var exprDeclaredCompileTimeRegistry = new ExprDeclaredCompileTimeRegistry(); var exprDeclaredCompileTimeResolver = new ExprDeclaredCompileTimeResolverImpl( moduleName, moduleUses, exprDeclaredCompileTimeRegistry, pathExprDeclared, moduleDependencies, isFireAndForget); // build table-registry var localTables = new Dictionary<string, TableMetaData>(); var tableCompileTimeRegistry = new TableCompileTimeRegistry(localTables); var tableCompileTimeResolver = new TableCompileTimeResolverImpl( moduleName, moduleUses, tableCompileTimeRegistry, pathTables, moduleDependencies, isFireAndForget); // build script registry var scriptCompileTimeRegistry = new ScriptCompileTimeRegistry(); var scriptCompileTimeResolver = new ScriptCompileTimeResolverImpl( moduleName, moduleUses, scriptCompileTimeRegistry, pathScript, moduleDependencies, isFireAndForget); // build classes registry var classProvidedCompileTimeRegistry = new ClassProvidedCompileTimeRegistry(); var classProvidedCompileTimeResolver = new ClassProvidedCompileTimeResolverImpl( moduleName, moduleUses, classProvidedCompileTimeRegistry, pathClassProvided, moduleDependencies, isFireAndForget); // view resolution var plugInViews = new PluggableObjectCollection(); plugInViews.AddViews( configuration.Compiler.PlugInViews, configuration.Compiler.PlugInVirtualDataWindows, importServiceCompileTime); var viewRegistry = new PluggableObjectRegistryImpl(new[] {ViewEnumHelper.BuiltinViews, plugInViews}); ViewResolutionService viewResolutionService = new ViewResolutionServiceImpl(viewRegistry); var plugInPatternObj = new PluggableObjectCollection(); plugInPatternObj.AddPatternObjects(configuration.Compiler.PlugInPatternObjects, importServiceCompileTime); plugInPatternObj.AddObjects(PatternObjectHelper.BuiltinPatternObjects); PatternObjectResolutionService patternResolutionService = new PatternObjectResolutionServiceImpl(plugInPatternObj); var indexCompileTimeRegistry = new IndexCompileTimeRegistry(new Dictionary<IndexCompileTimeKey, IndexDetailForge>()); var moduleVisibilityRules = new ModuleAccessModifierServiceImpl(options, configuration.Compiler.ByteCode); var databaseConfigServiceCompileTime = new DatabaseConfigServiceImpl( container, configuration.Common.DatabaseReferences, importServiceCompileTime); var compilerServices = new CompilerServicesImpl(); var targetHA = configuration.GetType().Name.EndsWith("ConfigurationHA"); var serdeEventTypeRegistry = new SerdeEventTypeCompileTimeRegistryImpl(targetHA); SerdeCompileTimeResolver serdeResolver = targetHA ? MakeSerdeResolver(configuration.Compiler.Serde, configuration.Common.TransientConfiguration) : SerdeCompileTimeResolverNonHA.INSTANCE; return new ModuleCompileTimeServices( container, compilerServices, configuration, contextCompileTimeRegistry, contextCompileTimeResolver, beanEventTypeStemService, beanEventTypeFactoryPrivate, classProvidedCompileTimeRegistry, classProvidedCompileTimeResolver, databaseConfigServiceCompileTime, importServiceCompileTime, exprDeclaredCompileTimeRegistry, exprDeclaredCompileTimeResolver, eventTypeAvroHandler, eventTypeCompileRegistry, eventTypeCompileTimeResolver, eventTypeRepositoryPreconfigured, isFireAndForget, indexCompileTimeRegistry, moduleDependencies, moduleVisibilityRules, namedWindowCompileTimeResolver, namedWindowCompileTimeRegistry, classLoaderParent, patternResolutionService, scriptCompileTimeRegistry, scriptCompileTimeResolver, scriptCompiler, serdeEventTypeRegistry, serdeResolver, tableCompileTimeRegistry, tableCompileTimeResolver, variableCompileTimeRegistry, variableCompileTimeResolver, viewResolutionService, xmlFragmentEventTypeFactory); }