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


Java OnCompletionDefinition类代码示例

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


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

示例1: doGetRouteScopedServices

import org.apache.camel.model.OnCompletionDefinition; //导入依赖的package包/类
/**
 * Gather all other kind of route scoped services from the given route, except error handler
 */
private void doGetRouteScopedServices(List<Service> services, Route route) {
    for (ProcessorDefinition<?> output : route.getRouteContext().getRoute().getOutputs()) {
        if (output instanceof OnExceptionDefinition) {
            OnExceptionDefinition onExceptionDefinition = (OnExceptionDefinition) output;
            if (onExceptionDefinition.isRouteScoped()) {
                Processor errorHandler = onExceptionDefinition.getErrorHandler(route.getId());
                if (errorHandler != null && errorHandler instanceof Service) {
                    services.add((Service) errorHandler);
                }
            }
        } else if (output instanceof OnCompletionDefinition) {
            OnCompletionDefinition onCompletionDefinition = (OnCompletionDefinition) output;
            if (onCompletionDefinition.isRouteScoped()) {
                Processor onCompletionProcessor = onCompletionDefinition.getOnCompletion(route.getId());
                if (onCompletionProcessor != null && onCompletionProcessor instanceof Service) {
                    services.add((Service) onCompletionProcessor);
                }
            }
        }
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:25,代码来源:RouteService.java

示例2: isContextScoped

import org.apache.camel.model.OnCompletionDefinition; //导入依赖的package包/类
private boolean isContextScoped() {
    if (definition instanceof OnExceptionDefinition) {
        return !((OnExceptionDefinition) definition).isRouteScoped();
    } else if (definition instanceof OnCompletionDefinition) {
        return !((OnCompletionDefinition) definition).isRouteScoped();
    }

    return false;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:10,代码来源:DefaultChannel.java

示例3: registerProcessor

import org.apache.camel.model.OnCompletionDefinition; //导入依赖的package包/类
/**
 * Should the given processor be registered.
 */
protected boolean registerProcessor(ProcessorDefinition<?> processor) {
    // skip on exception
    if (processor instanceof OnExceptionDefinition) {
        return false;
    }
    // skip on completion
    if (processor instanceof OnCompletionDefinition) {
        return false;
    }
    // skip intercept
    if (processor instanceof InterceptDefinition) {
        return false;
    }
    // skip aop
    if (processor instanceof AOPDefinition) {
        return false;
    }
    // skip policy
    if (processor instanceof PolicyDefinition) {
        return false;
    }

    // only if custom id assigned
    boolean only = getManagementStrategy().getManagementAgent().getOnlyRegisterProcessorWithCustomId() != null
            && getManagementStrategy().getManagementAgent().getOnlyRegisterProcessorWithCustomId();
    if (only) {
        return processor.hasCustomIdAssigned();
    }

    // use customer filter
    return getManagementStrategy().manageProcessor(processor);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:36,代码来源:DefaultManagementLifecycleStrategy.java

示例4: onCompletion

import org.apache.camel.model.OnCompletionDefinition; //导入依赖的package包/类
/**
 * <a href="http://camel.apache.org/oncompletion.html">On completion</a>
 * callback for doing custom routing when the {@link org.apache.camel.Exchange} is complete.
 *
 * @return the builder
 */
public OnCompletionDefinition onCompletion() {
    // is only allowed at the top currently
    if (!getRouteCollection().getRoutes().isEmpty()) {
        throw new IllegalArgumentException("onCompletion must be defined before any routes in the RouteBuilder");
    }
    getRouteCollection().setCamelContext(getContext());
    return getRouteCollection().onCompletion();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:RouteBuilder.java

示例5: getOnCompletions

import org.apache.camel.model.OnCompletionDefinition; //导入依赖的package包/类
public List<OnCompletionDefinition> getOnCompletions() {
    return onCompletions;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:CamelContextFactoryBean.java

示例6: setOnCompletions

import org.apache.camel.model.OnCompletionDefinition; //导入依赖的package包/类
public void setOnCompletions(List<OnCompletionDefinition> onCompletions) {
    this.onCompletions = onCompletions;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:CamelContextFactoryBean.java

示例7: onWhen

import org.apache.camel.model.OnCompletionDefinition; //导入依赖的package包/类
public static OnCompletionDefinition onWhen(OnCompletionDefinition self, Closure<?> predicate) {
    return self.onWhen(toExpression(predicate));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:CamelGroovyMethods.java

示例8: getOnCompletions

import org.apache.camel.model.OnCompletionDefinition; //导入依赖的package包/类
@Override
public List<OnCompletionDefinition> getOnCompletions() {
    return _factoryBean.getOnCompletions();
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:5,代码来源:CamelContextFactoryBeanDelegate.java

示例9: getOnCompletions

import org.apache.camel.model.OnCompletionDefinition; //导入依赖的package包/类
public abstract List<OnCompletionDefinition> getOnCompletions(); 
开发者ID:HydAu,项目名称:Camel,代码行数:2,代码来源:AbstractCamelContextFactoryBean.java


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