Package org.apache.camel.model

Examples of org.apache.camel.model.OnCompletionDefinition


                    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);
                    }
                }
            }
View Full Code Here


        boolean notGlobal = buffer.toString().endsWith(")");
        if (notGlobal) {
            buffer.append(".");
        }

        OnCompletionDefinition onComplete = (OnCompletionDefinition)processor;
        buffer.append(processor.getShortName()).append("()");
        if (onComplete.getOnWhen() != null) {
            WhenDefinition when = onComplete.getOnWhen();
            buffer.append(".onWhen");
            if (when.getExpression().getPredicate() != null) {
                buffer.append("(");
                PredicateRenderer.render(buffer, when.getExpression().getPredicate());
                buffer.append(")");
            } else {
                buffer.append("Unsupported Expression!");
            }
        }
        if (onComplete.getOnCompleteOnly()) {
            buffer.append(".onCompleteOnly()");
        }
        if (onComplete.getOnFailureOnly()) {
            buffer.append(".onFailureOnly()");
        }
        List<ProcessorDefinition> branches = onComplete.getOutputs();
        for (ProcessorDefinition branch : branches) {
            SendDefinitionRenderer.render(buffer, branch);
        }

        // if not a global onCompletion, using end() at the end
View Full Code Here

                    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);
                    }
                }
            }
View Full Code Here

                    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);
                    }
                }
            }
View Full Code Here

                    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);
                    }
                }
            }
View Full Code Here

        boolean notGlobal = buffer.toString().endsWith(")");
        if (notGlobal) {
            buffer.append(".");
        }

        OnCompletionDefinition onComplete = (OnCompletionDefinition)processor;
        buffer.append(processor.getShortName()).append("()");
        if (onComplete.getOnWhen() != null) {
            WhenDefinition when = onComplete.getOnWhen();
            buffer.append(".onWhen");
            if (when.getExpression().getPredicate() != null) {
                buffer.append("(");
                PredicateRenderer.render(buffer, when.getExpression().getPredicate());
                buffer.append(")");
            } else {
                buffer.append("Unsupported Expression!");
            }
        }
        if (onComplete.getOnCompleteOnly()) {
            buffer.append(".onCompleteOnly()");
        }
        if (onComplete.getOnFailureOnly()) {
            buffer.append(".onFailureOnly()");
        }
        List<ProcessorDefinition> branches = onComplete.getOutputs();
        for (ProcessorDefinition branch : branches) {
            SendDefinitionRenderer.render(buffer, branch);
        }

        // if not a global onCompletion, using end() at the end
View Full Code Here

        boolean notGlobal = buffer.toString().endsWith(")");
        if (notGlobal) {
            buffer.append(".");
        }

        OnCompletionDefinition onComplete = (OnCompletionDefinition)processor;
        buffer.append(processor.getShortName()).append("()");
        if (onComplete.getOnWhen() != null) {
            WhenDefinition when = onComplete.getOnWhen();
            buffer.append(".onWhen");
            if (when.getExpression().getPredicate() != null) {
                buffer.append("(");
                PredicateRenderer.render(buffer, when.getExpression().getPredicate());
                buffer.append(")");
            } else {
                buffer.append("Unsupported Expression!");
            }
        }
        if (onComplete.getOnCompleteOnly()) {
            buffer.append(".onCompleteOnly()");
        }
        if (onComplete.getOnFailureOnly()) {
            buffer.append(".onFailureOnly()");
        }
        List<ProcessorDefinition> branches = onComplete.getOutputs();
        for (ProcessorDefinition branch : branches) {
            SendDefinitionRenderer.render(buffer, branch);
        }

        // if not a global onCompletion, using end() at the end
View Full Code Here

                    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);
                    }
                }
            }
View Full Code Here

                    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);
                    }
                }
            }
View Full Code Here

    }

    @SuppressWarnings("rawtypes")
    @Override
    public ProcessorDefinition createCamelDefinition() {
        OnCompletionDefinition answer = new OnCompletionDefinition();

        answer.setInheritErrorHandler(toXmlPropertyValue(PROPERTY_INHERITERRORHANDLER, Objects.<Boolean>getField(this, "inheritErrorHandler")));
        answer.setOnCompleteOnly(toXmlPropertyValue(PROPERTY_ONCOMPLETEONLY, this.getOnCompleteOnly()));
        answer.setOnFailureOnly(toXmlPropertyValue(PROPERTY_ONFAILUREONLY, this.getOnFailureOnly()));
        answer.setExecutorServiceRef(toXmlPropertyValue(PROPERTY_EXECUTORSERVICEREF, this.getExecutorServiceRef()));
        answer.setUseOriginalMessagePolicy(toXmlPropertyValue(PROPERTY_USEORIGINALMESSAGEPOLICY, this.getUseOriginalMessagePolicy()));

        super.savePropertiesToCamelDefinition(answer);
        return answer;
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.model.OnCompletionDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.