[jboss-svn-commits] JBL Code SVN: r33388 - in labs/jbossrules/trunk/drools-pipeline/drools-camel/src: test/java/org/drools/camel/component and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jun 7 19:55:10 EDT 2010


Author: lucazamador
Date: 2010-06-07 19:55:09 -0400 (Mon, 07 Jun 2010)
New Revision: 33388

Modified:
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsComponent.java
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsEndpoint.java
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsProxyEndpoint.java
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointTest.java
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxWrapperCollectionTest.java
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxbTest.java
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxbXSDModelTest.java
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithMarshallersTest.java
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelProxyEndpointTest.java
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/DroolsCamelTestSupport.java
Log:
JBRULES-2539:drools-camel: remove deprecated drools-vsm references
- migrated to drools-grid

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsComponent.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsComponent.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsComponent.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -83,7 +83,7 @@
      * referred to in such an embedded route and must have a 'pipeline' parameter set.
      * 
      * The choice of using a pipeline parameter may be revisited. Another option would be to have the url
-     * contain a keyword something like drools:proxy://sm/ksession1.
+     * contain a keyword something like drools:proxy://node/ksession1.
      */
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsEndpoint.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsEndpoint.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsEndpoint.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -23,7 +23,6 @@
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.impl.DefaultEndpoint;
 import org.drools.builder.DirectoryLookupFactoryService;
-import org.drools.grid.DirectoryNodeService;
 import org.drools.grid.ExecutionNode;
 import org.drools.runtime.CommandExecutor;
 
@@ -82,26 +81,26 @@
 
     protected void configure(DroolsComponent component,
                              String uri) {
-        String smId = DroolsComponent.getSessionManagerId( uri );
+        String nodeId = DroolsComponent.getSessionManagerId( uri );
         ksession = DroolsComponent.getKsessionId( uri );
 
-        if ( smId.length() > 0 ) {
+        if ( nodeId.length() > 0 ) {
             // initialize the component if needed
             node = component.getExecutionNode();
             if ( node == null ) {
                 // let's look it up
-                node = component.getCamelContext().getRegistry().lookup( smId,
+                node = component.getCamelContext().getRegistry().lookup( nodeId,
                                                                          ExecutionNode.class );
                 if ( node == null ) {
-                    throw new RuntimeCamelException( "Could not find ServiceManager with id=\"" + smId + "\" in CamelContext. Check configuration." );
+                    throw new RuntimeCamelException( "Could not find ExecutionNode with id=\"" + nodeId + "\" in CamelContext. Check configuration." );
                 }
                 // use this ServiceManager
-                component.setExecutionNodeId( smId );
+                component.setExecutionNodeId( nodeId );
                 component.setExecutionNode( node );
-            } else if ( !smId.equals( component.getExecutionNodeId() ) ) {
+            } else if ( !nodeId.equals( component.getExecutionNodeId() ) ) {
                 // make sure we deal with the same ServiceManager.
                 // having multiple ServiceManagers instances in the same process is not supported
-                throw new RuntimeCamelException( "ServiceManager already initialized from id=\"" + component.getExecutionNodeId() + "\" yet current endpoint requries id=\"" + smId + "\"" );
+                throw new RuntimeCamelException( "ExecutionNode already initialized from id=\"" + component.getExecutionNodeId() + "\" yet current endpoint requries id=\"" + nodeId + "\"" );
             }
 
             // if id is empty this endpoint is not attached to a CommandExecutor and will have to look it up at runtime.

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsProxyEndpoint.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsProxyEndpoint.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsProxyEndpoint.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -31,6 +31,7 @@
     private String id;
     private String uri;
     private String dataFormat;
+    private String xstream;
     private String marshall;
     private String unmarshall;
     private RouteBuilder builder;
@@ -50,11 +51,11 @@
         // final DataFormat xstream = new DroolsXStreamDataFormat();
 
         if (builder == null) {
-            String smId = DroolsComponent.getSessionManagerId(uri);
-            final ExecutionNode node = (ExecutionNode)getCamelContext().getRegistry().lookup(smId);
+            String nodeId = DroolsComponent.getSessionManagerId(uri);
+            final ExecutionNode node = (ExecutionNode)getCamelContext().getRegistry().lookup(nodeId);
             if (node == null) {
-                throw new RuntimeCamelException("Cannot find ServiceManager instance with id=\"" + 
-                    smId + "\" in the CamelContext registry.");
+                throw new RuntimeCamelException("Cannot find ExecutionNode instance with id=\"" + 
+                    nodeId + "\" in the CamelContext registry.");
             }
 
             final String inFormat = (dataFormat == null) ? unmarshall : dataFormat;
@@ -109,7 +110,15 @@
         this.dataFormat = dataFormat;
     }
 
-    public String getMarshall() {
+    public void setXstream(String xstream) {
+		this.xstream = xstream;
+	}
+
+	public String getXstream() {
+		return xstream;
+	}
+
+	public String getMarshall() {
         return marshall;
     }
 

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointTest.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointTest.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -67,8 +67,8 @@
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("direct:test-with-session").to("drools-embedded://sm/ksession1");
-                from("direct:test-no-session").to("drools-embedded://sm");
+                from("direct:test-with-session").to("drools-embedded://node/ksession1");
+                from("direct:test-no-session").to("drools-embedded://node");
             }
         };
     }

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxWrapperCollectionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxWrapperCollectionTest.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxWrapperCollectionTest.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -362,8 +362,8 @@
 	protected RouteBuilder createRouteBuilder() throws Exception {
 		return new RouteBuilder() {
 			public void configure() throws Exception {
-				from("direct:test-with-session").to("drools:sm/ksession1?dataFormat=drools-jaxb");
-				from("direct:test-no-session").to("drools:sm?dataFormat=drools-jaxb");
+				from("direct:test-with-session").to("drools:node/ksession1?dataFormat=drools-jaxb");
+				from("direct:test-no-session").to("drools:node?dataFormat=drools-jaxb");
 			}
 		};
 	}

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxbTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxbTest.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxbTest.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -286,8 +286,8 @@
 	protected RouteBuilder createRouteBuilder() throws Exception {
 		return new RouteBuilder() {
 			public void configure() throws Exception {
-				from("direct:test-with-session").to("drools:sm/ksession1?dataFormat=drools-jaxb");
-				from("direct:test-no-session").to("drools:sm?dataFormat=drools-jaxb");
+				from("direct:test-with-session").to("drools:node/ksession1?dataFormat=drools-jaxb");
+				from("direct:test-no-session").to("drools:node?dataFormat=drools-jaxb");
 			}
 		};
 	}

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxbXSDModelTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxbXSDModelTest.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithJaxbXSDModelTest.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -123,8 +123,8 @@
 	protected RouteBuilder createRouteBuilder() throws Exception {
 		return new RouteBuilder() {
 			public void configure() throws Exception {
-				from("direct:test-with-session").to("drools:sm/ksession1?dataFormat=drools-jaxb");
-				from("direct:test-no-session").to("drools:sm?dataFormat=drools-jaxb");
+				from("direct:test-with-session").to("drools:node/ksession1?dataFormat=drools-jaxb");
+				from("direct:test-no-session").to("drools:node?dataFormat=drools-jaxb");
 			}
 		};
 	}

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithMarshallersTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithMarshallersTest.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointWithMarshallersTest.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -150,9 +150,9 @@
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from( "direct:test-with-session" ).to( "drools:sm/ksession1?dataFormat=drools-xstream" );
-                from( "direct:test-with-session-json" ).to( "drools:sm/ksession1?dataFormat=drools-json" );
-                from( "direct:test-no-session" ).to( "drools:sm?dataFormat=drools-xstream" );
+                from( "direct:test-with-session" ).to( "drools:node/ksession1?dataFormat=drools-xstream" );
+                from( "direct:test-with-session-json" ).to( "drools:node/ksession1?dataFormat=drools-json" );
+                from( "direct:test-no-session" ).to( "drools:node?dataFormat=drools-xstream" );
             }
         };
     }

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelProxyEndpointTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelProxyEndpointTest.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/CamelProxyEndpointTest.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -40,7 +40,7 @@
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("direct:test-no-marshal").to("drools://sm/ksession1");
+                from("direct:test-no-marshal").to("drools://node/ksession1");
             }
         };
     }

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/DroolsCamelTestSupport.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/DroolsCamelTestSupport.java	2010-06-07 22:23:56 UTC (rev 33387)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/test/java/org/drools/camel/component/DroolsCamelTestSupport.java	2010-06-07 23:55:09 UTC (rev 33388)
@@ -70,8 +70,8 @@
 
         LocalConnection connection = new LocalConnection();
         node = connection.getExecutionNode(null);
-        node.setId("sm");
-        context.bind("sm", node);
+        node.setId("node");
+        context.bind("node", node);
 
         configureDroolsContext();
         return context;



More information about the jboss-svn-commits mailing list