Package org.apache.camel

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


        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


                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

        if (allowProcessor(explicitMethodName, beanInfo)) {
            Processor processor = getProcessor();
            if (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

        if (processor != null) {
            try {
                // must process the incoming exchange and NOT the copy as the idea
                // is the end user can manipulate the exchange
                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 = chooseProcessor(list, exchange);
        if (processor == null) {
            throw new IllegalStateException("No processors could be chosen to process " + exchange);
        } else {
            processor.process(exchange);
        }
    }

    protected abstract Processor chooseProcessor(List<Processor> processors, Exchange exchange);
}
View Full Code Here

        exchange.getIn().setBody("Hello World");

        CamelConverter cc = new CamelConverter();
        Processor pro = cc.toProcessor(exp);

        pro.process(exchange);

        assertEquals("bar", exchange.getOut().getBody());
    }

    public void testToProcessorPredicate() throws Exception {
View Full Code Here

        exchange.getIn().setBody("Hello World");

        CamelConverter cc = new CamelConverter();
        Processor pro = cc.toProcessor(pred);

        pro.process(exchange);

        assertEquals(true, exchange.getOut().getBody());
    }
}
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

        exchange.getIn().setHeader("foo", "bar");
        exchange.getIn().setBody("Hello World");

        Processor pro = CamelConverter.toProcessor(exp);

        pro.process(exchange);

        assertEquals("bar", exchange.getOut().getBody());
    }

    public void testToProcessorPredicate() throws Exception {
View Full Code Here

        exchange.getIn().setHeader("foo", "bar");
        exchange.getIn().setBody("Hello World");

        Processor pro = CamelConverter.toProcessor(pred);

        pro.process(exchange);

        assertEquals(true, exchange.getOut().getBody());
    }
}
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.