Package org.apache.camel

Examples of org.apache.camel.Processor.process()


    }

    public void process(Exchange exchange) throws Exception {
        Processor processor = getOutput();
        if (processor != null && continueProcessing(exchange)) {
            processor.process(exchange);
        }
    }

    /**
     * Strategy to determine if we should continue processing the {@link Exchange}.
View Full Code Here


            updateNewExchange(subExchange, total, pairs);

            completion.submit(new Callable<Exchange>() {
                public Exchange call() throws Exception {
                    try {
                        producer.process(subExchange);
                    } catch (Exception e) {
                        subExchange.setException(e);
                    }
                    if (LOG.isTraceEnabled()) {
                        LOG.trace("Parallel processing complete for exchange: " + subExchange);
View Full Code Here

            Processor producer = pair.getProcessor();
            Exchange subExchange = pair.getExchange();
            updateNewExchange(subExchange, total, pairs);

            // process it sequentially
            producer.process(subExchange);
            if (LOG.isTraceEnabled()) {
                LOG.trace("Sequientel processing complete for number " + total + " exchange: " + subExchange);
            }

            if (aggregationStrategy != null) {
View Full Code Here

            ActivityState secondState = activityState;
            Date overdue = secondState.getTimeOverdue();
            if (now.compareTo(overdue) >= 0) {
                Exchange exchange = createExchange();
                exchange.getIn().setBody(activityState);
                processor.process(exchange);
            } else {
                LOG.warn("Process has not actually expired; the time is: " + now + " but the overdue time is: " + overdue);
            }
        }
    }
View Full Code Here

    }

    protected void processEntity(Exchange exchange, T entity) throws Exception {
        if (entity instanceof Processor) {
            Processor processor = (Processor)entity;
            processor.process(exchange);
        } else {
            // TODO add other extension points - eg. passing in Activity
            throw new IllegalArgumentException("No processor defined for this route");
        }
    }
View Full Code Here

    protected boolean customProcessorForException(Exchange exchange, Throwable exception) throws Exception {
        OnExceptionDefinition policy = getExceptionPolicy(exchange, exception);
        if (policy != null) {
            Processor processor = policy.getErrorHandler();
            if (processor != null) {
                processor.process(exchange);
                return true;
            }
        }
        return false;
    }
View Full Code Here

            try {
                if (LOG.isTraceEnabled()) {
                    // this does the actual processing so log at trace level
                    LOG.trace("Processing exchangeId: " + nextExchange.getExchangeId() + " >>> " + nextExchange);
                }
                processor.process(nextExchange);
            } catch (Exception e) {
                nextExchange.setException(e);
            }

            // check for error if so we should break out
View Full Code Here

        Processor processor = processors.get(getReceivedCounter()) != null
                ? processors.get(getReceivedCounter()) : defaultProcessor;

        if (processor != null) {
            try {
                processor.process(exchange);
            } catch (Exception e) {
                // set exceptions on exchange so we can throw exceptions to simulate errors
                exchange.setException(e);
            }
        }
View Full Code Here

        Processor processor = getProcessor();
        if (!isExplicitMethod && processor != null) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Using a custom adapter as bean invocation: " + processor);
            }
            processor.process(exchange);
            return;
        }

        Message in = exchange.getIn();
View Full Code Here

    }

    protected void processEntity(Exchange exchange, T entity) throws Exception {
        if (entity instanceof Processor) {
            Processor processor = (Processor)entity;
            processor.process(exchange);
        } else {
            // TODO add other extension points - eg. passing in Activity
            throw new IllegalArgumentException("No processor defined for this route");
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.