Package org.apache.camel.spi

Examples of org.apache.camel.spi.DataFormat


    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                DataFormat jaxb = new JaxbDataFormat("org.apache.camel.example");

                from("direct:start").
                        unmarshal(jaxb).
                        to("mock:result");
            }
View Full Code Here


    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {

                //context.setTracing(true);
                DataFormat syslogDataFormat = new Rfc3164SyslogDataFormat();

                // we setup a Syslog  listener on a random port.
                from("mina:udp://127.0.0.1:" + serverPort).unmarshal(syslogDataFormat).process(new Processor() {
                    public void process(Exchange ex) {
                        assertTrue(ex.getIn().getBody() instanceof SyslogMessage);
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                DataFormat format = new BindyCsvDataFormat(Employee.class);

                from("direct:unmarshal").unmarshal(format)
                        .split(simple("body")).to("mock:bindy-unmarshal");

                from("direct:marshal").marshal(format)
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                DataFormat format = new BeanIODataFormat(
                        "org/apache/camel/itest/osgi/beanio/mappings.xml",
                        "employeeFile");

                from("direct:unmarshal").unmarshal(format)
                        .split(simple("body")).to("mock:beanio-unmarshal");
View Full Code Here

            if (type != null) {
                return type.getDataFormat(routeContext);
            }

            DataFormat dataFormat = routeContext.getCamelContext().resolveDataFormat(ref);
            if (dataFormat == null) {
                throw new IllegalArgumentException("Cannot find data format in registry with ref: " + ref);
            }

            return dataFormat;
View Full Code Here

    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                DataFormat jaxb = new JaxbDataFormat("org.apache.camel.example");

                from("direct:start").
                        unmarshal(jaxb).
                        to("mock:result");
            }
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                DataFormat jaxb = new JaxbDataFormat("org.apache.camel.example");

                // use seda that supports concurrent consumers for concurrency
                from("seda:start?size=" + size + "&concurrentConsumers=5")
                        .marshal(jaxb)
                        .convertBodyTo(String.class)
View Full Code Here

    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                DataFormat jaxb = new JaxbDataFormat("org.apache.camel.example");

                from("direct:start").
                        marshal(jaxb).
                        to("direct:marshalled");
View Full Code Here

    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                DataFormat jaxb = new JaxbDataFormat("org.apache.camel.example");

                // use 5 concurrent threads to do marshalling
                from("dataset:beer").marshal(jaxb).to("dataset:beer");
            }
        };
View Full Code Here

                errorHandler(deadLetterChannel("mock:error").redeliveryDelay(0));

                onException(InvalidOrderException.class).maximumRedeliveries(0).handled(true)
                    .to("mock:invalid");

                DataFormat jaxb = new JaxbDataFormat("org.apache.camel.example");

                from("direct:start")
                    .unmarshal(jaxb)
                    .choice()
                        .when().method(RouteWithErrorHandlerTest.class, "isWine").to("mock:wine")
View Full Code Here

TOP

Related Classes of org.apache.camel.spi.DataFormat

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.