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


Java ContextProcessor类代码示例

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


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

示例1: execute

import danta.api.ContextProcessor; //导入依赖的package包/类
@Override
public List<String> execute(ExecutionContext executionContext, ContentModel contentModel)
        throws AcceptsException, ProcessException {
    List<String> currentProcessorChain = Collections.synchronizedList(new ArrayList<>());
    for (List<ContextProcessor> processorsSamePriority : contextProcessors.values()) {
        processorsSamePriority.parallelStream().forEach(processor -> {
            try {
                if (processor.accepts(executionContext)) {
                    processor.process(executionContext, contentModel);
                    currentProcessorChain.add(processor.getClass().getName());
                }
            } catch (Exception e) {
                LOG.error("Exception in parallel stream execution", e);
                throw new RuntimeException(e);
            }
        });
    }
    return currentProcessorChain;
}
 
开发者ID:DantaFramework,项目名称:Core,代码行数:20,代码来源:ContextProcessorEngineImpl.java

示例2: bindProcessor

import danta.api.ContextProcessor; //导入依赖的package包/类
public void bindProcessor(ContextProcessor processor) {
    List<ContextProcessor> contextProcessorsSamePriority = this.contextProcessors.get(processor.priority());
    if (contextProcessorsSamePriority == null) {
        contextProcessorsSamePriority = new ArrayList<>();
    }
    contextProcessorsSamePriority.add(processor);
    contextProcessors.put(processor.priority(), contextProcessorsSamePriority);
}
 
开发者ID:DantaFramework,项目名称:Core,代码行数:9,代码来源:ContextProcessorEngineImpl.java

示例3: unbindProcessor

import danta.api.ContextProcessor; //导入依赖的package包/类
public void unbindProcessor(ContextProcessor processor) {
    List<ContextProcessor> contextProcessorsSamePriority = this.contextProcessors.get(processor.priority());
    contextProcessorsSamePriority.remove(processor);
}
 
开发者ID:DantaFramework,项目名称:Core,代码行数:5,代码来源:ContextProcessorEngineImpl.java


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