[jboss-svn-commits] JBL Code SVN: r7481 - in labs/jbossesb/trunk: product/core/listeners/src/org/jboss/soa/esb/listeners product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr qa/junit/src/org/jboss/soa/esb/actions qa/junit/src/org/jboss/soa/esb/listeners/message
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 8 15:00:09 EST 2006
Author: kurt.stam at jboss.com
Date: 2006-11-08 15:00:05 -0500 (Wed, 08 Nov 2006)
New Revision: 7481
Modified:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/DslHelper.java
labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTestFragment1.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTestFragment2.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.xml
Log:
Adding license text and javadoc.
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 2006-11-08 19:13:31 UTC (rev 7480)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2006-11-08 20:00:05 UTC (rev 7481)
@@ -1,3 +1,28 @@
+/*
+ * 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.
+ */
+/**
+ * Contains tag names as they can be used in the configuration.
+ *
+ */
package org.jboss.soa.esb.listeners;
public class ListenerTagNames
Modified: labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/DslHelper.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/DslHelper.java 2006-11-08 19:13:31 UTC (rev 7480)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/DslHelper.java 2006-11-08 20:00:05 UTC (rev 7481)
@@ -1,6 +1,26 @@
+/*
+ * 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;
@@ -10,10 +30,25 @@
import org.jboss.soa.esb.message.Message;
import org.xml.sax.InputSource;
-
-public class DslHelper {
+/**
+ * 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
+{
+ /** 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
{
XPath xpath = xpf.newXPath();
@@ -21,7 +56,15 @@
Object node = xpath.evaluate(xpathExp, inputSource, XPathConstants.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
{
XPath xpath = xpf.newXPath();
Modified: labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java 2006-11-08 19:13:31 UTC (rev 7480)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java 2006-11-08 20:00:05 UTC (rev 7481)
@@ -38,12 +38,12 @@
import org.drools.rule.Package;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.services.routing.MessageRouter;
-import org.jboss.soa.esb.services.routing.MessageRouterException;
import org.jboss.soa.esb.services.routing.cbr.ContentBasedRouter;
/**
+ * 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
*
*/
@@ -51,26 +51,37 @@
{
private static Map<String,WorkingMemory> workingMemories=new HashMap<String,WorkingMemory>();
private static Logger logger = Logger.getLogger(JBossRulesRouter.class);
-
/**
- * Constructor.
- * @param ruleSet String
- * @throws MessageRouterException
+ * 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 message - Message that needs routing.
*/
- public JBossRulesRouter()
- {
- super();
- }
-
public List<String> route(Message message){
logger.log(Priority.ERROR, "Do not use, this is not implemented");
//Route to /dev/null?
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, Message message) {
return route(ruleSet, null, 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, Message message)
{
@@ -104,8 +115,8 @@
}
/**
- * Reading the rules from a file, we may want to allow other ways to
- * set the rule.
+ * 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 Exception
{
Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.xml 2006-11-08 19:13:31 UTC (rev 7480)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.xml 2006-11-08 20:00:05 UTC (rev 7481)
@@ -1,3 +1,27 @@
+<!--
+/*
+ * 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.
+ */
+ -->
+
<ContentBasedRouterTest parameterReloadSecs="180">
<ContentBasedRouter
service-category="MessageRouting"
Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTestFragment1.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTestFragment1.xml 2006-11-08 19:13:31 UTC (rev 7480)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTestFragment1.xml 2006-11-08 20:00:05 UTC (rev 7481)
@@ -1,3 +1,27 @@
+<!--
+/*
+ * 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.
+ */
+ -->
+
<CbrProxyActionTest>
<action name="TestDefaultRouteAction"
class="org.jboss.soa.esb.actions.CbrProxyAction"
Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTestFragment2.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTestFragment2.xml 2006-11-08 19:13:31 UTC (rev 7480)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTestFragment2.xml 2006-11-08 20:00:05 UTC (rev 7481)
@@ -1,3 +1,27 @@
+<!--
+/*
+ * 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.
+ */
+ -->
+
<CbrProxyActionTest>
<action name="TestDefaultRouteAction"
process="route"
Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.xml 2006-11-08 19:13:31 UTC (rev 7480)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.xml 2006-11-08 20:00:05 UTC (rev 7481)
@@ -1,3 +1,27 @@
+<!--
+/*
+ * 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.
+ */
+ -->
+
<ContentBasedRouterTest parameterReloadSecs="180">
<ContentBasedRouter
service-category="MessageRouting"
More information about the jboss-svn-commits
mailing list