Package org.apache.camel.model

Examples of org.apache.camel.model.TransactedDefinition


        upper.addAll(completions);
    }

    private void initTransacted(List<ProcessorDefinition> abstracts, List<ProcessorDefinition> lower) {
        TransactedDefinition transacted = null;

        // add to correct type
        for (ProcessorDefinition type : abstracts) {
            if (type instanceof TransactedDefinition) {
                if (transacted == null) {
                    transacted = (TransactedDefinition) type;
                } else {
                    throw new IllegalArgumentException("The route can only have one transacted defined");
                }
            }
        }

        if (transacted != null) {
            // the outputs should be moved to the transacted policy
            transacted.getOutputs().addAll(lower);
            // and add it as the single output
            lower.clear();
            lower.add(transacted);
        }
    }
View Full Code Here


        }
        buffer.append(")");
    }

    private static void renderTransacted(StringBuilder buffer, OutputDefinition out) {
        TransactedDefinition transacted = (TransactedDefinition)out;
        buffer.append("(");
        if (transacted.getRef() != null) {
            buffer.append("\"").append(transacted.getRef()).append("\"");
        }
        buffer.append(")");
    }
View Full Code Here

        // setup the policies as JAXB yet again have not created a correct model for us
        List<ProcessorDefinition> types = route.getOutputs();

        // we need two types as transacted cannot extend policy due JAXB limitations
        PolicyDefinition policy = null;
        TransactedDefinition transacted = null;

        // add to correct type
        for (ProcessorDefinition type : types) {
            if (type instanceof PolicyDefinition) {
                policy = (PolicyDefinition) type;
            } else if (type instanceof TransactedDefinition) {
                transacted = (TransactedDefinition) type;
            } else if (policy != null) {
                // the outputs should be moved to the policy
                policy.addOutput(type);
            } else if (transacted != null) {
                // the outputs should be moved to the transacted policy
                transacted.addOutput(type);
            }
        }

        // did we find a policy if so replace it as the only output on the route
        if (policy != null) {
View Full Code Here

        upper.addAll(completions);
    }

    private void initTransacted(List<ProcessorDefinition> abstracts, List<ProcessorDefinition> lower) {
        TransactedDefinition transacted = null;

        // add to correct type
        for (ProcessorDefinition type : abstracts) {
            if (type instanceof TransactedDefinition) {
                if (transacted == null) {
                    transacted = (TransactedDefinition) type;
                } else {
                    throw new IllegalArgumentException("The route can only have one transacted defined");
                }
            }
        }

        if (transacted != null) {
            // the outputs should be moved to the transacted policy
            transacted.getOutputs().addAll(lower);
            // and add it as the single output
            lower.clear();
            lower.add(transacted);
        }
    }
View Full Code Here

            buffer.append(".waitForTaskToComplete(WaitForTaskToComplete.").append(wait).append(")");
        }
    }

    private static void renderTransacted(StringBuilder buffer, OutputDefinition out) {
        TransactedDefinition transacted = (TransactedDefinition)out;
        buffer.append("(");
        if (transacted.getRef() != null) {
            buffer.append("\"").append(transacted.getRef()).append("\"");
        }
        buffer.append(")");
    }
View Full Code Here

    private void initPolicies(RouteDefinition route) {
        // setup the policies as JAXB yet again have not created a correct model for us
        List<ProcessorDefinition> types = route.getOutputs();
        // we need to types as transacted cannot extend policy due JAXB limitations
        PolicyDefinition policy = null;
        TransactedDefinition transacted = null;
        for (ProcessorDefinition type : types) {
            if (type instanceof PolicyDefinition) {
                policy = (PolicyDefinition) type;
            } else if (type instanceof TransactedDefinition) {
                transacted = (TransactedDefinition) type;
            } else if (policy != null) {
                // the outputs should be moved to the policy
                policy.addOutput(type);
            } else if (transacted != null) {
                // the outputs should be moved to the transacted policy
                transacted.addOutput(type);
            }
        }
        // did we find a policy if so replace it as the only output on the route
        if (policy != null) {
            route.clearOutput();
View Full Code Here

            buffer.append(".waitForTaskToComplete(WaitForTaskToComplete.").append(wait).append(")");
        }
    }

    private static void renderTransacted(StringBuilder buffer, OutputDefinition<?> out) {
        TransactedDefinition transacted = (TransactedDefinition)out;
        buffer.append("(");
        if (transacted.getRef() != null) {
            buffer.append("\"").append(transacted.getRef()).append("\"");
        }
        buffer.append(")");
    }
View Full Code Here

            buffer.append(".waitForTaskToComplete(WaitForTaskToComplete.").append(wait).append(")");
        }
    }

    private static void renderTransacted(StringBuilder buffer, OutputDefinition out) {
        TransactedDefinition transacted = (TransactedDefinition)out;
        buffer.append("(");
        if (transacted.getRef() != null) {
            buffer.append("\"").append(transacted.getRef()).append("\"");
        }
        buffer.append(")");
    }
View Full Code Here

        // setup the policies as JAXB yet again have not created a correct model for us
        List<ProcessorDefinition> types = route.getOutputs();

        // we need two types as transacted cannot extend policy due JAXB limitations
        PolicyDefinition policy = null;
        TransactedDefinition transacted = null;

        // add to correct type
        for (ProcessorDefinition type : types) {
            if (type instanceof PolicyDefinition) {
                policy = (PolicyDefinition) type;
            } else if (type instanceof TransactedDefinition) {
                transacted = (TransactedDefinition) type;
            } else if (policy != null) {
                // the outputs should be moved to the policy
                policy.addOutput(type);
            } else if (transacted != null) {
                // the outputs should be moved to the transacted policy
                transacted.addOutput(type);
            }
        }

        // did we find a policy if so replace it as the only output on the route
        if (policy != null) {
View Full Code Here

        // setup the policies as JAXB yet again have not created a correct model for us
        List<ProcessorDefinition> types = route.getOutputs();

        // we need two types as transacted cannot extend policy due JAXB limitations
        PolicyDefinition policy = null;
        TransactedDefinition transacted = null;

        // add to correct type
        for (ProcessorDefinition type : types) {
            if (type instanceof PolicyDefinition) {
                policy = (PolicyDefinition) type;
            } else if (type instanceof TransactedDefinition) {
                transacted = (TransactedDefinition) type;
            } else if (policy != null) {
                // the outputs should be moved to the policy
                policy.addOutput(type);
            } else if (transacted != null) {
                // the outputs should be moved to the transacted policy
                transacted.addOutput(type);
            }
        }

        // did we find a policy if so replace it as the only output on the route
        if (policy != null) {
View Full Code Here

TOP

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

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.