for (Route route : context.getRoutes()) { ManagedRouteMBean managedRoute = context.getManagedRoute(route.getId(), ManagedRouteMBean.class); if (managedRoute.getExchangesTotal() == 0) {
log.debug("Using route builder from the created context: " + context); log.debug("Routing Rules are: " + context.getRoutes());
public JAXBContext getJaxbContext() { if ( this.jaxbContext == null ) { JaxbDataFormat def = new JaxbDataFormat(); def.setPrettyPrint( true ); def.setContextPath( "org.drools.model:org.drools.pipeline.camel" ); // create a jaxbContext for the test to use outside of Camel. StatefulKnowledgeSession ksession1 = (StatefulKnowledgeSession) node.get( "ksession1", CommandExecutor.class ); KnowledgeBase kbase = ksession1.getKieBase(); ClassLoader originalCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader( ((ReteooRuleBase) ((KnowledgeBaseImpl) kbase).getRuleBase()).getRootClassLoader() ); def = DroolsPolicy.augmentJaxbDataFormatDefinition( def ); org.apache.camel.converter.jaxb.JaxbDataFormat jaxbDataformat = (org.apache.camel.converter.jaxb.JaxbDataFormat) def.getDataFormat( this.context.getRoutes().get( 0 ).getRouteContext() ); jaxbDataformat.setCamelContext(routeBuilder.getContext()); try { jaxbDataformat.start(); } catch (Exception e) { throw new IllegalStateException(e); } jaxbContext = jaxbDataformat.getContext(); } finally { Thread.currentThread().setContextClassLoader( originalCl ); } } return jaxbContext; }
public JAXBContext getJaxbContext() { if ( this.jaxbContext == null ) { 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" ); // create a jaxbContext for the test to use outside of Camel. StatefulKnowledgeSession ksession1 = (StatefulKnowledgeSession) node.get( "ksession1", CommandExecutor.class ); KnowledgeBase kbase = ksession1.getKieBase(); ClassLoader originalCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader( ((ReteooRuleBase) ((KnowledgeBaseImpl) kbase).getRuleBase()).getRootClassLoader() ); def = DroolsPolicy.augmentJaxbDataFormatDefinition( def ); org.apache.camel.converter.jaxb.JaxbDataFormat jaxbDataformat = (org.apache.camel.converter.jaxb.JaxbDataFormat) def.getDataFormat( this.context.getRoutes().get( 0 ).getRouteContext() ); jaxbDataformat.setCamelContext(routeBuilder.getContext()); try { jaxbDataformat.start(); } catch (Exception e) { throw new IllegalStateException(e); } jaxbContext = jaxbDataformat.getContext(); } finally { Thread.currentThread().setContextClassLoader( originalCl ); } } return jaxbContext; }
public JAXBContext getJaxbContext() { if ( this.jaxbContext == null ) { 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" ); // create a jaxbContext for the test to use outside of Camel. StatefulKnowledgeSession ksession1 = (StatefulKnowledgeSession) node.get( "ksession1", CommandExecutor.class ); KnowledgeBase kbase = ksession1.getKieBase(); ClassLoader originalCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader( ((ReteooRuleBase) ((KnowledgeBaseImpl) kbase).getRuleBase()).getRootClassLoader() ); def = DroolsPolicy.augmentJaxbDataFormatDefinition( def ); org.apache.camel.converter.jaxb.JaxbDataFormat jaxbDataformat = (org.apache.camel.converter.jaxb.JaxbDataFormat) def.getDataFormat( this.context.getRoutes().get( 0 ).getRouteContext() ); jaxbDataformat.setCamelContext(routeBuilder.getContext()); try { jaxbDataformat.start(); } catch (Exception e) { throw new IllegalStateException(e); } jaxbContext = jaxbDataformat.getContext(); } finally { Thread.currentThread().setContextClassLoader( originalCl ); } } return jaxbContext; }
org.apache.camel.converter.jaxb.JaxbDataFormat jaxbDataformat = (org.apache.camel.converter.jaxb.JaxbDataFormat)def.getDataFormat(this.context.getRoutes().get(0) .getRouteContext());