[jboss-svn-commits] JBL Code SVN: r17510 - in labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb: services and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jan 2 19:59:21 EST 2008


Author: jeffdelong
Date: 2008-01-02 19:59:21 -0500 (Wed, 02 Jan 2008)
New Revision: 17510

Added:
   labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/
   labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/rules/
   labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/rules/ListenerTagNames.java
   labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/rules/RuleService.java
Log:


Added: labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/rules/ListenerTagNames.java
===================================================================
--- labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/rules/ListenerTagNames.java	                        (rev 0)
+++ labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/rules/ListenerTagNames.java	2008-01-03 00:59:21 UTC (rev 17510)
@@ -0,0 +1,50 @@
+/*
+ * 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.services.rules;
+
+/**
+ * Add several tag names for the RuleService.
+ * These could be added to org.jboss.soa.esb.listeners.ListenerTagNames;
+ *
+ * @author jdelong at redhat.com
+ *
+ */
+
+public class ListenerTagNames {
+
+	/** RuleSet reference (Filename) */
+
+	// tag names, need to be moved to ListernTagNames in the org.jboss.soa.esb.listeners.ListenerTagNames;
+	public static final String RS_CLASS = "rsClass";
+	public static final String RULE_SET_TAG = "ruleSet";
+	public static final String RULE_LANGUAGE_TAG = "ruleLanguage";
+	public static final String RULE_RELOAD_TAG = "ruleReload";
+	public static final String DECISION_TABLE_TAG = "decisionTable";
+	public static final String RULE_AGENT_PROPERTIES_TAG = "ruleAgentProperties";
+	public static final String DISPOSE_TAG = "dispose";
+	public static final String CONTINUE_TAG = "continue";
+	public static final String STATEFUL_TAG = "stateful";
+}

Added: labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/rules/RuleService.java
===================================================================
--- labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/rules/RuleService.java	                        (rev 0)
+++ labs/jbossesb/workspace/jdelong/ruleservice/JBESB_4_2_1_GA_CP/product/services/jbrules/src/main/java/org/jboss/soa/esb/services/rules/RuleService.java	2008-01-03 00:59:21 UTC (rev 17510)
@@ -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.rules;
+
+import java.util.List;
+
+import org.jboss.internal.soa.esb.services.rules.RuleServiceException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * RulesEngine Interface. Separates implementation from the runtime, allowing
+ * the ESB to support different implementations of rule engines.
+ * 
+ * @author jdelong at redhat.com
+ * 
+ */
+public interface RuleService {
+	public void setConfigTree(ConfigTree configTree);
+
+	/**
+	 * Execute rules using a certain ruleSet and domain specific language using the Stateless rule engine API
+	 * 
+	 * @param ruleSet -
+	 *            String reference to a file which contains a ruleSet.
+	 * @param dsl -
+	 *            String reference to a file which contains a custom rule
+	 *            language definition
+	 * @param ruleReload -
+	 *            if set to true, a ruleSet update should result in reloading
+	 *            the ruleSet.
+	 * @param message -
+	 *            Message that is updated with the results.
+	 * @param objectList - a list with additional objects (typically pulled from the message) to be inserted into 
+	 *            working memory 
+	 * 
+	 * @return Message with updated objects.
+	 */
+	public Message executeStatelessRules(String ruleSet, String dsl,
+			boolean ruleReload, Message message, List<Object> objectList)
+			throws RuleServiceException;
+
+	/**
+	 * Execute rules from a decision table using the Stateless rule engine API
+	 * 
+	 * @param decisionTable -
+	 *            String reference to a file which contains a spreadsheet of rules
+	 * @param ruleReload -
+	 *            if set to true, a ruleSet update should result in reloading
+	 *            the ruleSet.
+	 * @param message -
+	 *            Message that is updated with the results.
+	 * @param objectList - a list with additional objects (typically pulled from the message) to be inserted into 
+	 *            working memory 
+	 * 
+	 * @return Message with updated objects.
+	 */
+	public Message executeStatelessRulesFromDecisionTable(String decisionTable,
+			boolean ruleReload, Message message, List<Object> objectList)
+			throws RuleServiceException;
+
+	/**
+	 * Execute rules using a rule package retrieved via the Rule Agent from a URL of local file system
+	 *            using the Stateless rule engine API
+	 * 
+	 * @param ruleAgentProperties -
+	 *            String reference to a file which contains properties used by the RuleAgent to locate a rule package.
+	 * @param message -
+	 *            Message that is updated with the results.
+	 * @param objectList - a list with additional objects (typically pulled from the message) to be inserted into 
+	 *            working memory 
+	 * 
+	 * @return Message with updated objects.
+	 */
+	public Message executeStatelessRulesFromRuleAgent(
+			String ruleAgentProperties, Message message, List<Object> objectList)
+			throws RuleServiceException;
+
+	/**
+	 * Execute rules using a certain ruleSet and domain specific language using the Stateful rule engine API
+	 * 
+	 * @param ruleSet -
+	 *            String reference to a file which contains a ruleSet.
+	 * @param dsl -
+	 *            String reference to a file which contains a custom rule
+	 *            language definition
+	 * @param ruleReload -
+	 *            if set to true, a ruleSet update should result in reloading
+	 *            the ruleSet.
+	 * @param dispose -
+	 *            if set to true, working memory will be disposed after the rules are fired
+	 * @param message -
+	 *            Message that is updated with the results.
+	 * @param objectList - a list with additional objects (typically pulled from the message) to be inserted into 
+	 *            working memory 
+	 * 
+	 * @return Message with updated objects.
+	 */
+	public Message executeStatefulRules(String ruleSet, String dsl,
+			boolean ruleReload, boolean dispose, Message message,
+			List<Object> objectList) throws RuleServiceException;
+
+	/**
+	 * Execute rules from a decision table using the Stateful rule engine API
+	 * 
+	 * @param decisionTable -
+	 *            String reference to a file which contains a spreadsheet of rules
+	 * @param ruleReload -
+	 *            if set to true, a ruleSet update should result in reloading
+	 *            the ruleSet.
+	 * @param dispose -
+	 *            if set to true, working memory will be disposed after the rules are fired
+	 * @param message -
+	 *            Message that is updated with the results.
+	 * @param objectList - a list with additional objects (typically pulled from the message) to be inserted into 
+	 *            working memory 
+	 * 
+	 * @return Message with updated objects.
+	 */
+	public Message executeStatefulRulesFromDecisionTable(String decisionTable,
+			boolean ruleReload, boolean dispose, Message message,
+			List<Object> objectList) throws RuleServiceException;
+
+	/**
+	 * Execute rules using a rule package retrieved via the Rule Agent from a URL of local file system
+	 *            using the Stateful rule engine API
+	 * 
+	 * @param ruleAgentProperties -
+	 *            String reference to a file which contains properties used by the RuleAgent to locate a rule package.
+	 * @param dispose -
+	 *            if set to true, working memory will be disposed after the rules are fired
+	 * @param message -
+	 *            Message that is updated with the results.
+	 * @param objectList - a list with additional objects (typically pulled from the message)t o be inserted into 
+	 *            working memory 
+	 * 
+	 * @return Message with updated objects.
+	 */
+	public Message executeStatefulRulesFromRuleAgent(
+			String ruleAgentProperties, boolean dispose, Message message,
+			List<Object> objectList) throws RuleServiceException;
+
+	/**
+	 * Continue executing rules where the working memory already exists.
+	 * 
+	 * @param rules -
+	 *            String reference to a file, either the drl file, the decision table,
+	 *            or the ruleAgentProperties. This is used to find the ruleBase.
+	 * @param dispose -
+	 *            if set to true, working memory will be disposed after the rules are fired
+	 * @param message -
+	 *            Message that is updated with the results.
+	 * @param objectList - a list with additional objects (typically pulled from the message) to be inserted into 
+	 *            working memory 
+	 * 
+	 * @return Message with updated objects.
+	 */
+	public Message continueStatefulRulesExecution(String rules,
+			boolean dispose, Message message, List<Object> objectList)
+			throws RuleServiceException;
+
+}




More information about the jboss-svn-commits mailing list