Beispiel #1
0
        public override void Activate(
            IntSeqKey path,
            object[] parentPartitionKeys,
            EventBean optionalTriggeringEvent,
            IDictionary<string, object> optionalTriggeringPattern)
        {
            hashSvc.MgmtCreate(path, parentPartitionKeys);

            if (factory.HashSpec.IsPreallocate) {
                int[] subpathOrCPIds = ActivateByPreallocate(path, parentPartitionKeys, optionalTriggeringEvent);
                hashSvc.MgmtSetSubpathOrCPIdsWhenPreallocate(path, subpathOrCPIds);
                return;
            }

            ContextControllerDetailHashItem[] hashItems = factory.HashSpec.Items;
            ContextControllerFilterEntry[] filterEntries = new ContextControllerFilterEntry[hashItems.Length];

            for (int i = 0; i < hashItems.Length; i++) {
                ContextControllerDetailHashItem item = hashItems[i];
                filterEntries[i] = new ContextControllerHashFilterEntry(this, path, item, parentPartitionKeys);

                if (optionalTriggeringEvent != null) {
                    bool match = AgentInstanceUtil.EvaluateFilterForStatement(
                        optionalTriggeringEvent,
                        realization.AgentInstanceContextCreate,
                        filterEntries[i].FilterHandle);

                    if (match) {
                        MatchFound(item, optionalTriggeringEvent, path);
                    }
                }
            }

            hashSvc.MgmtSetFilters(path, filterEntries);
        }
Beispiel #2
0
        private ContextControllerFilterEntry[] ActivateFiltersFromPartitionKeys(
            EventBean optionalTriggeringEvent,
            IntSeqKey controllerPath,
            object[] parentPartitionKeys)
        {
            var items = KeyedFactory.KeyedSpec.Items;
            var filterEntries = new ContextControllerFilterEntry[items.Length];
            for (var i = 0; i < items.Length; i++) {
                filterEntries[i] = ActivateFilterNoInit(
                    items[i],
                    optionalTriggeringEvent,
                    controllerPath,
                    parentPartitionKeys);
            }

            return filterEntries;
        }
Beispiel #3
0
        private ContextControllerFilterEntry[] ActivateFiltersFromInit(
            EventBean optionalTriggeringEvent,
            IntSeqKey controllerPath,
            object[] parentPartitionKeys)
        {
            var inits = factory.KeyedSpec.OptionalInit;
            var filterEntries = new ContextControllerFilterEntry[inits.Length];
            for (var i = 0; i < inits.Length; i++) {
                var init = inits[i];
                var found = ContextControllerKeyedUtil.FindInitMatchingKey(factory.KeyedSpec.Items, init);
                filterEntries[i] = ActivateFilterWithInit(
                    init,
                    found,
                    optionalTriggeringEvent,
                    controllerPath,
                    parentPartitionKeys);
            }

            return filterEntries;
        }