Esempio n. 1
0
        public StatementAIResourceRegistry AllocateAgentInstanceResourceRegistry(
            AIRegistryRequirements registryRequirements)
        {
            if (ContextDefinition.ControllerFactories.Length == 1) {
                return ContextDefinition.ControllerFactories[0]
                    .AllocateAgentInstanceResourceRegistry(registryRequirements);
            }

            return AIRegistryUtil.AllocateRegistries(registryRequirements, AIRegistryFactoryMap.INSTANCE);
        }
Esempio n. 2
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));
        }
 public override StatementAIResourceRegistry AllocateAgentInstanceResourceRegistry(
     AIRegistryRequirements registryRequirements)
 {
     return AIRegistryUtil.AllocateRegistries(registryRequirements, AIRegistryFactoryMultiPerm.INSTANCE);
 }