JaxbDataFormat jaxb = new JaxbDataFormat("com.example.foobar"); from("ftp://user:pass@server:21/inbox") .unmarshal().zip() .split(xpath("//foo")) .unmarshal(jaxb) .to("jpa:com.example.foobar.Foo")
JaxbDataFormat jaxb = new JaxbDataFormat("add.your.namespace.to.the.ObjectFactory"); jaxb.setPrettyPrint(true); from("seda:out?concurrentConsumers=20") .process(new process_1()) .marshal(jaxb) .process(new process_2());
DataFormat jaxb = new JaxbDataFormat("com.acme.model"); from("activemq:My.Queue"). unmarshal(jaxb). to("mqseries:Another.Queue");
DataFormat jaxb = new JaxbDataFormat("com.acme.model"); from("activemq:My.Queue"). unmarshal(jaxb). to("mqseries:Another.Queue");
DataFormat jaxb = new JaxbDataFormat("com.acme.model");
JaxbDataFormat dataFormat = new JaxbDataFormat(); dataFormat.setContextPath("com.somepath.xml"); from("jms:topic:myTopic?transacted=true&connectionFactory=myJmsConnectionFactory") .transacted() .unmarshal(dataFormat) .routeId("myRouteId")
/** * Creates a JAXB data format for marshalling and unmarshalling * the specified class to/from its native XML representation. * * @param xmlClass the class that this data format will be able to marshal and unmarshal * @return the Camel {@link DataFormatDefinition} instance for use in routes */ public static JaxbDataFormat jaxb(Class<?> xmlClass) { JaxbDataFormat dataFormat = new JaxbDataFormat(false); dataFormat.setContextPath(xmlClass.getPackage().getName()); return dataFormat; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { routeBuilder = new RouteBuilder() { public void configure() throws Exception { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint(true); def.setContextPath("org.drools.pipeline.camel"); from("direct:test-with-session").policy(new DroolsPolicy()). unmarshal(def).to("drools:node/ksession1").marshal(def); } }; return routeBuilder; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { routeBuilder = new RouteBuilder() { public void configure() throws Exception { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint(true); // TODO does not work: def.setContextPath( "org.drools.camel.testdomain:org.drools.pipeline.camel" ); def.setContextPath("org.drools.pipeline.camel"); from("direct:test-with-session").policy(new DroolsPolicy()).unmarshal(def).to("drools:node/ksession1").marshal(def); from("direct:test-no-session").policy(new DroolsPolicy()).unmarshal(def).to("drools:node").marshal(def); } }; return routeBuilder; }
@Override protected RouteBuilder createRouteBuilder() throws Exception { routeBuilder = new RouteBuilder() { public void configure() throws Exception { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint(true); // TODO does not work: def.setContextPath( "org.drools.camel.testdomain:org.drools.pipeline.camel" ); def.setContextPath("org.drools.pipeline.camel"); from("direct:test-with-session").policy(new DroolsPolicy()). unmarshal(def).to("drools:node/ksession1").marshal(def); } }; return routeBuilder; } }
public void configure() throws Exception { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint(true); def.setContextPath("org.kie.pipeline.camel"); from("direct:test-with-session").policy(new KiePolicy()).unmarshal(def).to("kie-local:ksession1").marshal(def); } };
public void configure() throws Exception { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint(true); def.setContextPath("org.drools.pipeline.camel"); from("direct:test-with-session").policy(new DroolsPolicy()). unmarshal(def).to("drools:node/ksession1").marshal(def); } };
public void configure() throws Exception { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint(true); // TODO does not work: def.setContextPath( "org.drools.camel.testdomain:org.drools.pipeline.camel" ); def.setContextPath("org.drools.pipeline.camel"); from("direct:test-with-session").policy(new DroolsPolicy()). unmarshal(def).to("drools:node/ksession1").marshal(def); } };
public void configure() throws Exception { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint(true); // TODO does not work: def.setContextPath( "org.drools.camel.testdomain:org.drools.pipeline.camel" ); def.setContextPath("org.kie.pipeline.camel"); from("direct:test-with-session").policy(new KiePolicy()).unmarshal(def).to("kie-local:ksession1").marshal(def); } };
public void configure() throws Exception { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint(true); // TODO does not work: def.setContextPath( "org.drools.camel.testdomain:org.drools.pipeline.camel" ); def.setContextPath("org.drools.pipeline.camel"); from("direct:test-with-session").policy(new DroolsPolicy()).unmarshal(def).to("drools:node/ksession1").marshal(def); from("direct:test-no-session").policy(new DroolsPolicy()).unmarshal(def).to("drools:node").marshal(def); } };
public void configure() throws Exception { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint(true); // TODO does not work: def.setContextPath( "org.drools.camel.testdomain:org.drools.pipeline.camel" ); def.setContextPath("org.kie.pipeline.camel"); from("direct:test-with-session").policy(new KiePolicy()).unmarshal(def).to("kie-local:ksession1").marshal(def); from("direct:test-no-session").policy(new KiePolicy()).unmarshal(def).to("kie-local:dynamic").marshal(def); } };
@Override public void configure() throws Exception { JaxbDataFormat jdf = new JaxbDataFormat(); jdf.setContextPath("org.kie.camel.embedded.camel.testdomain"); jdf.setPrettyPrint(true); from("direct:test-session").policy(new KiePolicy()).unmarshal(jdf).to("kie-local://ksession").marshal(jdf); from("direct:unmarshall").policy(new KiePolicy()).unmarshal(jdf); from("direct:marshall").policy(new KiePolicy()).marshal(jdf); } });
@Override public void configure() throws Exception { JaxbDataFormat jdf = new JaxbDataFormat(); jdf.setContextPath("org.drools.camel.testdomain"); jdf.setPrettyPrint(true); from("direct:test-session").policy(new DroolsPolicy()) .unmarshal(jdf) .to("drools://testnode/ksession") .marshal(jdf); from("direct:unmarshall").policy(new DroolsPolicy()) .unmarshal(jdf); from("direct:marshall").policy(new DroolsPolicy()) .marshal(jdf); } });
public void configure() throws Exception { JaxbDataFormat jaxbDf = new JaxbDataFormat(); jaxbDf.setContextPath( "org.drools.camel.testdomain" ); from( "direct:exec" ).policy( new DroolsPolicy() ).unmarshal( dataformat ).to( "drools://node/ksession1" ).marshal( dataformat ); from( "direct:execWithLookup" ).policy( new DroolsPolicy() ).unmarshal( dataformat ).to( "drools://node" ).marshal( dataformat ); from( "direct:unmarshal" ).policy( new DroolsPolicy() ).unmarshal( dataformat ); from( "direct:marshal" ).policy( new DroolsPolicy() ).marshal( dataformat ); from( "direct:to-xstream" ).policy( new DroolsPolicy() ).unmarshal( dataformat ).marshal( "xstream" ); from( "direct:to-jaxb" ).policy( new DroolsPolicy() ).unmarshal( dataformat ).marshal( jaxbDf ); } };
public void configure() throws Exception { JaxbDataFormat jaxbDf = new JaxbDataFormat(); jaxbDf.setContextPath("org.kie.camel.testdomain"); from("direct:exec").policy(new KiePolicy()).unmarshal(dataformat).to("kie-local://ksession1").marshal(dataformat); from("direct:execWithLookup").policy(new KiePolicy()).unmarshal(dataformat).to("kie-local://dynamic").marshal(dataformat); from("direct:unmarshal").policy(new KiePolicy()).unmarshal(dataformat); from("direct:marshal").policy(new KiePolicy()).marshal(dataformat); from("direct:to-xstream").policy(new KiePolicy()).unmarshal(dataformat).marshal("xstream"); from("direct:to-jaxb").policy(new KiePolicy()).unmarshal(dataformat).marshal(jaxbDf); } };