Package org.apache.camel.converter.jaxb

Examples of org.apache.camel.converter.jaxb.JaxbDataFormat


*/
public class Jpa2JmsRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        JaxbDataFormat df = createPersonJaxbDataFormat();

        from("jpa://net.lr.tutorial.karaf.camel.jpa2jms.model.Person?consumer.delay=2000").id("jpa2jms")
        .onException(Exception.class).maximumRedeliveries(3).backOffMultiplier(2).handled(true).to("file:error").end()
        .transacted("PROPAGATION_REQUIRED")
        .marshal(df)
View Full Code Here


        .to("log:personreceived");
    }

    private JaxbDataFormat createPersonJaxbDataFormat() throws JAXBException {
        JAXBContext jaxbContext = JAXBContext.newInstance(Person.class);
        JaxbDataFormat df = new JaxbDataFormat(jaxbContext);
        df.setContextPath(Person.class.getPackage().toString());
        return df;
    }
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {

            public void configure() throws Exception {
                JaxbDataFormat dataFormat = new JaxbDataFormat("org.apache.camel.foo.bar");
                dataFormat.setIgnoreJAXBElement(false);

                JaxbDataFormat filterEnabledFormat = new JaxbDataFormat("org.apache.camel.foo.bar");
                filterEnabledFormat.setFilterNonXmlChars(true);

                JaxbDataFormat customWriterFormat = new JaxbDataFormat("org.apache.camel.foo.bar");
                customWriterFormat.setXmlStreamWriterWrapper(new TestXmlStreamWriter());

                JaxbDataFormat customWriterAndFilterFormat = new JaxbDataFormat("org.apache.camel.foo.bar");
                customWriterAndFilterFormat.setFilterNonXmlChars(true);
                customWriterAndFilterFormat.setXmlStreamWriterWrapper(new TestXmlStreamWriter());

                from("direct:getJAXBElementValue")
                    .unmarshal(new JaxbDataFormat("org.apache.camel.foo.bar"))                       
                        .to("mock:result");
               
                from("direct:getJAXBElement")
                    .unmarshal(dataFormat)
                    .to("mock:result");
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {

            public void configure() throws Exception {
                JaxbDataFormat dataFormat = new JaxbDataFormat("org.apache.camel.foo.bar");
                dataFormat.setIgnoreJAXBElement(false);
                from("direct:getJAXBElementValue")
                    .unmarshal(new JaxbDataFormat("org.apache.camel.foo.bar"))                       
                        .to("mock:result");
               
                from("direct:getJAXBElement")
                    .unmarshal(dataFormat)
                        .to("mock:result");
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

        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:unmarshal")
                        .unmarshal(new JaxbDataFormat("org.apache.camel.example"))
                        .process(new Processor() {
                            @Override
                            public void process(Exchange exchange) throws Exception {
                                latch.countDown();
                            }
View Full Code Here

        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:marshal")
                        .marshal(new JaxbDataFormat("org.apache.camel.example"))
                        .process(new Processor() {
                            @Override
                            public void process(Exchange exchange) throws Exception {
                                latch.countDown();
                            }
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").
                        unmarshal(jaxb).
                        to("mock:result");
            }
View Full Code Here

public class IncrementRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        JaxbDataFormat jaxb = new JaxbDataFormat(IncrementRequest.class.getPackage().getName());
       
        from("spring-ws:rootqname:{http://camel.apache.org/example/increment}incrementRequest?endpointMapping=#endpointMapping")
            .unmarshal(jaxb)
            .process(new IncrementProcessor())
            .marshal(jaxb);
View Full Code Here

TOP

Related Classes of org.apache.camel.converter.jaxb.JaxbDataFormat

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.