Exemple #1
0
        public void InitializeFactory(DataFlowOpFactoryInitializeContext context)
        {
            var ha = context.StatementContext.ViewFactoryService != ViewFactoryServiceImpl.INSTANCE;
            if (ha) {
                throw new EPException("The select-operator is not supported in the HA environment");
            }

            AdapterFactories = new EventBeanAdapterFactory[EventTypes.Length];
            for (var i = 0; i < EventTypes.Length; i++) {
                if (EventTypes[i] != null) {
                    AdapterFactories[i] = EventTypeUtility.GetAdapterFactoryForType(
                        EventTypes[i], context.StatementContext.EventBeanTypedEventFactory,
                        context.StatementContext.EventTypeAvroHandler);
                }
            }

            FactorySelect = (StatementAgentInstanceFactorySelect) FactoryProvider.Factory;
            var registryRequirements = FactorySelect.RegistryRequirements;
            ResourceRegistry = AIRegistryUtil.AllocateRegistries(registryRequirements, AIRegistryFactoryMap.INSTANCE);
            FactoryProvider.Assign(new StatementAIFactoryAssignmentContext(ResourceRegistry));
        }