Package org.apache.camel

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


            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


    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

                LOG.debug("Multicasting to " + endpoint.getConsumers().size() + " consumers for Exchange: " + exchange);
            }

            // use a multicast processor to process it
            Processor mp = getMulticastProcessor();
            mp.process(exchange);
        } else {
            // use the regular processor
            processor.process(exchange);
        }
    }
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

            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

        }

        Processor processor = getOutput();
        try {
            if (processor != null && continueProcessing(exchange)) {
                processor.process(exchange);
            }
        } finally {
            // pop the route context we just used
            if (exchange.getUnitOfWork() != null) {
                exchange.getUnitOfWork().popRouteContext();
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

            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

        // should not be invoked if an explicit method has been set
        Processor processor = getProcessor();
        if (explicitMethodName == null && processor != null) {
            LOG.trace("Using a custom adapter as bean invocation: {}", processor);
            try {
                processor.process(exchange);
            } catch (Throwable e) {
                exchange.setException(e);
            }
            callback.done(true);
            return true;
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.