當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。