[jboss-svn-commits] JBL Code SVN: r12027 - in labs/jbossesb/trunk: product/core/listeners/src/org/jboss/soa/esb/listeners and 49 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon May 21 12:12:24 EDT 2007


Author: kurt.stam at jboss.com
Date: 2007-05-21 12:12:23 -0400 (Mon, 21 May 2007)
New Revision: 12027

Added:
   labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/deployment.xml
   labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/deployment.xml
   labs/jbossesb/trunk/product/services/jbrules/
   labs/jbossesb/trunk/product/services/jbrules/base-project-build.xml
   labs/jbossesb/trunk/product/services/jbrules/build.properties
   labs/jbossesb/trunk/product/services/jbrules/build.xml
   labs/jbossesb/trunk/product/services/jbrules/lib/
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/antlr-2.7.6.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/antlr-3.0ea8.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/jbossall-client.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/jbossts-common.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/junit-4.1.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/junit.jar.license.txt
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/log4j.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/log4j.jar.license.txt
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-jci-core-1.0-406301.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-jci-janino-2.4.3.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-lang-2.1.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-logging.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/drools-compiler-3.0.4.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/drools-core-3.0.4.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/janino-2.4.3.jar
   labs/jbossesb/trunk/product/services/jbrules/lib/ext/stringtemplate-2.3b6.jar
   labs/jbossesb/trunk/product/services/jbrules/src/
   labs/jbossesb/trunk/product/services/jbrules/src/main/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/DslHelper.java
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java
   labs/jbossesb/trunk/product/services/jbrules/src/main/resources/
   labs/jbossesb/trunk/product/services/jbrules/src/main/resources/JBossESBRules-XPath.drl
   labs/jbossesb/trunk/product/services/jbrules/src/main/resources/JBossESBRules.drl
   labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/
   labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/deployment.xml
   labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/jboss-esb.xml
   labs/jbossesb/trunk/product/services/jbrules/src/main/resources/XPathLanguage.dsl
   labs/jbossesb/trunk/product/services/jbrules/src/test/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/routing/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/routing/cbr/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouterUnitTest.java
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/esb/services/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/esb/services/routing/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/esb/services/routing/cbr/
   labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/esb/services/routing/cbr/ContentBasedRoutingUnitTest.java
   labs/jbossesb/trunk/product/services/jbrules/src/test/resources/
   labs/jbossesb/trunk/product/services/jbrules/src/test/resources/log4j.xml
Removed:
   labs/jbossesb/trunk/product/core/services/rules/JBossESBRules-XPath.drl
   labs/jbossesb/trunk/product/core/services/rules/JBossESBRules.drl
   labs/jbossesb/trunk/product/core/services/rules/XPathLanguage.dsl
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/
   labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/jbpm/
   labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/internal/soa/esb/services/routing/
   labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/routing/
   labs/jbossesb/trunk/product/lib/ext/commons-jci-core-1.0-406301.jar
   labs/jbossesb/trunk/product/lib/ext/commons-jci-janino-2.4.3.jar
   labs/jbossesb/trunk/product/lib/ext/drools-compiler-3.0.4.jar
   labs/jbossesb/trunk/product/lib/ext/drools-core-3.0.4.jar
   labs/jbossesb/trunk/product/lib/ext/janino-2.4.3.jar
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/ContentBasedRouterTest.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/ContentBasedRouterTest.xml
Modified:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedRouter.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Configuration.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java
   labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml
   labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/src/services/rules/MyESBRules-XPath.drl
   labs/jbossesb/trunk/product/services/build.xml
   labs/jbossesb/trunk/product/services/soapui-client/
Log:
JBESB-500, moving jbrules into it's own service archive

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedRouter.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedRouter.java	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedRouter.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -50,6 +50,7 @@
 public class ContentBasedRouter
 {
 	public static final String ROUTE_TO_TAG = "route-to";
+    public static final String DEFAULT_CBR_CLASS = "org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter";
 	private Logger log = Logger.getLogger(this.getClass());
 
 	public ContentBasedRouter(ConfigTree config) throws ConfigurationException, RegistryException, MessageRouterException
@@ -57,7 +58,7 @@
 		_config = config;
 		checkMyParms();
 		_registry = RegistryFactory.getRegistry();
-        _cbr = ContentBasedRouterFactory.getRouter();
+        _cbr = ContentBasedRouterFactory.getRouter(_cbrClass);
 	}
 	/** Router the message to one or more destinations, using the ContentBasedRouter to figure out
      *  to which destinations it is going to be routed too.
@@ -119,6 +120,12 @@
                 _ruleReload = true;
             }
         }
+        if (_config.getAttribute(ListenerTagNames.CBR_CLASS)!=null) {
+            _cbrClass = _config.getAttribute(ListenerTagNames.CBR_CLASS);
+        } else {
+            _cbrClass = DEFAULT_CBR_CLASS;
+        }
+        
 		_destinations = new HashMap<String, String[]>();
 		ConfigTree[] destList = _config.getChildren(ROUTE_TO_TAG);
         
@@ -149,6 +156,8 @@
 
 	protected Map<String, String[]> _destinations;
     
+    protected String _cbrClass;
+    
     protected String _ruleSet;
     
     protected String _ruleLanguage;

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -72,6 +72,7 @@
     public static final String DESTINATION_NAME_TAG         = "destination-name";
     /** Content Based Routing */
     /** RuleSet reference (Filename) */
+    public static final String CBR_CLASS                    = "cbrClass";
     public static final String RULE_SET_TAG                 = "ruleSet";
     public static final String RULE_LANGUAGE_TAG            = "ruleLanguage";
     public static final String RULE_RELOAD_TAG              = "ruleReload";

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Configuration.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -73,8 +73,7 @@
 			new KeyValuePair(Environment.MSG_STORE_DB_POOL_TIMEOUT_MILLIS,getStorePoolTimeoutMillis()),
 			new KeyValuePair(Environment.MSG_STORE_CONN_FACTORY			,getStoreConnectionFactory()),
 			new KeyValuePair(Environment.MSG_STORE_DB_CONN_MANAGER		,getStoreDBConnectionManager()),
-			new KeyValuePair(Environment.MSG_STORE_DB_DATASOURCE_NAME	,getStoreDBDatasourceName()),
-			new KeyValuePair(Environment.ROUTER_CBR_CLASS,               getContentBasedRouterImplementationClass())
+			new KeyValuePair(Environment.MSG_STORE_DB_DATASOURCE_NAME	,getStoreDBDatasourceName())
 	};
 
 	public static String dump()
@@ -328,12 +327,6 @@
 	{
 		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_ROOT_NODE_PATH);
 	}
-
-	public static String getContentBasedRouterImplementationClass()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.ROUTER_MODULE).getProperty(Environment.ROUTER_CBR_CLASS);
-		return property;
-	}
 	
 	/**
 	 * Construct a naming context based on the connection details outlined

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -87,10 +87,6 @@
 	 * Property that holds directory to use with the helper EPRManager class.
 	 */
 	public static final String REGISTRY_FILE_HELPER_DIR       = "org.jboss.soa.esb.registry.file.directory";
-	/**
-	 * The Content Based Router class property declares which CBR Implementation should be used.
-	 */
-	public static final String ROUTER_CBR_CLASS               = "org.jboss.soa.esb.routing.cbrClass";
 	/*
 	 * Connection specific properties
 	 */

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -22,6 +22,8 @@
 package org.jboss.soa.esb.util;
 
 import java.io.InputStream;
+import java.net.URL;
+import java.net.URLClassLoader;
 
 /**
  * Utility methods to aid in class/resource loading.
@@ -90,6 +92,12 @@
                 }
         }
         final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
+        URL[] urls = ((URLClassLoader)threadClassLoader).getURLs();
+
+        for(int i=0; i< urls.length; i++)
+        {
+            System.out.println(urls[i].getFile());
+        }    
         if (threadClassLoader != null)
         {
                 final InputStream is = threadClassLoader.getResourceAsStream(resource) ;
@@ -100,6 +108,12 @@
         }
         
         final ClassLoader classLoader = caller.getClassLoader() ;
+        urls = ((URLClassLoader)classLoader).getURLs();
+
+        for(int i=0; i< urls.length; i++)
+        {
+            System.out.println(urls[i].getFile());
+        }   
         if (classLoader != null)
         {
                 final InputStream is = classLoader.getResourceAsStream(resource) ;

Deleted: labs/jbossesb/trunk/product/core/services/rules/JBossESBRules-XPath.drl
===================================================================
--- labs/jbossesb/trunk/product/core/services/rules/JBossESBRules-XPath.drl	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/core/services/rules/JBossESBRules-XPath.drl	2007-05-21 16:12:23 UTC (rev 12027)
@@ -1,47 +0,0 @@
-#created on: Nov 8, 2006
-package com.jboss.soa.esb.routing.cbr
-
-#list any import classes here.
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageType;
-
-expander XPathLanguage.dsl
-
-#declare any global variables here
-global java.util.List destinations;
-
-rule "Routing Rule using XPATH match"
-	
-	when
-		xpathMatch "/jbossesb"
-	then 
-		Log : "XPath Matched";
-		Destination : "XML_XPath_Destination";
-end
-
-rule "Routing Rule using XPATH equals"
-	
-	when
-		xpathEquals "/Dave", "rocks"
-	then 
-		Log : "XPath Equals";
-		Destination : "XML_XPath_Dave_Destination";
-end
-
-rule "Routing Rule using XPATH greater than"
-	
-	when
-	    xpathGreaterThan "/price" , "1.00"
-	then 
-		Log : "XPath Greater Then";
-		Destination : "XML_XPath_GreaterThan_Destination";
-end
-
-rule "Routing Rule using XPATH less than"
-	
-	when
-		xpathLessThan "/price", "1.00"
-	then 
-		Log : "XPath Less Then";
-		Destination : "XML_XPath_LessThan_Destination";
-end

Deleted: labs/jbossesb/trunk/product/core/services/rules/JBossESBRules.drl
===================================================================
--- labs/jbossesb/trunk/product/core/services/rules/JBossESBRules.drl	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/core/services/rules/JBossESBRules.drl	2007-05-21 16:12:23 UTC (rev 12027)
@@ -1,29 +0,0 @@
-#created on: Oct 30, 2006
-package com.jboss.soa.esb.routing.cbr
-
-#list any import classes here.
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageType;
-
-#declare any global variables here
-global java.util.List destinations;
-
-
-rule "Routing Rule - Serialized based message"
-	
-	when
-		Message( type == MessageType.JAVA_SERIALIZED)
-	then
-		System.out.println("Serialized");
-		destinations.add("serialized-destination");
-		
-end
-
-rule "Routing Rule - XML based message"
-	
-	when
-		Message( type == MessageType.JBOSS_XML)
-	then 
-		System.out.println("JBoss_XML"); 
-		destinations.add("xml-destination");
-end
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/core/services/rules/XPathLanguage.dsl
===================================================================
--- labs/jbossesb/trunk/product/core/services/rules/XPathLanguage.dsl	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/core/services/rules/XPathLanguage.dsl	2007-05-21 16:12:23 UTC (rev 12027)
@@ -1,7 +0,0 @@
-#JBossESB Content Based Routing using XPath DSL
-[when]xpathMatch "{xpath}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentMatches(msg, "{xpath}") )
-[when]xpathEquals "{xpath}", "{value}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentEquals(msg, "{xpath}", "{value}") )
-[when]xpathGreaterThan "{xpath}", "{value}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentGreaterThan(msg, "{xpath}", "{value}") )
-[when]xpathLessThan "{xpath}", "{value}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentLessThan(msg, "{xpath}", "{value}") )
-[then]Log : "{message}"=System.out.println("{message}");
-[then]Destination : "{message}"=destinations.add("{message}");

Modified: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -23,7 +23,6 @@
 
 import org.apache.log4j.Logger;
 import org.apache.log4j.Priority;
-import org.jboss.soa.esb.common.Configuration;
 import org.jboss.soa.esb.services.routing.MessageRouterException;
 import org.jboss.soa.esb.util.ClassUtil;
 /**
@@ -35,11 +34,9 @@
 public class ContentBasedRouterFactory {
     private static Logger logger = Logger.getLogger(ContentBasedRouterFactory.class);
 
-    public static ContentBasedRouter getRouter() throws MessageRouterException
+    public static ContentBasedRouter getRouter(String className) throws MessageRouterException
     {
 	ContentBasedRouter cbr = null;
-        String className = Configuration
-                .getContentBasedRouterImplementationClass();
         logger.log(Priority.DEBUG, "Going to load " + className);
     try {
         // instruct class loader to load the Content Based  Router Implementation

Modified: labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -82,9 +82,6 @@
 		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
 		
     </properties>    
-    <properties name="messagerouting">
-    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
-    </properties>
     <properties name="filters">
     	<property name="org.jboss.soa.esb.courier.filter.1" value="org.jboss.internal.soa.esb.message.metadata.MetaDataFilter"/>
     </properties>

Deleted: labs/jbossesb/trunk/product/lib/ext/commons-jci-core-1.0-406301.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/product/lib/ext/commons-jci-janino-2.4.3.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/product/lib/ext/drools-compiler-3.0.4.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/product/lib/ext/drools-core-3.0.4.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/product/lib/ext/janino-2.4.3.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/deployment.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/deployment.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbossesb-deployment>
+  <depends>jboss.esb:deployment=jbrules-cbr.esb</depends>
+</jbossesb-deployment>


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/deployment.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Modified: labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/src/services/rules/MyESBRules-XPath.drl
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/src/services/rules/MyESBRules-XPath.drl	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/src/services/rules/MyESBRules-XPath.drl	2007-05-21 16:12:23 UTC (rev 12027)
@@ -1,4 +1,3 @@
-
 package com.jboss.soa.esb.routing.cbr
 
 #list any import classes here.

Added: labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/deployment.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/deployment.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbossesb-deployment>
+  <depends>jboss.esb:deployment=jbrules.esb</depends>
+</jbossesb-deployment>


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/deployment.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Modified: labs/jbossesb/trunk/product/services/build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/build.xml	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/product/services/build.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -3,27 +3,32 @@
     <property file="build.properties" />
     
     <target name="esb">
+        <ant dir="jbossesb" target="dist"/>
 		<ant dir="jbpm" target="dist"/>
-		<ant dir="jbossesb" target="dist"/>
+		<ant dir="jbrules" target="dist"/>
         <ant dir="soapui-client" target="sar"/>
     </target>
 
     <target name="clean">
+        <ant dir="jbossesb" target="clean"/>
 		<ant dir="jbpm" target="clean"/>
-		<ant dir="jbossesb" target="clean"/>
+		<ant dir="jbrules" target="clean"/>
         <ant dir="soapui-client" target="clean"/>
     </target>
 
     <target name="test">
+		<ant dir="jbossesb" target="test"/>
 		<ant dir="jbpm" target="test"/>
-		<ant dir="jbossesb" target="test"/>
+		<ant dir="jbrules" target="test"/>
     </target>
     
     <target name="copy-buildfiles">
+        <copy todir="jbossesb" file="base-project-build.xml"/>
+        <copy todir="jbossesb" file="build.properties"/>
     	<copy todir="jbpm" file="base-project-build.xml"/>
         <copy todir="jbpm" file="build.properties"/>
-    	<copy todir="jbossesb" file="base-project-build.xml"/>
-        <copy todir="jbossesb" file="build.properties"/>
+        <copy todir="jbrules" file="base-project-build.xml"/>
+        <copy todir="jbrules" file="build.properties"/>
     </target>
 	
 </project>

Added: labs/jbossesb/trunk/product/services/jbrules/base-project-build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/base-project-build.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/base-project-build.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,96 @@
+<project name="ESB-services-base-build" basedir=".">
+    <!-- 
+    		WARNING: Your edits maybe overwritten!
+    		
+    Only edit this file in the product/services directory. This
+    file is copied down into each services project directory to be
+    able to work on each subproject in a selfcontained manner.
+    
+    If you edit this file, please run the 'copy-buildfiles' target
+    from services to copy the new version down to the project directories.
+    
+     -->
+	<dirname property="services.dir" file="${ant.file.base-build}"/>
+	<property file="${services.dir}/build.properties"/>
+    
+	<target name="clean">
+		<delete dir="build" />
+	</target>
+	
+	<target name="prepare" depends="clean">
+		<mkdir dir="build/${ant.project.name}.esb/META-INF" />
+		<mkdir dir="build/classes" />
+	</target>
+	
+	<path id="classpath">
+		<pathelement location="build/${ant.project.name}.esb" />
+		<pathelement location="build/classes" />
+		<pathelement location="build/test/classes" />
+		<fileset dir="lib/ext" includes="*.jar" />
+		<fileset dir="lib/ext/build-time" includes="*.jar" />
+		<fileset dir="${esb.product.lib.dir}" includes="*.jar" /> <!-- Product Jars. -->
+		<pathelement location="src/test/resources"/>
+	</path>
+	
+	<target name="echoCP">
+		<property name="cp" refid="classpath" />
+		<echo message="Classpath is ${cp}" />
+	</target>
+
+    <target name="check.for.files">
+	    <fileset id="fs" dir="build/classes"/>
+	    <condition property="dir_empty">
+	        <length length="0">
+	    		<fileset refid="fs"/>
+	  		</length>
+	  </condition>
+    </target>
+    
+	<target name="compile" depends="prepare">
+		<javac srcdir="src/main/java" destdir="build/classes" debug="on" >
+			<classpath refid="classpath" />
+		</javac>
+	</target>
+	
+	<target name="jar" depends="compile,check.for.files" unless="dir_empty">
+		<jar basedir="build/classes" destfile="build/jbossesb-${ant.project.name}.jar" includes="**/*.class"/>
+	</target>
+
+    <target name="esb" depends="jar">
+        <copy todir="build/${ant.project.name}.esb/" >
+        	<fileset dir="lib/ext" includes="*.jar"/>
+        	<fileset dir="src/main/resources/" includes="**/*"/>
+        	<fileset dir="build" includes="*.jar"/>
+         </copy>
+    </target>
+	
+	<target name="dist" depends="esb">
+		<!-- copying to jbossesb/lib -->
+    	<mkdir dir="${esb.product.lib.dir}/${ant.project.name}.esb"/>
+    	<copy todir="${esb.product.lib.dir}/${ant.project.name}.esb">
+    		<fileset dir="build/${ant.project.name}.esb"  includes="**/*" />
+    	</copy>
+	</target>
+    
+    <target name="base.test" depends="esb">
+    	<mkdir dir="build/test/classes"/>
+    	<mkdir dir="build/test/report"/>
+    	<javac srcdir="src/test/java" destdir="build/test/classes" debug="on" >
+			<classpath refid="classpath" />
+		</javac>
+    	<copy todir="build/test/classes" >
+    		<fileset dir="src/test/java" includes="**/*.xml" />
+    	</copy>
+		<junit fork="yes" haltonfailure="true" haltonerror="true" showoutput="off">
+			<formatter type="plain" usefile="false" />
+			<classpath refid="classpath" />
+			<sysproperty key="log4j.configuration" value="log4j.xml" />
+			<test name="${testcase}" if="testcase" />
+			<batchtest unless="testcase" todir="build/test/report">
+				<fileset dir="build/test/classes" includes="**/*Test.class" />
+			</batchtest>
+		</junit>
+    </target>
+	
+
+</project>
\ No newline at end of file


Property changes on: labs/jbossesb/trunk/product/services/jbrules/base-project-build.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/jbrules/build.properties
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/build.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/build.properties	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1 @@
+esb.product.lib.dir=../../../product/build/jbossesb/lib
\ No newline at end of file


Property changes on: labs/jbossesb/trunk/product/services/jbrules/build.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/jbrules/build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/build.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/build.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,8 @@
+<project name="jbrules-cbr" default="test" basedir=".">
+	
+	<!-- Import the base Ant build script... -->
+	<import file="base-project-build.xml"/>
+	
+	<target name="test" depends="base.test"/>
+
+</project>
\ No newline at end of file


Property changes on: labs/jbossesb/trunk/product/services/jbrules/build.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/antlr-2.7.6.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/antlr-2.7.6.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/antlr-3.0ea8.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/antlr-3.0ea8.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/jbossall-client.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/jbossall-client.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/jbossts-common.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/jbossts-common.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/junit-4.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/junit-4.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/junit.jar.license.txt
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/junit.jar.license.txt	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/junit.jar.license.txt	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,213 @@
+Common Public License Version 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+    a) in the case of the initial Contributor, the initial code and documentation
+    distributed under this Agreement, and
+
+    b) in the case of each subsequent Contributor:
+
+    i) changes to the Program, and
+
+    ii) additions to the Program;
+
+    where such changes and/or additions to the Program originate from and are
+    distributed by that particular Contributor. A Contribution 'originates' from
+    a Contributor if it was added to the Program by such Contributor itself or
+    anyone acting on such Contributor's behalf. Contributions do not include
+    additions to the Program which: (i) are separate modules of software
+    distributed in conjunction with the Program under their own license
+    agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including
+all Contributors.
+
+2. GRANT OF RIGHTS
+
+    a) Subject to the terms of this Agreement, each Contributor hereby grants
+    Recipient a non-exclusive, worldwide, royalty-free copyright license to
+    reproduce, prepare derivative works of, publicly display, publicly perform,
+    distribute and sublicense the Contribution of such Contributor, if any, and
+    such derivative works, in source code and object code form.
+
+    b) Subject to the terms of this Agreement, each Contributor hereby grants
+    Recipient a non-exclusive, worldwide, royalty-free patent license under
+    Licensed Patents to make, use, sell, offer to sell, import and otherwise
+    transfer the Contribution of such Contributor, if any, in source code and
+    object code form. This patent license shall apply to the combination of the
+    Contribution and the Program if, at the time the Contribution is added by
+    the Contributor, such addition of the Contribution causes such combination
+    to be covered by the Licensed Patents. The patent license shall not apply to
+    any other combinations which include the Contribution. No hardware per se is
+    licensed hereunder.
+
+    c) Recipient understands that although each Contributor grants the licenses
+    to its Contributions set forth herein, no assurances are provided by any
+    Contributor that the Program does not infringe the patent or other
+    intellectual property rights of any other entity. Each Contributor disclaims
+    any liability to Recipient for claims brought by any other entity based on
+    infringement of intellectual property rights or otherwise. As a condition to
+    exercising the rights and licenses granted hereunder, each Recipient hereby
+    assumes sole responsibility to secure any other intellectual property rights
+    needed, if any. For example, if a third party patent license is required to
+    allow Recipient to distribute the Program, it is Recipient's responsibility
+    to acquire that license before distributing the Program.
+
+    d) Each Contributor represents that to its knowledge it has sufficient
+    copyright rights in its Contribution, if any, to grant the copyright license
+    set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its
+own license agreement, provided that:
+
+    a) it complies with the terms and conditions of this Agreement; and
+
+    b) its license agreement:
+
+    i) effectively disclaims on behalf of all Contributors all warranties and
+    conditions, express and implied, including warranties or conditions of title
+    and non-infringement, and implied warranties or conditions of merchantability
+    and fitness for a particular purpose;
+
+    ii) effectively excludes on behalf of all Contributors all liability for
+    damages, including direct, indirect, special, incidental and consequential
+    damages, such as lost profits;
+
+    iii) states that any provisions which differ from this Agreement are offered
+    by that Contributor alone and not by any other party; and
+
+    iv) states that source code for the Program is available from such Contributor,
+    and informs licensees how to obtain it in a reasonable manner on or through
+    a medium customarily used for software exchange. 
+
+When the Program is made available in source code form:
+
+    a) it must be made available under this Agreement; and
+
+    b) a copy of this Agreement must be included with each copy of the Program. 
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if
+any, in a manner that reasonably allows subsequent Recipients to identify the
+originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with
+respect to end users, business partners and the like. While this license is
+intended to facilitate the commercial use of the Program, the Contributor who
+includes the Program in a commercial product offering should do so in a manner
+which does not create potential liability for other Contributors. Therefore, if
+a Contributor includes the Program in a commercial product offering, such
+Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses, damages
+and costs (collectively "Losses") arising from claims, lawsuits and other legal
+actions brought by a third party against the Indemnified Contributor to the
+extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product offering.
+The obligations in this section do not apply to any claims or Losses relating to
+any actual or alleged intellectual property infringement. In order to qualify,
+an Indemnified Contributor must: a) promptly notify the Commercial Contributor 
+n writing of such claim, and b) allow the Commercial Contributor to control,
+and cooperate with the Commercial Contributor in, the defense and any related
+settlement negotiations. The Indemnified Contributor may participate in any such
+claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor. If that
+Commercial Contributor then makes performance claims, or offers warranties
+related to Product X, those performance claims and warranties are such Commercial
+Contributor's responsibility alone. Under this section, the Commercial
+Contributor would have to defend claims against the other Contributors related
+to those performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor must pay
+those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
+Recipient is solely responsible for determining the appropriateness of using
+and distributing the Program and assumes all risks associated with its exercise
+of rights under this Agreement, including but not limited to the risks and costs
+of program errors, compliance with applicable laws, damage to or loss of data,
+programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable
+law, it shall not affect the validity or enforceability of the remainder of the
+terms of this Agreement, and without further action by the parties hereto, such
+provision shall be reformed to the minimum extent necessary to make such
+provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to
+a patent applicable to software (including a cross-claim or counterclaim in a
+lawsuit), then any patent licenses granted by that Contributor to such Recipient
+under this Agreement shall terminate as of the date such litigation is filed.
+In addition, if Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
+itself (excluding combinations of the Program with other software or hardware)
+infringes such Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply
+with any of the material terms or conditions of this Agreement and does not cure
+such failure in a reasonable period of time after becoming aware of such
+noncompliance. If all Recipient's rights under this Agreement terminate, Recipient
+agrees to cease use and distribution of the Program as soon as reasonably
+practicable. However, Recipient's obligations under this Agreement and any
+licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in
+order to avoid inconsistency the Agreement is copyrighted and may only be modified
+in the following manner. The Agreement Steward reserves the right to publish new
+versions (including revisions) of this Agreement from time to time. No one other
+than the Agreement Steward has the right to modify this Agreement. IBM is the
+initial Agreement Steward. IBM may assign the responsibility to serve as the
+Agreement Steward to a suitable separate entity. Each new version of the Agreement
+will be given a distinguishing version number. The Program (including Contributions)
+may always be distributed subject to the version of the Agreement under which it
+was received. In addition, after a new version of the Agreement is published,
+Contributor may elect to distribute the Program (including its Contributions)
+under the new version. Except as expressly stated in Sections 2(a) and 2(b) above,
+Recipient receives no rights or licenses to the intellectual property of any
+Contributor under this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this Agreement
+are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to this
+Agreement will bring a legal action under this Agreement more than one year after
+the cause of action arose. Each party waives its rights to a jury trial in any
+resulting litigation.
+

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/log4j.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/log4j.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/log4j.jar.license.txt
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/log4j.jar.license.txt	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/lib/ext/build-time/log4j.jar.license.txt	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-jci-core-1.0-406301.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-jci-core-1.0-406301.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-jci-janino-2.4.3.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-jci-janino-2.4.3.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-lang-2.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-lang-2.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-logging.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/drools-compiler-3.0.4.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/drools-compiler-3.0.4.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/drools-core-3.0.4.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/drools-core-3.0.4.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/janino-2.4.3.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/janino-2.4.3.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/lib/ext/stringtemplate-2.3b6.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/jbrules/lib/ext/stringtemplate-2.3b6.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/DslHelper.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/DslHelper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/DslHelper.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,175 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.services.routing.cbr;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.xml.sax.InputSource;
+
+/**
+ * Domain Specific Language helper. Right now this supports the use of XPath, but this class can
+ * be beefed up upo to use other technologies as well.
+ * 
+ * @author kstam at redhat.com
+ *
+ */
+public class DslHelper 
+{
+	private static Logger log = Logger.getLogger(DslHelper.class);
+	/** XPath instance */
+	private static XPathFactory xpf = XPathFactory.newInstance();
+	/** 
+	 * Uses XPath to look for the occurence of a certain tag, specific in the xpath expression.
+	 * 
+	 * @param message - the ESB Message which body content will be used.
+	 * @param xpathExp - XPath expression to find a node.
+	 * @return true if the node is found and false in all other cases.
+	 * @throws XPathExpressionException
+	 */
+	public static boolean xmlContentMatches(Message message, String xpathExp) throws XPathExpressionException 
+	{
+		if (log.isDebugEnabled()) {
+			log.debug("Trying to match xpath: '" + xpathExp +  "' in message=" + message);
+		}
+		XPath xpath = xpf.newXPath();
+		InputSource inputSource = new InputSource(new ByteArrayInputStream(message.getBody().getByteArray()));
+		Object node = xpath.evaluate(xpathExp, inputSource, XPathConstants.NODE);
+		if (log.isDebugEnabled()) {
+			log.debug("Found node=" + node);
+		}
+		return node != null;
+	}
+	/** 
+	 * Uses XPath to look for the occurence of a certain tag, specific in the xpath expression.
+	 * 
+	 * @param message - the ESB Message which body content will be used.
+	 * @param xpathExp - XPath expression to find a node.
+	 * @param value - used to compare against the result found using the XPath expression.
+	 * @return true if equal, false in all other cases.
+	 * @throws XPathExpressionException
+	 */
+	public static boolean xmlContentEquals(Message message, String xpathExp, String value) throws XPathExpressionException 
+	{
+		if (log.isDebugEnabled()) {
+			log.debug("Trying to match xpath: '" + xpathExp +  "' in message=" + message.getBody().getByteArray());
+		}
+		XPath xpath = xpf.newXPath();
+		InputSource inputSource = new InputSource(new ByteArrayInputStream(message.getBody().getByteArray()));
+		String nodeValue = (String) xpath.evaluate(xpathExp, inputSource, XPathConstants.STRING);
+		if (log.isDebugEnabled()) {
+			log.debug("Found nodeValue=" + nodeValue + " which is matched to given value=" + value);
+		}
+		return value.equals(nodeValue);
+	}
+
+	/** 
+	 * Uses XPath to look for the occurence of a certain tag, specific in the xpath expression.
+	 * 
+	 * @param message - the ESB Message which body content will be used.
+	 * @param xpathExp - XPath expression to find a node.
+	 * @param value - used to compare against the result found using the XPath expression.
+	 * @return true if node (returned by the xpath expression) is greater than the current value, false in all other cases.
+	 * @throws XPathExpressionException
+	 */
+	public static boolean xmlContentGreaterThan(Message message, String xpathExp, String value) throws XPathExpressionException 
+	{
+		String nodeValue=null;
+		double doubleValue=0;
+		double doubleNodeValue=0;
+		
+		if (log.isDebugEnabled()) {
+			log.debug("Trying to match xpath: '" + xpathExp +  "' in message=" + message.getBody().getByteArray());
+		}
+		XPath xpath = xpf.newXPath();
+		InputSource inputSource = new InputSource(new ByteArrayInputStream(message.getBody().getByteArray()));	
+		nodeValue = (String) xpath.evaluate(xpathExp, inputSource, XPathConstants.STRING);if (log.isDebugEnabled()) {
+			log.debug("Found nodeValue=" + nodeValue + " which is matched to given value=" + value);
+		}
+		if (nodeValue!=null && !"".equals(nodeValue)) {
+			
+			try {
+				doubleValue = Double.parseDouble(value);
+			} catch (NumberFormatException ne) {
+				log.equals("Could not parse value=" + doubleValue + " to double");
+			}
+			try {
+				doubleNodeValue = Double.parseDouble(nodeValue);
+			} catch (NumberFormatException ne) {
+				log.equals("Could not parse nodeValue=" + doubleNodeValue + " to double");
+			}
+			if (doubleNodeValue > doubleValue) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	/** 
+	 * Uses XPath to look for the occurence of a certain tag, specific in the xpath expression.
+	 * 
+	 * @param message - the ESB Message which body content will be used.
+	 * @param xpathExp - XPath expression to find a node.
+	 * @param value - used to compare against the result found using the XPath expression.
+	 * @return true if node (returned by the xpath expression) is less than the current value, false in all other cases.
+	 * @throws XPathExpressionException
+	 */
+	public static boolean xmlContentLessThan(Message message, String xpathExp, String value) throws XPathExpressionException 
+	{
+		String nodeValue=null;
+		double doubleValue=0;
+		double doubleNodeValue=0;
+		
+		if (log.isDebugEnabled()) {
+			log.debug("Trying to match xpath: '" + xpathExp +  "' in message=" + message.getBody().getByteArray());
+		}
+		XPath xpath = xpf.newXPath();
+		InputSource inputSource = new InputSource(new ByteArrayInputStream(message.getBody().getByteArray()));	
+		nodeValue = (String) xpath.evaluate(xpathExp, inputSource, XPathConstants.STRING);if (log.isDebugEnabled()) {
+			log.debug("Found nodeValue=" + nodeValue + " which is matched to given value=" + value);
+		}
+		if (nodeValue!=null && !"".equals(nodeValue)) {
+			
+			try {
+				doubleValue = Double.parseDouble(value);
+			} catch (NumberFormatException ne) {
+				log.equals("Could not parse value=" + doubleValue + " to double");
+			}
+			try {
+				doubleNodeValue = Double.parseDouble(nodeValue);
+			} catch (NumberFormatException ne) {
+				log.equals("Could not parse nodeValue=" + doubleNodeValue + " to double");
+			}
+			if (doubleNodeValue < doubleValue) {
+				return true;
+			}
+		}
+		return false;
+	}
+}
+	


Property changes on: labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/DslHelper.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,253 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.services.routing.cbr;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Priority;
+import org.drools.RuleBase;
+import org.drools.RuleBaseFactory;
+import org.drools.WorkingMemory;
+import org.drools.compiler.DroolsParserException;
+import org.drools.compiler.PackageBuilder;
+import org.drools.compiler.PackageBuilderConfiguration;
+import org.drools.rule.Package;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+import org.jboss.soa.esb.services.routing.cbr.CBRException;
+import org.jboss.soa.esb.services.routing.cbr.ContentBasedRouter;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * The Implementation of a rule based Content Router. Here we use JBossRules. We
+ * keep a HashMap of so called working memories for performance reasons.
+ * 
+ * @author kstam at redhat.com
+ * 
+ */
+public class JBossRulesRouter extends ContentBasedRouter
+{
+	private static Map<String, RuleBase> ruleBases = new ConcurrentHashMap<String, RuleBase>();
+
+	private static Map<String, String> ruleSets = new ConcurrentHashMap<String, String>();
+
+	private static Logger logger = Logger.getLogger(JBossRulesRouter.class);
+
+	/**
+     * Route the message with a reference to the ruleSets supplied in the message.
+     * Not implemented.
+	 * 
+	 * @param message - Message that needs routing.
+	 */
+	public List<String> route (Message message)
+    throws MessageRouterException
+	{
+        logger.error("Not implemented");
+		return null;
+	}
+
+	/**
+	 * Route the message, using the given ruleSet (drl).
+	 * 
+	 * @param ruleSet -
+	 *            Filename of the drl that will be used.
+	 * @param message -
+	 *            Message that needs routing.
+	 */
+	public List<String> route (String ruleSet, boolean ruleReload,
+			Message message) throws MessageRouterException
+	{
+		return route(ruleSet, null, ruleReload, message);
+	}
+
+	/**
+	 * Route the message, where the routing rules are supplied as part of the
+	 * message itself. We don't support this yet, as I don't see the need right
+	 * now. However when the need arises, this is were it goes.
+	 * 
+	 * @param ruleSet -
+	 *            Filename of the drl that will be used.
+	 * @param ruleLanguage -
+	 *            Filename of the dsl that will be used.
+	 * @param message -
+	 *            Message that needs routing.
+	 */
+	@SuppressWarnings("unchecked")
+	public List<String> route (String ruleSet, String ruleLanguage,
+			boolean ruleReload, Message message) throws MessageRouterException
+	{
+        List<String> destinations = new ArrayList();
+		try {
+    		String newRuleSet = null;
+    		boolean isRulesChanged = false;
+    
+    		if (ruleReload)
+    		{
+    			String currentRuleSet = ruleSets.get(ruleSet);
+    			newRuleSet = getRules(ruleSet, ruleLanguage);
+    			if (currentRuleSet == null || !currentRuleSet
+    					.equals(newRuleSet))
+    			{
+    				isRulesChanged = true;
+    			}
+    		}
+    		RuleBase ruleBase = ruleBases.get(ruleSet);
+    		if (ruleBase == null || isRulesChanged)
+    		{
+    			logger.log(Priority.DEBUG,
+    					"Reading ruleSet from file=" + ruleSet);
+    			ruleBase = readRuleBase(ruleSet, ruleLanguage);
+    			if (ruleBase != null) ruleBases.put(ruleSet, ruleBase);
+    			if (newRuleSet == null)
+    			{
+    				newRuleSet = getRules(ruleSet, ruleLanguage);
+    			}
+    			if (ruleSet != null) ruleSets.put(ruleSet, newRuleSet);
+    		}
+    		WorkingMemory workingMemory = ruleBase.newWorkingMemory();
+    		logger.log(Priority.DEBUG,
+    				"Obtained message=" + message + " with ruleSet=" + ruleSet);
+    		workingMemory.setGlobal("destinations", destinations);
+    		workingMemory.assertObject(message);
+    		logger.log(Priority.DEBUG, "Fire the JBossRules Engine");
+    		workingMemory.fireAllRules();
+    		logger.log(Priority.DEBUG,
+    				"Outgoing Destinations: " + destinations);
+            return destinations;
+        } catch (IOException ioe) {
+            throw new MessageRouterException("Could not read the rules. " +  ioe.getMessage(), ioe);
+        } catch (DroolsParserException dpe) {
+            throw new MessageRouterException("Could not parse the rules. " +  dpe.getMessage(), dpe);
+        } catch (CBRException cbre) {
+            throw new MessageRouterException("Could not parse the rules. " +  cbre.getMessage(), cbre);
+        }
+	}
+
+	/**
+	 * Reading the rules and dsl from files. Note that we may want to allow
+	 * other ways to set the rule, but for now it's just files.
+	 */
+	private static RuleBase readRuleBase (String rulesFile, String ruleLanguage)
+			throws DroolsParserException, IOException, CBRException
+	{
+		// read in the rules
+		logger.debug("Going to read the rule: " + rulesFile);
+		InputStream inputStreamDrl = ClassUtil.getResourceAsStream("/" + rulesFile, JBossRulesRouter.class);
+		if (inputStreamDrl == null)
+		{
+			logger.error("Could not find rulesFile: " + rulesFile);
+			return null;
+		}
+		else
+		{
+			Reader rules = new InputStreamReader(inputStreamDrl);
+            PackageBuilderConfiguration pkgBuilderCfg = new PackageBuilderConfiguration();
+            pkgBuilderCfg.setCompiler(PackageBuilderConfiguration.JANINO);
+            PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);
+			// this wil parse and compile in one step
+			if (ruleLanguage == null)
+			{
+				builder.addPackageFromDrl(rules);
+			}
+			else
+			{
+				logger.debug("Going to read the language: " + ruleLanguage);
+				InputStream inputStreamDsl = ClassUtil.getResourceAsStream("/" + ruleLanguage, JBossRulesRouter.class);
+				if (inputStreamDsl == null)
+				{
+					logger.error("Could not find ruleLanguage: " + rulesFile);
+				}
+				else
+				{
+					Reader dsl = new InputStreamReader(inputStreamDsl);
+					builder.addPackageFromDrl(rules, dsl);
+				}
+			}
+			// get the compiled package (which is serializable)
+			Package pkg = builder.getPackage();
+			// add the package to a rulebase (deploy the rule package).
+			try
+			{
+				RuleBase ruleBase = RuleBaseFactory.newRuleBase();
+				ruleBase.addPackage(pkg);
+				return ruleBase;
+			} catch (Exception ex) {
+				throw new CBRException(ex.getMessage(), ex);
+			}
+		}
+	}
+
+	/**
+	 * Reading the rules and dsl from files. Note that we may want to allow
+	 * other ways to set the rule, but for now it's just files.
+	 */
+	private static String getRules (String rulesFile, String ruleLanguage)
+			throws IOException
+	{
+		logger.debug("Going to hash the rule: " + rulesFile);
+		InputStream inputStreamDrl = ClassUtil.getResourceAsStream("/" + rulesFile, JBossRulesRouter.class);
+		if (inputStreamDrl == null)
+		{
+			logger.error("Could not find rulesFile: " + rulesFile);
+			return null;
+		}
+		else
+		{
+			String rules = getString(inputStreamDrl);
+			String language = "";
+			if (ruleLanguage != null)
+			{
+				logger.debug("Going to hash the language: " + ruleLanguage);
+				InputStream inputStreamDsl = ClassUtil.getResourceAsStream("/" + ruleLanguage, JBossRulesRouter.class);
+				if (inputStreamDrl == null)
+				{
+					logger.error("Could not find language: " + ruleLanguage);
+				}
+				else
+				{
+					language = getString(inputStreamDsl);
+				}
+			}
+			return rules + language;
+		}
+
+	}
+
+	private static String getString (InputStream in) throws IOException
+	{
+		StringBuffer stringBuffer = new StringBuffer();
+		byte[] b = new byte[4096];
+		for (int i; (i = in.read(b)) != -1;)
+		{
+			stringBuffer.append(new String(b, 0, i));
+		}
+		return stringBuffer.toString();
+	}
+}


Property changes on: labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/jbrules/src/main/resources/JBossESBRules-XPath.drl
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/main/resources/JBossESBRules-XPath.drl	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/main/resources/JBossESBRules-XPath.drl	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,47 @@
+#created on: Nov 8, 2006
+package com.jboss.soa.esb.routing.cbr
+
+#list any import classes here.
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+
+expander XPathLanguage.dsl
+
+#declare any global variables here
+global java.util.List destinations;
+
+rule "Routing Rule using XPATH match"
+	
+	when
+		xpathMatch "/jbossesb"
+	then 
+		Log : "XPath Matched";
+		Destination : "XML_XPath_Destination";
+end
+
+rule "Routing Rule using XPATH equals"
+	
+	when
+		xpathEquals "/Dave", "rocks"
+	then 
+		Log : "XPath Equals";
+		Destination : "XML_XPath_Dave_Destination";
+end
+
+rule "Routing Rule using XPATH greater than"
+	
+	when
+	    xpathGreaterThan "/price" , "1.00"
+	then 
+		Log : "XPath Greater Then";
+		Destination : "XML_XPath_GreaterThan_Destination";
+end
+
+rule "Routing Rule using XPATH less than"
+	
+	when
+		xpathLessThan "/price", "1.00"
+	then 
+		Log : "XPath Less Then";
+		Destination : "XML_XPath_LessThan_Destination";
+end

Added: labs/jbossesb/trunk/product/services/jbrules/src/main/resources/JBossESBRules.drl
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/main/resources/JBossESBRules.drl	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/main/resources/JBossESBRules.drl	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,29 @@
+#created on: Oct 30, 2006
+package com.jboss.soa.esb.routing.cbr
+
+#list any import classes here.
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+
+#declare any global variables here
+global java.util.List destinations;
+
+
+rule "Routing Rule - Serialized based message"
+	
+	when
+		Message( type == MessageType.JAVA_SERIALIZED)
+	then
+		System.out.println("Serialized");
+		destinations.add("serialized-destination");
+		
+end
+
+rule "Routing Rule - XML based message"
+	
+	when
+		Message( type == MessageType.JBOSS_XML)
+	then 
+		System.out.println("JBoss_XML"); 
+		destinations.add("xml-destination");
+end
\ No newline at end of file

Added: labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/deployment.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/deployment.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbossesb-deployment>
+  <depends>jboss.esb:deployment=jbossesb.esb</depends>
+</jbossesb-deployment>


Property changes on: labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/deployment.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/jboss-esb.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,47 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+     <!--  
+     		jbossesb internal services 
+     -->
+     
+     <providers>
+          <jms-provider name="Default-JMS-Provider" connection-factory="ConnectionFactory">          
+              <jms-bus busid="DeadMessageQueue">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/DeadMessageQueue"
+                  />
+              </jms-bus>
+          </jms-provider>
+      </providers>
+      
+     <services>   
+        <service category="JBossESB-Internal" 
+                 name="DeadLetterService" 
+                 description="Dead Messages can be send to this service, which is configured to store and/or
+                 notify" >
+            <listeners>
+                <jms-listener name="JMS-DLQListener"
+                              busidref="DeadMessageQueue"
+                              maxThreads="1"
+                />                
+            </listeners>
+            <actions>
+               <action name="PersistAction" 
+               		class="org.jboss.soa.esb.actions.MessagePersister" >
+               		<property name="classfication" value="DLQ"/>
+               		<property name="message-store-type" value="urn:jboss/esb/persistence/type/DATABASE"/>
+               </action>
+               <action name="notificationAction" 
+               		class="org.jboss.soa.esb.actions.Notifier">
+               		<property name="okMethod" value="notifyOK" />
+               		<property name="notification-details">
+   	 				   <NotificationList> 
+      				     <target class="NotifyConsole" />
+	    		   	   </NotificationList> 
+	    		   </property>
+   	   			</action>    
+            </actions>
+        </service>
+      </services>
+</jbossesb>


Property changes on: labs/jbossesb/trunk/product/services/jbrules/src/main/resources/META-INF/jboss-esb.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/jbrules/src/main/resources/XPathLanguage.dsl
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/main/resources/XPathLanguage.dsl	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/main/resources/XPathLanguage.dsl	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,7 @@
+#JBossESB Content Based Routing using XPath DSL
+[when]xpathMatch "{xpath}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentMatches(msg, "{xpath}") )
+[when]xpathEquals "{xpath}", "{value}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentEquals(msg, "{xpath}", "{value}") )
+[when]xpathGreaterThan "{xpath}", "{value}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentGreaterThan(msg, "{xpath}", "{value}") )
+[when]xpathLessThan "{xpath}", "{value}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentLessThan(msg, "{xpath}", "{value}") )
+[then]Log : "{message}"=System.out.println("{message}");
+[then]Destination : "{message}"=destinations.add("{message}");

Added: labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouterUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouterUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouterUnitTest.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.services.routing.cbr;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+import org.junit.Test;
+
+/**
+ * 
+ * @author kurt.stam at redhat.com
+ *
+ */
+public class JBossRulesRouterUnitTest
+{
+	@Test
+	public void routeSerializedMessage()
+	{
+        //new messages
+		Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+		//set some properties inside the Message
+		message.getProperties().setProperty("prop1", "val1");
+		message.getProperties().setProperty("prop2", "val2");
+		//set the body inside the Message
+		message.getBody().setByteArray(("TEST BODY").getBytes());
+		//set some object attachments inside the Message
+		message.getAttachment().addItem(new String("TEST ATTACHMENT1"));
+		message.getAttachment().addItem(new String("TEST ATTACHMENT2"));
+		
+		JBossRulesRouter jbossRulesRouter = new JBossRulesRouter();
+        try {
+    		List<String> destinationServices = jbossRulesRouter.route("JBossESBRules.drl", false, message);
+    		assertEquals(destinationServices.iterator().next(),"serialized-destination");
+        } catch (MessageRouterException mre) {
+            System.out.println("Exception was thrown.");
+            mre.printStackTrace();
+            assertTrue(false);
+        }
+	}
+	
+	@Test
+	public void routeXMLMessage()
+	{
+		//add new messages
+		Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+		//set some properties inside the Message
+		message.getProperties().setProperty("prop1", "val1");
+		message.getProperties().setProperty("prop2", "val2");
+		//set the body inside the Message
+		message.getBody().setByteArray(("TEST BODY").getBytes());
+		//set some object attachments inside the Message
+		message.getAttachment().addItem(new String("TEST ATTACHMENT1"));
+		message.getAttachment().addItem(new String("TEST ATTACHMENT2"));
+	
+		JBossRulesRouter jbossRulesRouter = new JBossRulesRouter();
+        try {
+    		List<String> destinationServices = jbossRulesRouter.route("JBossESBRules.drl", false, message);
+    		assertEquals(destinationServices.iterator().next(),"xml-destination");
+        } catch (MessageRouterException mre) {
+            System.out.println("Exception was thrown.");
+            mre.printStackTrace();
+            assertTrue(false);
+        }
+	}
+	
+	public static junit.framework.Test suite() {
+		return new JUnit4TestAdapter(JBossRulesRouterUnitTest.class);
+	}
+
+}


Property changes on: labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouterUnitTest.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/esb/services/routing/cbr/ContentBasedRoutingUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/esb/services/routing/cbr/ContentBasedRoutingUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/esb/services/routing/cbr/ContentBasedRoutingUnitTest.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.services.routing.cbr;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.junit.BeforeClass;
+import org.junit.Test;
+/**
+ * 
+ * @author kurt.stam at redhat.com
+ *
+ */
+public class ContentBasedRoutingUnitTest
+{
+	@Test
+	public void routeSerializedMessage()
+	{
+		try {
+            //new messages
+			Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+			//set some properties inside the Message
+			message.getProperties().setProperty("prop1", "val1");
+			message.getProperties().setProperty("prop2", "val2");
+			//set the body inside the Message
+			message.getBody().setByteArray(("TEST BODY").getBytes());
+			//set some object attachments inside the Message
+			message.getAttachment().addItem(new String("TEST ATTACHMENT1"));
+			message.getAttachment().addItem(new String("TEST ATTACHMENT2"));
+			
+			ContentBasedRouter cbr = ContentBasedRouterFactory.getRouter(org.jboss.soa.esb.actions.ContentBasedRouter.DEFAULT_CBR_CLASS);
+			List<String> destinationServices = cbr.route("JBossESBRules.drl",false,message);
+			assertEquals(destinationServices.iterator().next(),"serialized-destination");
+		} catch (MessageRouterException e) {
+			e.printStackTrace();
+			assertTrue(false);
+		}
+	}
+	
+	@Test
+	public void routeXMLMessage()
+	{
+		try {
+			//add new messages
+			Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+			//set some properties inside the Message
+			message.getProperties().setProperty("prop1", "val1");
+			message.getProperties().setProperty("prop2", "val2");
+			//set the body inside the Message
+			message.getBody().setByteArray(("TEST BODY").getBytes());
+			//set some object attachments inside the Message
+			message.getAttachment().addItem(new String("TEST ATTACHMENT1"));
+			message.getAttachment().addItem(new String("TEST ATTACHMENT2"));
+			
+			ContentBasedRouter cbr = ContentBasedRouterFactory.getRouter(org.jboss.soa.esb.actions.ContentBasedRouter.DEFAULT_CBR_CLASS);
+			List<String> destinationServices = cbr.route("JBossESBRules.drl",false,message);
+			assertEquals(destinationServices.iterator().next(),"xml-destination");
+		} catch (MessageRouterException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	@Test
+	public void routeXMLMessageUsingXPathMatch()
+	{
+		try {
+			//add new messages
+			Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+			//set some properties inside the Message
+			message.getProperties().setProperty("prop1", "val1");
+			message.getProperties().setProperty("prop2", "val2");
+			//set the body inside the Message
+			message.getBody().setByteArray(("<jbossesb>TEST BODY</jbossesb>").getBytes());
+			//set some object attachments inside the Message
+			message.getAttachment().addItem(new String("TEST ATTACHMENT1"));
+			message.getAttachment().addItem(new String("TEST ATTACHMENT2"));
+			
+			ContentBasedRouter cbr = ContentBasedRouterFactory.getRouter(org.jboss.soa.esb.actions.ContentBasedRouter.DEFAULT_CBR_CLASS);
+			List<String> destinationServices = cbr.route("JBossESBRules-XPath.drl","XPathLanguage.dsl",false,message);
+			assertEquals(destinationServices.iterator().next(),"XML_XPath_Destination");
+		} catch (MessageRouterException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	@Test
+	public void routeXMLMessageUsingXPathEquals()
+	{
+		try {
+			//add new messages
+			Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+			//set the body inside the Message
+			message.getBody().setByteArray(("<Dave>rocks</Dave>").getBytes());
+		
+			ContentBasedRouter cbr = ContentBasedRouterFactory.getRouter(org.jboss.soa.esb.actions.ContentBasedRouter.DEFAULT_CBR_CLASS);
+			List<String> destinationServices = cbr.route("JBossESBRules-XPath.drl","XPathLanguage.dsl",false,message);
+			assertEquals(destinationServices.iterator().next(),"XML_XPath_Dave_Destination");
+		} catch (MessageRouterException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	@Test
+	public void routeXMLMessageUsingXPathGreaterThen()
+	{
+		try {
+			//add new messages
+			Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+			//set the body inside the Message
+			message.getBody().setByteArray(("<price>1.55</price>").getBytes());
+			
+			ContentBasedRouter cbr = ContentBasedRouterFactory.getRouter(org.jboss.soa.esb.actions.ContentBasedRouter.DEFAULT_CBR_CLASS);
+			List<String> destinationServices = cbr.route("JBossESBRules-XPath.drl","XPathLanguage.dsl",false,message);
+			assertEquals(destinationServices.iterator().next(),"XML_XPath_GreaterThan_Destination");
+		} catch (MessageRouterException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	@Test
+	public void routeXMLMessageUsingXPathLessThen()
+	{
+		try {
+			//add new messages
+			Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+			//set the body inside the Message
+			message.getBody().setByteArray(("<price>0.55</price>").getBytes());
+			
+			ContentBasedRouter cbr = ContentBasedRouterFactory.getRouter(org.jboss.soa.esb.actions.ContentBasedRouter.DEFAULT_CBR_CLASS);
+			List<String> destinationServices = cbr.route("JBossESBRules-XPath.drl","XPathLanguage.dsl",false,message);
+			assertEquals(destinationServices.iterator().next(),"XML_XPath_LessThan_Destination");
+		} catch (MessageRouterException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	@BeforeClass
+	public static void runBeforeAllTests() throws Exception 
+	{
+		try {
+			TestEnvironmentUtil.setESBPropertiesFileToUse();
+		} catch (Exception e) {
+			e.printStackTrace();
+			System.out.println("We should stop testing, since we don't any config properties");
+			assertTrue(false);
+		}
+	}
+	
+	public static junit.framework.Test suite() {
+		return new JUnit4TestAdapter(ContentBasedRoutingUnitTest.class);
+	}
+	
+}


Property changes on: labs/jbossesb/trunk/product/services/jbrules/src/test/java/org/jboss/soa/esb/services/routing/cbr/ContentBasedRoutingUnitTest.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/jbrules/src/test/resources/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/test/resources/log4j.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/jbrules/src/test/resources/log4j.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="org.jbpm">
+      <priority value="INFO"/>
+   </category>
+   <category name="org.hibernate">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.jboss.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss.internal.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.apache">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss.soa.esb.services.jbpm">
+      <priority value="DEBUG"/>
+   </category>
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>


Property changes on: labs/jbossesb/trunk/product/services/jbrules/src/test/resources/log4j.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native


Property changes on: labs/jbossesb/trunk/product/services/soapui-client
___________________________________________________________________
Name: svn:ignore
   + target


Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/ContentBasedRouterTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/ContentBasedRouterTest.java	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/ContentBasedRouterTest.java	2007-05-21 16:12:23 UTC (rev 12027)
@@ -1,277 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.actions;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.InputStream;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Properties;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.xml.DOMConfigurator;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.listeners.StandAloneBootStrapper;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Testing the Content Based Router.
- * 
- * @author <a href="mailto:kurt.stam at redhat.com">Kurt Stam</a>
- * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
- * @since Version 4.0
- * 
- */
-public class ContentBasedRouterTest
-{
-	private static Logger logger = Logger.getLogger(ContentBasedRouterTest.class);
-
-	private static StandAloneBootStrapper _boot = null;
-
-	private static String mDbDriver;
-
-	private static String mDbUrl;
-
-	private static String mDbUsername;
-
-	private static String mDbPassword;
-
-	private static final String SERVICE_CATEGORY_NAME = "MessageRouting";
-
-	private static final String SERVICE_NAME = "ContentBasedRoutingService";
-
-	/**
-	 * Testing the Content Based Router.
-	 */
-	@Test
-	public void sendMessages()
-	{
-		try
-		{
-			sendMessage("First Message");
-			// The second time the rulesEngine should be primed.
-			sendMessage("Second Message");
-		}
-		catch (RegistryException re)
-		{
-			re.printStackTrace();
-			assertTrue(false);
-		}
-		catch (CourierException ce)
-		{
-			ce.printStackTrace();
-			assertTrue(false);
-		}
-		catch (MalformedEPRException me)
-		{
-			me.printStackTrace();
-			assertTrue(false);
-		}
-	}
-
-	/**
-	 * Sends a message to the CbrJmsQueueListener.
-	 * 
-	 * @param body -
-	 *            a String containing the body of the message.
-	 * @throws RegistryException
-	 * @throws CourierException
-	 * @throws MalformedEPRException
-	 */
-	
-	private static void sendMessage(String body) throws RegistryException, CourierException, MalformedEPRException
-	{
-		Message msg = MessageFactory.getInstance().getMessage();
-		msg.getBody().setByteArray(body.getBytes());
-		
-		Registry registry = RegistryFactory.getRegistry();
-		Collection<EPR> eprs = registry.findEPRs(SERVICE_CATEGORY_NAME,
-				SERVICE_NAME);
-		for (Iterator<EPR> eprIterator = eprs.iterator(); eprIterator.hasNext();)
-		{
-			// Just use the first EPR in the list.
-			EPR epr = eprIterator.next();
-			Courier courier = CourierFactory.getCourier(epr);
-			courier.deliver(msg);
-			break;
-		}
-	}
-
-	public static junit.framework.Test suite()
-	{
-		return new JUnit4TestAdapter(ContentBasedRouterTest.class);
-	}
-
-	@BeforeClass
-	public static void runBeforeAllTests()
-	{
-		try
-		{
-			DOMConfigurator.configure(TestEnvironmentUtil.getUserDir("product",
-					"../product")
-					+ "etc/test/resources/log4j.xml");
-			TestEnvironmentUtil.setESBPropertiesFileToUse("product",
-					"../product");
-			// Set the juddi properties file in System so juddi will pick it up
-			// later and use the test values.
-			String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-qatest.properties";
-			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
-			// Read this properties file to get the db connection string
-			Properties props = new Properties();
-			InputStream inStream = Class.class
-					.getResourceAsStream(juddiPropertiesFile);
-			props.load(inStream);
-			mDbDriver = props.getProperty("juddi.jdbcDriver");
-			mDbUrl = props.getProperty("juddi.jdbcUrl");
-			mDbUsername = props.getProperty("juddi.jdbcUsername");
-			mDbPassword = props.getProperty("juddi.jdbcPassword");
-
-			String database = "not tested yet";
-			if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
-			{
-				database = "hsqldb";
-				// Bring up hsql on default port 9001
-				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
-						"product", "../product")
-						+ "build/hsqltestdb", "juddi");
-			}
-			else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
-			{
-				database = "mysql";
-			} // add and test your own database..
-
-			// Get the registry-schema create scripts
-			String sqlDir = TestEnvironmentUtil.getUserDir("product",
-					"../product")
-					+ "install/jUDDI-registry/sql/" + database + "/";
-			// Drop what is there now, if exists. We want to start fresh.
-			String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "drop_database.sql"));
-			String sqlCreateCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "create_database.sql"));
-			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "insert_publishers.sql"));
-
-			try
-			{
-				Class.forName(mDbDriver);
-			}
-			catch (Exception e)
-			{
-				System.out.println("ERROR: failed to load " + database
-						+ " JDBC driver.");
-				e.printStackTrace();
-				return;
-			}
-			java.sql.Connection con = DriverManager.getConnection(mDbUrl,
-					mDbUsername, mDbPassword);
-			Statement stmnt = con.createStatement();
-			System.out.println("Dropping the schema if exist");
-			stmnt.execute(sqlDropCmd);
-			System.out.println("Creating the juddi-schema");
-			stmnt.execute(sqlCreateCmd);
-			System.out.println("Adding the jbossesb publisher");
-			stmnt.execute(sqlInsertPubCmd);
-
-			// Now we can bring up the ContentBasedRouter
-			String deploymentConfigFile = TestEnvironmentUtil.getUserDir("qa")
-					+ "junit/src/org/jboss/soa/esb/actions/ContentBasedRouterTest.xml";
-			String validationFileName = TestEnvironmentUtil.getUserDir(
-					"product", "../product")
-					+ "etc/schemas/xml/jbossesb-1.0.1.xsd";
-			// Make sure this file exists
-			File validationFile = new File(validationFileName);
-			if (!validationFile.exists())
-			{
-				System.err.println("Validation file "
-						+ validationFile.getAbsolutePath() + " does not exist");
-				assertTrue(false);
-			}
-			_boot = new StandAloneBootStrapper(deploymentConfigFile,
-					validationFileName);
-
-			logger
-					.info("Testing to see if we can instantiate and start ListenerManager");
-		}
-		catch (Throwable e)
-		{
-			e.printStackTrace();
-			System.out
-					.println("We should stop testing, since we don't have a db.");
-			assertTrue(false);
-		}
-
-	}
-
-	/**
-	 * Shutdown the database
-	 * 
-	 * @throws Exception
-	 */
-	@AfterClass
-	public static void runAfterAllTests() throws Exception
-	{
-        Thread.sleep(2000);
-		// Increase Sleep for debugging
-		_boot.requestEnd();
-		// Give the esb time to finish
-		Thread.sleep(2000);
-		// Cleaning up the generated files
-		String listenerConfigFile = TestEnvironmentUtil.getUserDir("qa")
-				+ "junit/src/org/jboss/soa/esb/actions/jbossesb-listener.xml";
-		File listenerFile = new File(listenerConfigFile);
-		if (listenerFile.exists())
-			listenerFile.delete();
-		String gatewayConfigFile = TestEnvironmentUtil.getUserDir("qa")
-				+ "junit/src/org/jboss/soa/esb/actions/jbossesb-gateway.xml";
-		File gatewayFile = new File(gatewayConfigFile);
-		if (gatewayFile.exists())
-			gatewayFile.delete();
-
-		if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
-		{
-			HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
-		}
-	}
-
-}

Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/ContentBasedRouterTest.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/ContentBasedRouterTest.xml	2007-05-21 15:15:12 UTC (rev 12026)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/ContentBasedRouterTest.xml	2007-05-21 16:12:23 UTC (rev 12027)
@@ -1,59 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
-parameterReloadSecs="10">
-
-    <!-- for activemq use:
-        jndi-context-factory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
-        jndi-URL="tcp://localhost:61616" -->
-    
-    <!--  for mq series use: 
-        jndi-context-factory="com.ibm.mq.jms.context.WMQInitialContextFactory"
-        jndi-URL="dev37:1414/SYSTEM.DEF.SVRCONN" -->
-    
-    <!--  for jbossmq use:
-        jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-        jndi-URL="localhost" -->
-    
-
-	<providers>
-          <jms-provider name="localhost" 
-                      connection-factory="ConnectionFactory"
-                      jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-                      jndi-URL="localhost" >
-                      
-              <jms-bus busid="QueueA">
-                  <jms-message-filter
-                      dest-type="QUEUE"
-                      dest-name="queue/A"
-                      selector="service='CBRouting-SerializableOrXml'"
-                   />
-              </jms-bus>
-          </jms-provider>
-      </providers>
-      <services>
-        <service 
-        	category="MessageRouting" 
-        	name="ContentBasedRoutingService" 
-        	description="CBR Listener">
-        	<listeners>        
-                  <jms-listener name="XPathContentBasedRouter"
-                              busidref="QueueA"
-                              maxThreads="1">          
-	             </jms-listener>
-             </listeners>
-            <actions>
-                <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
-                    <property name="message" value="Hello Content Based Router" />
-                </action>
-                <action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter">
-                    <property name="ruleSet" value="JBossESBRules.drl"/>
-                    <property name="ruleReload" value="true"/>
-                    <property name="destinations">
-                        <route-to destination-name="xml-destination-nodelivery" service-category="category01" service-name="jbossesbtest1" /> 
-                        <route-to destination-name="serialized-destination-nodelivery" service-category="category02" service-name="jbossesbtest2" /> 
-                    </property> 
-                </action>
-            </actions> 
-        </service>
-   </services>
-</jbossesb>
\ No newline at end of file




More information about the jboss-svn-commits mailing list