当前位置: 首页>>代码示例>>Java>>正文


Java ContextDetailCategoryItem类代码示例

本文整理汇总了Java中com.espertech.esper.epl.spec.ContextDetailCategoryItem的典型用法代码示例。如果您正苦于以下问题:Java ContextDetailCategoryItem类的具体用法?Java ContextDetailCategoryItem怎么用?Java ContextDetailCategoryItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ContextDetailCategoryItem类属于com.espertech.esper.epl.spec包,在下文中一共展示了ContextDetailCategoryItem类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deletePath

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void deletePath(ContextPartitionIdentifier identifier) {
    ContextPartitionIdentifierCategory category = (ContextPartitionIdentifierCategory) identifier;
    int count = 0;
    for (ContextDetailCategoryItem cat : factory.getCategorySpec().getItems()) {
        if (cat.getName().equals(category.getLabel())) {
            handleCategories.remove(count);
            break;
        }
        count++;
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:12,代码来源:ContextControllerCategory.java

示例2: activate

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void activate(EventBean optionalTriggeringEvent, Map<String, Object> optionalTriggeringPattern, ContextControllerState controllerState, ContextInternalFilterAddendum activationFilterAddendum, Integer importPathId) {
    if (factory.getFactoryContext().getNestingLevel() == 1) {
        controllerState = ContextControllerStateUtil.getRecoveryStates(factory.getFactoryContext().getStateCache(), factory.getFactoryContext().getOutermostContextName());
    }

    if (controllerState == null) {
        int count = 0;
        for (ContextDetailCategoryItem category : factory.getCategorySpec().getItems()) {
            Map<String, Object> context = ContextPropertyEventType.getCategorizedBean(factory.getFactoryContext().getContextName(), 0, category.getName());
            currentSubpathId++;

            // merge filter addendum, if any
            ContextInternalFilterAddendum filterAddendumToUse = activationFilterAddendum;
            if (factory.hasFiltersSpecsNestedContexts()) {
                filterAddendumToUse = activationFilterAddendum != null ? activationFilterAddendum.deepCopy() : new ContextInternalFilterAddendum();
                factory.populateContextInternalFilterAddendums(filterAddendumToUse, count);
            }

            ContextControllerInstanceHandle handle = activationCallback.contextPartitionInstantiate(null, currentSubpathId, null, this, optionalTriggeringEvent, optionalTriggeringPattern, count, context, controllerState, filterAddendumToUse, factory.getFactoryContext().isRecoveringResilient(), ContextPartitionState.STARTED, () -> new ContextPartitionIdentifierCategory(category.getName()));
            handleCategories.put(count, handle);

            factory.getFactoryContext().getStateCache().addContextPath(factory.getFactoryContext().getOutermostContextName(), factory.getFactoryContext().getNestingLevel(), pathId, currentSubpathId, handle.getContextPartitionOrPathId(), count, factory.getBinding());
            count++;
        }
        return;
    }

    int pathIdToUse = importPathId != null ? importPathId : pathId;
    initializeFromState(optionalTriggeringEvent, optionalTriggeringPattern, activationFilterAddendum, controllerState, pathIdToUse, null, false);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:31,代码来源:ContextControllerCategory.java

示例3: addAddendums

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
private static void addAddendums(IdentityHashMap<FilterSpecCompiled, FilterValueSetParam[][]> addendums, FilterSpecCompiled filtersSpec, ContextDetailCategoryItem category, ContextDetailCategory categorySpec) {
    FilterValueSetParam[][] categoryEventFilters = categorySpec.getFilterParamsCompiled();
    FilterValueSetParam[][] categoryItemFilters = category.getCompiledFilterParam();

    FilterValueSetParam[][] addendum = FilterAddendumUtil.multiplyAddendum(categoryEventFilters, categoryItemFilters);

    FilterValueSetParam[][] existingFilters = addendums.get(filtersSpec);
    if (existingFilters != null) {
        addendum = FilterAddendumUtil.multiplyAddendum(existingFilters, addendum);
    }

    addendums.put(filtersSpec, addendum);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:14,代码来源:ContextControllerCategoryFactoryBase.java

示例4: findCategoryForName

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
private ContextDetailCategoryItem findCategoryForName(String categoryLabel) {
    for (ContextDetailCategoryItem item : categorySpec.getItems()) {
        if (item.getName().equals(categoryLabel)) {
            return item;
        }
    }
    throw new IllegalStateException("Failed to find category '" + categoryLabel + "'");
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:ContextControllerCategoryFactory.java

示例5: getSelectedContextPartitionPathIds

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public Collection<Integer> getSelectedContextPartitionPathIds(ContextPartitionSelector contextPartitionSelector) {
    if (contextPartitionSelector instanceof ContextPartitionSelectorFiltered) {
        ContextPartitionSelectorFiltered filter = (ContextPartitionSelectorFiltered) contextPartitionSelector;
        ContextPartitionIdentifierCategory identifier = new ContextPartitionIdentifierCategory();
        List<Integer> accepted = new ArrayList<Integer>();
        for (Map.Entry<Integer, ContextControllerInstanceHandle> entry : handleCategories.entrySet()) {
            identifier.setContextPartitionId(entry.getValue().getContextPartitionOrPathId());
            identifier.setLabel(factory.getCategorySpec().getItems().get(entry.getKey()).getName());
            if (filter.filter(identifier)) {
                accepted.add(entry.getValue().getContextPartitionOrPathId());
            }
        }
        return accepted;
    }
    if (contextPartitionSelector instanceof ContextPartitionSelectorCategory) {
        ContextPartitionSelectorCategory category = (ContextPartitionSelectorCategory) contextPartitionSelector;
        if (category.getLabels() == null || category.getLabels().isEmpty()) {
            return Collections.emptyList();
        }
        List<Integer> items = new ArrayList<Integer>();
        int count = 0;
        for (ContextDetailCategoryItem item : factory.getCategorySpec().getItems()) {
            if (category.getLabels().contains(item.getName())) {
                ContextControllerInstanceHandle handle = handleCategories.get(count);
                if (handle != null) {
                    items.add(handle.getContextPartitionOrPathId());
                }
            }
            count++;
        }
        return items;
    }
    throw ContextControllerSelectorUtil.getInvalidSelector(new Class[] {ContextPartitionSelectorCategory.class}, contextPartitionSelector);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:35,代码来源:ContextControllerCategory.java

示例6: initializeFromState

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
private void initializeFromState(EventBean optionalTriggeringEvent,
                                 Map<String, Object> optionalTriggeringPattern,
                                 ContextInternalFilterAddendum activationFilterAddendum,
                                 ContextControllerState controllerState,
                                 int pathIdToUse,
                                 AgentInstanceSelector agentInstanceSelector,
                                 boolean loadingExistingState) {
    TreeMap<ContextStatePathKey, ContextStatePathValue> states = controllerState.getStates();
    NavigableMap<ContextStatePathKey, ContextStatePathValue> childContexts = ContextControllerStateUtil.getChildContexts(factory.getFactoryContext(), pathIdToUse, states);

    int maxSubpathId = Integer.MIN_VALUE;
    for (Map.Entry<ContextStatePathKey, ContextStatePathValue> entry : childContexts.entrySet()) {

        int categoryNumber = (Integer) factory.getBinding().byteArrayToObject(entry.getValue().getBlob(), null);
        ContextDetailCategoryItem category = factory.getCategorySpec().getItems().get(categoryNumber);

        // merge filter addendum, if any
        ContextInternalFilterAddendum filterAddendumToUse = activationFilterAddendum;
        if (factory.hasFiltersSpecsNestedContexts()) {
            filterAddendumToUse = activationFilterAddendum != null ? activationFilterAddendum.deepCopy() : new ContextInternalFilterAddendum();
            factory.populateContextInternalFilterAddendums(filterAddendumToUse, categoryNumber);
        }

        // check if exists already
        if (controllerState.isImported()) {
            ContextControllerInstanceHandle existingHandle = handleCategories.get(categoryNumber);
            if (existingHandle != null) {
                activationCallback.contextPartitionNavigate(existingHandle, this, controllerState, entry.getValue().getOptionalContextPartitionId(), filterAddendumToUse, agentInstanceSelector, entry.getValue().getBlob(), loadingExistingState);
                continue;
            }
        }

        Map<String, Object> context = ContextPropertyEventType.getCategorizedBean(factory.getFactoryContext().getContextName(), 0, category.getName());

        int contextPartitionId = entry.getValue().getOptionalContextPartitionId();
        int assignedSubPathId = !controllerState.isImported() ? entry.getKey().getSubPath() : ++currentSubpathId;
        ContextControllerInstanceHandle handle = activationCallback.contextPartitionInstantiate(contextPartitionId, assignedSubPathId, entry.getKey().getSubPath(), this, null, null, categoryNumber, context, controllerState, filterAddendumToUse, loadingExistingState || factory.getFactoryContext().isRecoveringResilient(), entry.getValue().getState(), () -> new ContextPartitionIdentifierCategory(category.getName()));
        handleCategories.put(categoryNumber, handle);

        if (entry.getKey().getSubPath() > maxSubpathId) {
            maxSubpathId = assignedSubPathId;
        }
    }
    if (!controllerState.isImported()) {
        currentSubpathId = maxSubpathId != Integer.MIN_VALUE ? maxSubpathId : 0;
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:48,代码来源:ContextControllerCategory.java

示例7: populateFilterAddendums

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void populateFilterAddendums(IdentityHashMap<FilterSpecCompiled, FilterValueSetParam[][]> filterAddendum, ContextControllerStatementDesc statement, Object categoryIndex, int contextId) {
    ContextControllerStatementCtxCacheFilters statementInfo = (ContextControllerStatementCtxCacheFilters) statement.getCaches()[factoryContext.getNestingLevel() - 1];
    ContextDetailCategoryItem category = categorySpec.getItems().get((Integer) categoryIndex);
    getAddendumFilters(filterAddendum, category, categorySpec, statementInfo.getFilterSpecs(), statement);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:6,代码来源:ContextControllerCategoryFactoryBase.java

示例8: populateContextInternalFilterAddendums

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void populateContextInternalFilterAddendums(ContextInternalFilterAddendum filterAddendum, Object categoryIndex) {
    ContextDetailCategoryItem category = categorySpec.getItems().get((Integer) categoryIndex);
    getAddendumFilters(filterAddendum.getFilterAddendum(), category, categorySpec, filtersSpecsNestedContexts, null);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:5,代码来源:ContextControllerCategoryFactoryBase.java

示例9: populateFilterAddendums

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void populateFilterAddendums(IdentityHashMap<FilterSpecCompiled, List<FilterValueSetParam>> filterAddendum, ContextControllerStatementDesc statement, Object categoryLabel, int contextId) {
    ContextControllerStatementCtxCacheFilters statementInfo = (ContextControllerStatementCtxCacheFilters) statement.getCaches()[factoryContext.getNestingLevel() - 1];
    ContextDetailCategoryItem category = findCategoryForName((String) categoryLabel);
    getAddendumFilters(filterAddendum, category, categorySpec, statementInfo.getFilterSpecs(), statement);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:6,代码来源:ContextControllerCategoryFactory.java

示例10: populateContextInternalFilterAddendums

import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void populateContextInternalFilterAddendums(ContextInternalFilterAddendum filterAddendum, Object categoryLabel) {
    ContextDetailCategoryItem category = findCategoryForName((String) categoryLabel);
    getAddendumFilters(filterAddendum.getFilterAddendum(), category, categorySpec, filtersSpecsNestedContexts, null);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:5,代码来源:ContextControllerCategoryFactory.java


注:本文中的com.espertech.esper.epl.spec.ContextDetailCategoryItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。