[jboss-svn-commits] JBL Code SVN: r25966 - in labs/jbossrules/trunk: drools-api/src/main/java/org/drools/runtime and 12 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Apr 6 00:02:56 EDT 2009


Author: mark.proctor at jboss.com
Date: 2009-04-06 00:02:55 -0400 (Mon, 06 Apr 2009)
New Revision: 25966

Added:
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/CommandExecutor.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ExecutionResults.java
Removed:
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutionResults.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutor.java
Modified:
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/command/CommandFactory.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/StatefulKnowledgeSession.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/StatelessKnowledgeSession.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/help/BatchExecutionHelper.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineContext.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineFactory.java
   labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/StatelessSessionTest.java
   labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/testframework/MockWorkingMemory.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/InternalWorkingMemory.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/impl/StatefulKnowledgeSessionImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/impl/StatelessKnowledgeSessionImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/GetGlobalCommand.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/GetObjectsCommand.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/InsertObjectCommand.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/QueryCommand.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/SetGlobalCommand.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/impl/CommandBasedStatefulKnowledgeSession.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/help/impl/BatchExecutionHelperProviderImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/impl/BatchExecutionResultImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BasePipelineContext.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BatchExecutorStage.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatefulKnowledgeSessionPipelineContextImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatefulKnowledgeSessionPipelineImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatelessKnowledgeSessionPipelineContextImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatelessKnowledgeSessionPipelineImpl.java
   labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/XStreamBatchExecutionTest.java
Log:
JBRULES-1993 BatchExeution and message format
-Some refactoring to better names, like BatchExecutor is now just CommandExecutor

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/command/CommandFactory.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/command/CommandFactory.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/command/CommandFactory.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -8,12 +8,12 @@
 
 /**
  * <p>
- * The CommandFactory returns Commands that can be used by classes that implement BatchExecutor. Typically more than one Command
+ * The CommandFactory returns Commands that can be used by classes that implement CommandExecutor. Typically more than one Command
  * will want to be executed, where is where the BatchExecution comes in, which takes a List of commands, think of it as CompositeCommand.
  * </p> 
  * 
  * <p>
- * Out of the box marshalling to XML is support for the Commands, specifically the BatchExecution command and BatchExecutionResults, using the Drools Pipeline. If the 
+ * Out of the box marshalling to XML is support for the Commands, specifically the BatchExecution command and ExecutionResults, using the Drools Pipeline. If the 
  * drools-transformer-xstream is added then the PipelineFactory can be used in conjunction with the BatchExecutionHelper to marshall to and from XML. BatchExecutionHelper
  * also provides additional documentation on the supported XML format.
  * </p>
@@ -35,7 +35,7 @@
     }
 
     /**
-     * Inserts a new instance but references via the outIdentifier, which is returned as part of the BatchExecutionResults
+     * Inserts a new instance but references via the outIdentifier, which is returned as part of the ExecutionResults
      * 
      * @param object
      * @param outIdentifier
@@ -81,14 +81,14 @@
     }
 
     /**
-     * Sets the global but also when the out parameter is true specifies that the global is added to the BatchExecutionResults.
+     * Sets the global but also when the out parameter is true specifies that the global is added to the ExecutionResults.
      * 
      * @param identifier
      *     The identifier of the global
      * @param object
      *     The instance to be set as the global.
      * @param out
-     *     When true the global will be added to the BatchExecutionResults using the global's identifier.
+     *     When true the global will be added to the ExecutionResults using the global's identifier.
      * @return
      */
     public static Command newSetGlobal(String identifier,
@@ -100,15 +100,15 @@
     }
 
     /**
-     * Sets the global but also specifies that the global is added to the BatchExecutionResults. Instead of using the 
-     * global's identifier it uses the outIdentifier when being added to the BatchExecutionResults.
+     * Sets the global but also specifies that the global is added to the ExecutionResults. Instead of using the 
+     * global's identifier it uses the outIdentifier when being added to the ExecutionResults.
      * 
      * @param identifier
      *     The identifier of the global
      * @param object
      *     The instance to be set as the global.
      * @param outIdentifier
-     *     The identifier used to store the global in the BatchExecutionResults
+     *     The identifier used to store the global in the ExecutionResults
      * @return
      */
     public static Command newSetGlobal(String identifier,
@@ -120,7 +120,7 @@
     }
 
     /**
-     * Gets the global and adds it to the BatchExecutionResults
+     * Gets the global and adds it to the ExecutionResults
      * @param identifier
      * @return
      */
@@ -134,7 +134,7 @@
      * @param identifier
      *     The identifier of the global
      * @param outIdentifier
-     *     The identifier used in the BatchExecutionResults to store the global.
+     *     The identifier used in the ExecutionResults to store the global.
      * @return
      */
     public static Command newGetGlobal(String identifier,
@@ -174,11 +174,11 @@
     }
     
     /**
-     * Executes a query. The query results will be added to the BatchExecutionResults using the 
+     * Executes a query. The query results will be added to the ExecutionResults using the 
      * given identifier.
      * 
      * @param identifier
-     *     The identifier to be used for the results when added to the BatchExecutionResults
+     *     The identifier to be used for the results when added to the ExecutionResults
      * @param name
      *     The name of the query to execute
      * @return
@@ -191,10 +191,10 @@
     
     /**
      * Executes a query using the given parameters. The query results will be added to the 
-     * BatchExecutionResults using the given identifier.
+     * ExecutionResults using the given identifier.
      * 
      * @param identifier
-     *      The identifier to be used for the results when added to the BatchExecutionResults
+     *      The identifier to be used for the results when added to the ExecutionResults
      * @param name
      *      The name of the query to execute
      * @param arguments

Deleted: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutionResults.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutionResults.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutionResults.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -1,19 +0,0 @@
-package org.drools.runtime;
-
-import java.util.Collection;
-
-/**
- * <p>
- * Contains the results for the BatchExecution Command. If the identifier is reference the results of a query, you'll need to cast the vlaue to
- * QueryResults.
- * </p>
- * 
- *
- */
-public interface BatchExecutionResults {
-
-    Collection<String> getIdentifiers();
-
-    Object getValue(String identifier);
-
-}
\ No newline at end of file

Deleted: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutor.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutor.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutor.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -1,49 +0,0 @@
-package org.drools.runtime;
-
-import org.drools.command.Command;
-
-/**
- * <p>
- * Batch Executor allows for the scripting of of a Knowledge session using Commands, both the StatelessKnowledgeSession and StatefulKnowledgeSession 
- * implement this interface.
- * </p>
- * 
- * <p>
- * Commands are created using the CommandFactory and executed using the "execute" method, such as the following insert Command:
- * <p>
- * 
- * <pre>
- * ksession.execute( CommandFactory.newInsert( person ) );
- * </pre>
- * 
- * <p>
- * Typically though you will want to execute a batch of commands, this can be achieved via the composite Command BatchExecution. Further to this
- * results are scoped to this execute call and return via the BatchExecutionResults:
- * </p>
- * 
- * <pre>
- * List<Command> cmds = new ArrayList<Command>();
- * cmds.add( CommandFactory.newSetGlobal( "list1", new ArrayList(), true ) );
- * cmds.add( CommandFactory.newInsert( new Person( "jon", 102 ), "person" ) );
- * cmds.add( CommandFactory.newQuery( "Get People" "getPeople" );
- * 
- * BatchExecutionResults results = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
- * results.getValue( "list1" ); // returns the ArrayList
- * results.getValue( "person" ); // returns the inserted fact Person
- * results.getValue( "Get People" );// returns the query as a QueryResults instance.
- * </pre>
- * 
- * <p>
- * The CommandFactory details the supported commands, all of which can marshalled using XStream and the BatchExecutionHelper. BatchExecutionHelper provides details
- * on the xml format as well as how to use Drools Pipeline to automate the marshalling of BatchExecution and BatchExecutionResults.
- * </p>
- */
-public interface BatchExecutor {
-    /**
-     * Execute the command and return a BatchExecutionResults for the results of the Command.
-     * 
-     * @param command
-     * @return
-     */
-    public BatchExecutionResults execute(Command command);
-}

Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/CommandExecutor.java (from rev 25965, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutor.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/CommandExecutor.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/CommandExecutor.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -0,0 +1,49 @@
+package org.drools.runtime;
+
+import org.drools.command.Command;
+
+/**
+ * <p>
+ * Batch Executor allows for the scripting of of a Knowledge session using Commands, both the StatelessKnowledgeSession and StatefulKnowledgeSession 
+ * implement this interface.
+ * </p>
+ * 
+ * <p>
+ * Commands are created using the CommandFactory and executed using the "execute" method, such as the following insert Command:
+ * <p>
+ * 
+ * <pre>
+ * ksession.execute( CommandFactory.newInsert( person ) );
+ * </pre>
+ * 
+ * <p>
+ * Typically though you will want to execute a batch of commands, this can be achieved via the composite Command BatchExecution. Further to this
+ * results are scoped to this execute call and return via the ExecutionResults:
+ * </p>
+ * 
+ * <pre>
+ * List<Command> cmds = new ArrayList<Command>();
+ * cmds.add( CommandFactory.newSetGlobal( "list1", new ArrayList(), true ) );
+ * cmds.add( CommandFactory.newInsert( new Person( "jon", 102 ), "person" ) );
+ * cmds.add( CommandFactory.newQuery( "Get People" "getPeople" );
+ * 
+ * ExecutionResults results = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
+ * results.getValue( "list1" ); // returns the ArrayList
+ * results.getValue( "person" ); // returns the inserted fact Person
+ * results.getValue( "Get People" );// returns the query as a QueryResults instance.
+ * </pre>
+ * 
+ * <p>
+ * The CommandFactory details the supported commands, all of which can marshalled using XStream and the BatchExecutionHelper. BatchExecutionHelper provides details
+ * on the xml format as well as how to use Drools Pipeline to automate the marshalling of BatchExecution and ExecutionResults.
+ * </p>
+ */
+public interface CommandExecutor {
+    /**
+     * Execute the command and return a ExecutionResults for the results of the Command.
+     * 
+     * @param command
+     * @return
+     */
+    public ExecutionResults execute(Command command);
+}

Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ExecutionResults.java (from rev 25965, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/BatchExecutionResults.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ExecutionResults.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ExecutionResults.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -0,0 +1,19 @@
+package org.drools.runtime;
+
+import java.util.Collection;
+
+/**
+ * <p>
+ * Contains the results for the BatchExecution Command. If the identifier is reference the results of a query, you'll need to cast the vlaue to
+ * QueryResults.
+ * </p>
+ * 
+ *
+ */
+public interface ExecutionResults {
+
+    Collection<String> getIdentifiers();
+
+    Object getValue(String identifier);
+
+}
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/StatefulKnowledgeSession.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/StatefulKnowledgeSession.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/StatefulKnowledgeSession.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -56,7 +56,7 @@
  * </pre>
  * 
  * <p>
- * Like StatelessKnowledgeSession this also implements BatchExecutor which can be used to script a StatefulKnowledgeSession. See BatchExecutor
+ * Like StatelessKnowledgeSession this also implements CommandExecutor which can be used to script a StatefulKnowledgeSession. See CommandExecutor
  * for more details.
  * </p>
  * 
@@ -66,7 +66,7 @@
     extends
     StatefulRuleSession,
     StatefulProcessSession,
-    BatchExecutor,
+    CommandExecutor,
     KnowledgeRuntime {
 
     int getId();

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/StatelessKnowledgeSession.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/StatelessKnowledgeSession.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/StatelessKnowledgeSession.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -11,7 +11,7 @@
  * call dispose(). Stateless sessions do not support
  * iterative insertions and fireAllRules from java code, the act of calling execute(...) is a single
  * shot method that will internally instantiate a StatefullKnowledgeSession, add all the user data and execute user commands, call fireAllRules, and then
- * call dispose(). While the main way to work with this class is via the BatchExecution Command as supported by the BatchExecutor interface, 
+ * call dispose(). While the main way to work with this class is via the BatchExecution Command as supported by the CommandExecutor interface, 
  * two convenience methods are provided for when simple object insertion is all that's required.
  * 
  * <p>
@@ -45,7 +45,7 @@
  * 
  * <p>
  * The CommandFactory details the supported commands, all of which can marshalled using XStream and the BatchExecutionHelper. BatchExecutionHelper provides details
- * on the xml format as well as how to use Drools Pipeline to automate the marshalling of BatchExecution and BatchExecutionResults.
+ * on the xml format as well as how to use Drools Pipeline to automate the marshalling of BatchExecution and ExecutionResults.
  * </p>
  * 
  * <p>
@@ -69,7 +69,7 @@
  * </pre>
  * 
  * <p>
- * The third way is execution scopped globals using the BatchExecutor and SetGlobal Commands:
+ * The third way is execution scopped globals using the CommandExecutor and SetGlobal Commands:
  * </p>
  * 
  * <pre>
@@ -81,7 +81,7 @@
  * </pre>
  * 
  * <p>
- * The BatchExecutor interface also supports the ability to expert data via "out" parameters. Inserted facts, globals and query results can all be returned.
+ * The CommandExecutor interface also supports the ability to expert data via "out" parameters. Inserted facts, globals and query results can all be returned.
  * </p>
  * 
  * <pre>
@@ -90,17 +90,17 @@
  * cmds.add( CommandFactory.newInsert( new Person( "jon", 102 ), "person" ) );
  * cmds.add( CommandFactory.newQuery( "Get People" "getPeople" );
  * 
- * BatchExecutionResults results = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
+ * ExecutionResults results = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
  * results.getValue( "list1" ); // returns the ArrayList
  * results.getValue( "person" ); // returns the inserted fact Person
  * results.getValue( "Get People" );// returns the query as a QueryResults instance.
  * </pre>
  * 
  * 
- * @see org.drools.runtime.BatchExecutor
+ * @see org.drools.runtime.CommandExecutor
  * @see org.drools.runtime.command.CommandFactory
  * @see org.drools.runtime.command.BatchExecution
- * @see org.drools.runtime.command.BatchExecutionResults
+ * @see org.drools.runtime.ExecutionResults.BatchExecutionResults
  * @see org.drools.runtime.help.BatchExecutionHelp
  * @see org.drools.runtime.pipeline.PipelineFactory
  * @see org.drools.runtime.Globals
@@ -110,7 +110,7 @@
     extends
     StatelessRuleSession,
     StatelessProcessSession,
-    BatchExecutor,
+    CommandExecutor,
     KnowledgeRuntimeEventManager {
 
     /**

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/help/BatchExecutionHelper.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/help/BatchExecutionHelper.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/help/BatchExecutionHelper.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -162,7 +162,7 @@
  * <p>
  * The pipeline can be used to handle this end to end, notice the part where the configured XStream instance is passed "BatchExecutionHelper.newXStreamMarshaller()".
  * This will take a given xml, transform it and then execute it as a BatchExecution Command. Notice the Pipeline also handles the marshalling
- * of the BatchExecutionResults back out to XML.
+ * of the ExecutionResults back out to XML.
  * </p>
  * <pre>
  * Action executeResultHandler = PipelineFactory.newExecuteResultHandler();

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineContext.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineContext.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineContext.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -7,7 +7,7 @@
  */
 import java.util.Map;
 
-import org.drools.runtime.BatchExecutor;
+import org.drools.runtime.CommandExecutor;
 
 public interface PipelineContext {
 
@@ -21,6 +21,6 @@
 
     ResultHandler getResultHandler();
     
-    BatchExecutor getBatchExecutor();
+    CommandExecutor getCommandExecutor();
 
 }

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineFactory.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineFactory.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineFactory.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -516,8 +516,8 @@
      * 
      * <p>
      * The BatchExecutionHelper factory provides a pre-configured XStream instance used for marshalling Commands, specifically
-     * the BatchExecutionCommand and the BatchExecutionResults. It also contains docs on the xml formant and on how to use the pipeline 
-     * for marshalling BatchExecutionCommand and BatchExecutionResults.
+     * the BatchExecutionCommand and the ExecutionResults. It also contains docs on the xml formant and on how to use the pipeline 
+     * for marshalling BatchExecutionCommand and ExecutionResults.
      * </p>
      * 
      * @param xstream
@@ -540,8 +540,8 @@
      * 
      * <p>
      * The BatchExecutionHelper factory provides a pre-configured XStream instance used for marshalling Commands, specifically
-     * the BatchExecutionCommand and the BatchExecutionResults. It also contains docs on the xml formant and on how to use the pipeline 
-     * for marshalling BatchExecutionCommand and BatchExecutionResults.
+     * the BatchExecutionCommand and the ExecutionResults. It also contains docs on the xml formant and on how to use the pipeline 
+     * for marshalling BatchExecutionCommand and ExecutionResults.
      * </p>
      * @param xstream
      * @return

Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/StatelessSessionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/StatelessSessionTest.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/StatelessSessionTest.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -35,7 +35,7 @@
 import org.drools.io.Resource;
 import org.drools.io.ResourceFactory;
 import org.drools.rule.Package;
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 import org.drools.runtime.StatefulKnowledgeSession;
 import org.drools.runtime.StatelessKnowledgeSession;
 import org.drools.runtime.StatelessKnowledgeSessionResults;
@@ -113,7 +113,7 @@
         
         StatelessKnowledgeSession ksession = getSession2( ResourceFactory.newByteArrayResource( str.getBytes() ) );
         Command cmd = CommandFactory.newInsertObject( stilton, "outStilton" );
-        BatchExecutionResults result = ksession.execute( cmd );
+        ExecutionResults result = ksession.execute( cmd );
         stilton = ( Cheese ) result.getValue( "outStilton" );
         assertEquals( 30,
                       stilton.getPrice() );       
@@ -154,7 +154,7 @@
         cmds.add( setGlobal3 );
         cmds.add(  insert );
         
-        BatchExecutionResults result = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
+        ExecutionResults result = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
         
         assertEquals( 30,
                       stilton.getPrice() ); 
@@ -227,7 +227,7 @@
         
         cmds.add(  CommandFactory.newQuery( "cheeses", "cheeses" ) );
         
-        BatchExecutionResults batchResult = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
+        ExecutionResults batchResult = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
         
         org.drools.runtime.rule.QueryResults results = ( org.drools.runtime.rule.QueryResults) batchResult.getValue( "cheeses" );
         assertEquals( 3, results.size() );        

Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/testframework/MockWorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/testframework/MockWorkingMemory.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/testframework/MockWorkingMemory.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -532,7 +532,7 @@
         
     }
 
-    public BatchExecutionResultImpl getBatchExecutionResult() {
+    public BatchExecutionResultImpl getExecutionResult() {
         // TODO Auto-generated method stub
         return null;
     }

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -84,7 +84,7 @@
 import org.drools.rule.Rule;
 import org.drools.rule.TimeMachine;
 import org.drools.ruleflow.core.RuleFlowProcess;
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 import org.drools.runtime.Environment;
 import org.drools.runtime.EnvironmentName;
 import org.drools.runtime.ExitPoint;
@@ -216,7 +216,7 @@
 
     private Environment                                                       environment;
     
-    private BatchExecutionResults                                              batchExecutionResult;
+    private ExecutionResults                                              batchExecutionResult;
 
     // ------------------------------------------------------------
     // Constructors
@@ -1843,7 +1843,7 @@
         this.batchExecutionResult = new BatchExecutionResultImpl();
     }
     
-    public BatchExecutionResultImpl getBatchExecutionResult() {
+    public BatchExecutionResultImpl getExecutionResult() {
         return ( BatchExecutionResultImpl ) this.batchExecutionResult;
     }
     

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/InternalWorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/InternalWorkingMemory.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/InternalWorkingMemory.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -18,7 +18,7 @@
 import org.drools.reteoo.PartitionTaskManager;
 import org.drools.rule.Rule;
 import org.drools.rule.TimeMachine;
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 import org.drools.runtime.ExitPoint;
 import org.drools.runtime.KnowledgeRuntime;
 import org.drools.runtime.impl.BatchExecutionResultImpl;
@@ -136,7 +136,7 @@
     
     public void startBatchExecution();
     
-    public BatchExecutionResultImpl getBatchExecutionResult();
+    public BatchExecutionResultImpl getExecutionResult();
     
     public void endBatchExecution();
 }

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/impl/StatefulKnowledgeSessionImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/impl/StatefulKnowledgeSessionImpl.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/impl/StatefulKnowledgeSessionImpl.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -53,8 +53,8 @@
 import org.drools.reteoo.ReteooWorkingMemory;
 import org.drools.rule.EntryPoint;
 import org.drools.rule.Rule;
-import org.drools.runtime.BatchExecutionResults;
-import org.drools.runtime.BatchExecutor;
+import org.drools.runtime.ExecutionResults;
+import org.drools.runtime.CommandExecutor;
 import org.drools.runtime.Environment;
 import org.drools.runtime.ExitPoint;
 import org.drools.runtime.Globals;
@@ -74,7 +74,7 @@
 public class StatefulKnowledgeSessionImpl
     implements
     StatefulKnowledgeSession,
-    BatchExecutor,
+    CommandExecutor,
     InternalWorkingMemoryEntryPoint {
     public ReteooWorkingMemory                                                session;
     public KnowledgeBaseImpl                                                  kbase;
@@ -679,11 +679,11 @@
         return new NativeQueryResults( this.session.getQueryResults( query, arguments ) );
     }
     
-    public BatchExecutionResults execute(Command command) {        
+    public ExecutionResults execute(Command command) {        
         try {
             session.startBatchExecution();
             ((org.drools.process.command.Command)command).execute( session );
-            BatchExecutionResults result = session.getBatchExecutionResult();
+            ExecutionResults result = session.getExecutionResult();
             return result;
         } finally {
             session.endBatchExecution();

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/impl/StatelessKnowledgeSessionImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/impl/StatelessKnowledgeSessionImpl.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/impl/StatelessKnowledgeSessionImpl.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -29,7 +29,7 @@
 import org.drools.reteoo.ReteooWorkingMemory;
 import org.drools.reteoo.ReteooWorkingMemory.WorkingMemoryReteAssertAction;
 import org.drools.rule.EntryPoint;
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 import org.drools.runtime.Environment;
 import org.drools.runtime.Globals;
 import org.drools.runtime.KnowledgeSessionConfiguration;
@@ -204,7 +204,7 @@
         return this.sessionGlobals;
     }
 
-    public BatchExecutionResults execute(Command command) {        
+    public ExecutionResults execute(Command command) {        
         ReteooWorkingMemory session = ( ReteooWorkingMemory ) newWorkingMemory();
         try {
             session.startBatchExecution();
@@ -224,7 +224,7 @@
             if ( autoFireAllRules ) {
             	session.fireAllRules( this.agendaFilter );
             }
-            BatchExecutionResults result = session.getBatchExecutionResult();
+            ExecutionResults result = session.getExecutionResult();
             return result;
         } finally {
             session.endBatchExecution();

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/GetGlobalCommand.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/GetGlobalCommand.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/GetGlobalCommand.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -27,7 +27,7 @@
 
     public Object execute(ReteooWorkingMemory session) {
         Object object = session.getGlobal( this.identifier );
-        session.getBatchExecutionResult().getResults().put( (this.outIdentifier != null) ? this.outIdentifier : this.identifier,
+        session.getExecutionResult().getResults().put( (this.outIdentifier != null) ? this.outIdentifier : this.identifier,
                                                             object );
         return object;
     }

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/GetObjectsCommand.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/GetObjectsCommand.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/GetObjectsCommand.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -44,7 +44,7 @@
         if ( this.outIdentifier != null ) {
             List objects = new ArrayList( col );
             
-            session.getBatchExecutionResult().getResults().put( this.outIdentifier, objects );
+            session.getExecutionResult().getResults().put( this.outIdentifier, objects );
         }
         
         return col;

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/InsertObjectCommand.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/InsertObjectCommand.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/InsertObjectCommand.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -15,7 +15,7 @@
 	
 	public FactHandle execute(ReteooWorkingMemory session) {
 	    if ( outIdentifier != null ) {
-	        session.getBatchExecutionResult().getResults().put( this.outIdentifier, object );
+	        session.getExecutionResult().getResults().put( this.outIdentifier, object );
 	    }
 		return session.insert(object);
 	}

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/QueryCommand.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/QueryCommand.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/QueryCommand.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -1,7 +1,7 @@
 package org.drools.process.command;
 
 import org.drools.reteoo.ReteooWorkingMemory;
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 import org.drools.runtime.rule.QueryResults;
 import org.drools.runtime.rule.impl.NativeQueryResults;
 
@@ -47,7 +47,7 @@
         }
         
         if ( this.outIdentifier != null ) {
-            session.getBatchExecutionResult().getResults().put( this.outIdentifier, results );
+            session.getExecutionResult().getResults().put( this.outIdentifier, results );
         }
 
         return results;

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/SetGlobalCommand.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/SetGlobalCommand.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/SetGlobalCommand.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -21,7 +21,7 @@
 
     public Void execute(ReteooWorkingMemory session) {
         if ( this.out ) {
-            session.getBatchExecutionResult().getResults().put( ( this.outIdentifier != null ) ? this.outIdentifier : this.identifier, 
+            session.getExecutionResult().getResults().put( ( this.outIdentifier != null ) ? this.outIdentifier : this.identifier, 
                                                                 object );
         }
         

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/impl/CommandBasedStatefulKnowledgeSession.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/impl/CommandBasedStatefulKnowledgeSession.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/process/command/impl/CommandBasedStatefulKnowledgeSession.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -50,7 +50,7 @@
 import org.drools.process.command.UnregisterExitPointCommand;
 import org.drools.process.command.UpdateCommand;
 import org.drools.reteoo.ReteooWorkingMemory;
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 import org.drools.runtime.Environment;
 import org.drools.runtime.ExitPoint;
 import org.drools.runtime.Globals;
@@ -348,13 +348,13 @@
         return commandService.execute( new GetEnvironmentCommand() );
     }
     
-    public BatchExecutionResults execute(Command command) {        
+    public ExecutionResults execute(Command command) {        
         try {            
             ((ReteooWorkingMemory)this.commandService.getSession()).startBatchExecution();
             
             this.commandService.execute( (org.drools.process.command.Command) command );
             
-            BatchExecutionResults result = ((ReteooWorkingMemory)this.commandService.getSession()).getBatchExecutionResult();
+            ExecutionResults result = ((ReteooWorkingMemory)this.commandService.getSession()).getExecutionResult();
             return result;
         } finally {
             ((ReteooWorkingMemory)this.commandService.getSession()).endBatchExecution();

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/help/impl/BatchExecutionHelperProviderImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/help/impl/BatchExecutionHelperProviderImpl.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/help/impl/BatchExecutionHelperProviderImpl.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -18,7 +18,7 @@
 import org.drools.process.command.SetGlobalCommand;
 import org.drools.process.command.StartProcessCommand;
 import org.drools.rule.Declaration;
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 import org.drools.runtime.help.BatchExecutionHelperProvider;
 import org.drools.runtime.impl.BatchExecutionImpl;
 import org.drools.runtime.impl.BatchExecutionResultImpl;
@@ -66,7 +66,7 @@
                        GetGlobalCommand.class );
         xstream.alias( "get-objects",
                        GetObjectsCommand.class );
-        xstream.alias( "batch-execution-results",
+        xstream.alias( "execution-results",
                        BatchExecutionResultImpl.class );
         xstream.alias( "fire-all-rules",
                        FireAllRulesCommand.class );
@@ -509,7 +509,7 @@
         public void marshal(Object object,
                             HierarchicalStreamWriter writer,
                             MarshallingContext context) {
-            BatchExecutionResults result = (BatchExecutionResults) object;
+            ExecutionResults result = (ExecutionResults) object;
             for ( String identifier : result.getIdentifiers() ) {
                 writer.startNode( "result" );
                 writer.addAttribute( "identifier",
@@ -546,7 +546,7 @@
         }
 
         public boolean canConvert(Class clazz) {
-            return BatchExecutionResults.class.isAssignableFrom( clazz );
+            return ExecutionResults.class.isAssignableFrom( clazz );
         }
     }
 

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/impl/BatchExecutionResultImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/impl/BatchExecutionResultImpl.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/impl/BatchExecutionResultImpl.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -4,9 +4,9 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 
-public class BatchExecutionResultImpl implements BatchExecutionResults {
+public class BatchExecutionResultImpl implements ExecutionResults {
     Map<String, Object> results = new HashMap<String, Object>();
     
     /* (non-Javadoc)

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BasePipelineContext.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BasePipelineContext.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BasePipelineContext.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -3,7 +3,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.drools.runtime.BatchExecutor;
+import org.drools.runtime.CommandExecutor;
 import org.drools.runtime.pipeline.PipelineContext;
 import org.drools.runtime.pipeline.ResultHandler;
 
@@ -46,7 +46,7 @@
         this.result = result;
     }
 
-    public BatchExecutor getBatchExecutor() {
+    public CommandExecutor getCommandExecutor() {
         throw new UnsupportedOperationException( "this method is not implemented" );
     }
         

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BatchExecutorStage.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BatchExecutorStage.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BatchExecutorStage.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -5,7 +5,7 @@
 
 import org.drools.command.Command;
 import org.drools.command.CommandFactory;
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 import org.drools.runtime.pipeline.KnowledgeRuntimeCommand;
 import org.drools.runtime.pipeline.PipelineContext;
 
@@ -19,7 +19,7 @@
         if ( object instanceof Collection ) {
             object = CommandFactory.newBatchExecution( (List<Command>) object );
         }
-        BatchExecutionResults result = kContext.getBatchExecutor().execute( (Command) object );
+        ExecutionResults result = kContext.getCommandExecutor().execute( (Command) object );
 
         emit( result,
               kContext );

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatefulKnowledgeSessionPipelineContextImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatefulKnowledgeSessionPipelineContextImpl.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatefulKnowledgeSessionPipelineContextImpl.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -4,7 +4,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.drools.runtime.BatchExecutor;
+import org.drools.runtime.CommandExecutor;
 import org.drools.runtime.StatefulKnowledgeSession;
 import org.drools.runtime.pipeline.ResultHandler;
 import org.drools.runtime.pipeline.StatefulKnowledgeSessionPipelineContext;
@@ -34,7 +34,7 @@
         return entryPoint;
     }
 
-    public BatchExecutor getBatchExecutor() {
+    public CommandExecutor getCommandExecutor() {
         return this.ksession;
     }
     

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatefulKnowledgeSessionPipelineImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatefulKnowledgeSessionPipelineImpl.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatefulKnowledgeSessionPipelineImpl.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -24,8 +24,8 @@
         this.entryPoint = ksession.getWorkingMemoryEntryPoint( entryPointName );
     }
 
-    public void insert(Object object,
-                       ResultHandler resultHandler) {
+    public synchronized void insert(Object object,
+                                    ResultHandler resultHandler) {
         ClassLoader cl = ((InternalRuleBase) ((StatefulKnowledgeSessionImpl) this.ksession).getRuleBase()).getRootClassLoader();
 
         StatefulKnowledgeSessionPipelineContextImpl context = new StatefulKnowledgeSessionPipelineContextImpl( this.ksession,

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatelessKnowledgeSessionPipelineContextImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatelessKnowledgeSessionPipelineContextImpl.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatelessKnowledgeSessionPipelineContextImpl.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -1,6 +1,6 @@
 package org.drools.runtime.pipeline.impl;
 
-import org.drools.runtime.BatchExecutor;
+import org.drools.runtime.CommandExecutor;
 import org.drools.runtime.StatelessKnowledgeSession;
 import org.drools.runtime.pipeline.ResultHandler;
 import org.drools.runtime.pipeline.StatelessKnowledgeSessionPipelineContext;
@@ -30,7 +30,7 @@
         return this.ksession;
     }
 
-    public BatchExecutor getBatchExecutor() {
+    public CommandExecutor getCommandExecutor() {
         return this.ksession;
     }
             

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatelessKnowledgeSessionPipelineImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatelessKnowledgeSessionPipelineImpl.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/StatelessKnowledgeSessionPipelineImpl.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -19,13 +19,16 @@
         this.ksession = ksession;
     }
 
-    public void insert(Object object,
-                       ResultHandler resultHandler) {
-        ClassLoader cl = ((InternalRuleBase) ((StatelessKnowledgeSessionImpl) this.ksession).getRuleBase()).getRootClassLoader();                
-        
-        StatelessKnowledgeSessionPipelineContextImpl context = new StatelessKnowledgeSessionPipelineContextImpl(ksession, cl, resultHandler );
-        
-        emit( object, context );        
+    public synchronized void insert(Object object,
+                                    ResultHandler resultHandler) {
+        ClassLoader cl = ((InternalRuleBase) ((StatelessKnowledgeSessionImpl) this.ksession).getRuleBase()).getRootClassLoader();
+
+        StatelessKnowledgeSessionPipelineContextImpl context = new StatelessKnowledgeSessionPipelineContextImpl( ksession,
+                                                                                                                 cl,
+                                                                                                                 resultHandler );
+
+        emit( object,
+              context );
     }
 
 }

Modified: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/XStreamBatchExecutionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/XStreamBatchExecutionTest.java	2009-04-06 01:25:37 UTC (rev 25965)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/XStreamBatchExecutionTest.java	2009-04-06 04:02:55 UTC (rev 25966)
@@ -26,7 +26,7 @@
 import org.drools.definition.KnowledgePackage;
 import org.drools.io.Resource;
 import org.drools.io.ResourceFactory;
-import org.drools.runtime.BatchExecutionResults;
+import org.drools.runtime.ExecutionResults;
 import org.drools.runtime.StatelessKnowledgeSession;
 import org.drools.runtime.StatefulKnowledgeSession;
 import org.drools.runtime.help.BatchExecutionHelper;
@@ -92,7 +92,7 @@
         String outXml = (String) resultHandler.getObject();
 
         String expectedXml = "";
-        expectedXml += "<batch-execution-results>\n";
+        expectedXml += "<execution-results>\n";
         expectedXml += "  <result identifier=\"outStilton\">\n";
         expectedXml += "    <org.drools.Cheese>\n";
         expectedXml += "      <type>stilton</type>\n";
@@ -100,12 +100,12 @@
         expectedXml += "      <price>30</price>\n";
         expectedXml += "    </org.drools.Cheese>\n";
         expectedXml += "  </result>\n";
-        expectedXml += "</batch-execution-results>\n";
+        expectedXml += "</execution-results>\n";
 
         assertXMLEqual( expectedXml,
                         outXml );
 
-        BatchExecutionResults result = (BatchExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
+        ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
         Cheese stilton = (Cheese) result.getValue( "outStilton" );
         assertEquals( 30,
                       stilton.getPrice() );
@@ -151,7 +151,7 @@
         String outXml = (String) resultHandler.getObject();
 
         String expectedXml = "";
-        expectedXml += "<batch-execution-results>\n";
+        expectedXml += "<execution-results>\n";
         expectedXml += "  <result identifier='list'>\n";
         expectedXml += "    <list>\n";
         expectedXml += "      <org.drools.Cheese>\n";
@@ -166,12 +166,12 @@
         expectedXml += "      </org.drools.Cheese>\n";
         expectedXml += "    </list>\n";
         expectedXml += "  </result>\n";
-        expectedXml += "</batch-execution-results>\n";
+        expectedXml += "</execution-results>\n";
 
         assertXMLEqual( expectedXml,
                         outXml );
 
-        BatchExecutionResults result = (BatchExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
+        ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
 
         List list = (List) result.getValue( "list" );
         Cheese stilton25 = new Cheese( "stilton",
@@ -233,7 +233,7 @@
         String outXml = (String) resultHandler.getObject();
 
         String expectedXml = "";
-        expectedXml += "<batch-execution-results>\n";
+        expectedXml += "<execution-results>\n";
         expectedXml += "  <result identifier='list2'>\n";
         expectedXml += "    <list>\n";
         expectedXml += "      <org.drools.Cheese>\n";
@@ -248,12 +248,12 @@
         expectedXml += "      <org.drools.Cheese reference='../../../result/list/org.drools.Cheese'/>\n";
         expectedXml += "    </list>\n";
         expectedXml += "  </result>\n";
-        expectedXml += "</batch-execution-results>\n";
+        expectedXml += "</execution-results>\n";
 
         assertXMLEqual( expectedXml,
                         outXml );
 
-        BatchExecutionResults result = (BatchExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
+        ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
         Cheese stilton = new Cheese( "stilton",
                                      30 );
 
@@ -307,7 +307,7 @@
         String outXml = (String) resultHandler.getObject();
 
         String expectedXml = "";
-        expectedXml += "<batch-execution-results>\n";
+        expectedXml += "<execution-results>\n";
         expectedXml += "  <result identifier=\"out-list\">\n";
         expectedXml += "    <list>\n";
         expectedXml += "      <org.drools.Cheese>\n";
@@ -317,7 +317,7 @@
         expectedXml += "      </org.drools.Cheese>\n";
         expectedXml += "    </list>\n";
         expectedXml += "  </result>\n";
-        expectedXml += "</batch-execution-results>\n";
+        expectedXml += "</execution-results>\n";
 
         assertXMLEqual( expectedXml,
                         outXml );
@@ -359,7 +359,7 @@
         String outXml = (String) resultHandler.getObject();
 
         String expectedXml = "";
-        expectedXml += "<batch-execution-results>";
+        expectedXml += "<execution-results>";
         expectedXml += "  <result identifier='list'>";
         expectedXml += "    <list>";
         expectedXml += "      <org.drools.Cheese>";
@@ -374,11 +374,11 @@
         expectedXml += "      </org.drools.Cheese>";
         expectedXml += "    </list>";
         expectedXml += "  </result>";
-        expectedXml += "</batch-execution-results>";
+        expectedXml += "</execution-results>";
         
         assertXMLEqual( expectedXml, outXml );
 
-        BatchExecutionResults result = (BatchExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
+        ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
         List list = (List) result.getValue( "list" );
         Cheese stilton25 = new Cheese( "stilton",
                                        30 );
@@ -450,7 +450,7 @@
         String outXml = (String) resultHandler.getObject();
 
         String expectedXml = "";
-        expectedXml += "<batch-execution-results>\n";
+        expectedXml += "<execution-results>\n";
         expectedXml += "  <result identifier='cheeses'>\n";
         expectedXml += "    <query-results>\n";
         expectedXml += "      <identifiers>\n";
@@ -499,12 +499,12 @@
         expectedXml += "      </row>\n";
         expectedXml += "    </query-results>\n";
         expectedXml += "  </result>\n";
-        expectedXml += "</batch-execution-results>\n";;
+        expectedXml += "</execution-results>\n";;
 
         assertXMLEqual( expectedXml,
                         outXml );
 
-        BatchExecutionResults batchResult = (BatchExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
+        ExecutionResults batchResult = (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
 
         Cheese stilton1 = new Cheese( "stilton",
                                       1 );
@@ -590,7 +590,7 @@
         String outXml = (String) resultHandler.getObject();
 
         String expectedXml = "";
-        expectedXml += "<batch-execution-results>\n";
+        expectedXml += "<execution-results>\n";
         expectedXml += "  <result identifier='list'>\n";
         expectedXml += "    <list>\n";
         expectedXml += "      <org.drools.Cheese>\n";
@@ -612,11 +612,11 @@
         expectedXml += "      <oldPrice>5</oldPrice>\n";
         expectedXml += "    </org.drools.Cheese>\n";
         expectedXml += "  </result>\n";
-        expectedXml += "</batch-execution-results>\n";
+        expectedXml += "</execution-results>\n";
         assertXMLEqual( expectedXml,
                         outXml );
 
-        BatchExecutionResults result = (BatchExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
+        ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML( outXml );
 
         // brie should not have been added to the list
         List list = (List) result.getValue( "list" );
@@ -689,13 +689,13 @@
                       list.get( 0 ) );
 
         String expectedXml = "";
-        expectedXml += "<batch-execution-results>\n";
+        expectedXml += "<execution-results>\n";
         expectedXml += "  <result identifier=\"out-list\">\n";
         expectedXml += "    <list>\n";
         expectedXml += "      <string>John Doe</string>\n";
         expectedXml += "    </list>\n";
         expectedXml += "  </result>\n";
-        expectedXml += "</batch-execution-results>\n";
+        expectedXml += "</execution-results>\n";
 
         assertXMLEqual( expectedXml,
                         outXml );
@@ -731,7 +731,7 @@
         String outXml = (String) resultHandler.getObject();
 
         String expectedXml = "";
-        expectedXml += "<batch-execution-results>\n";
+        expectedXml += "<execution-results>\n";
         expectedXml += "  <result identifier=\"outStilton\">\n";
         expectedXml += "    <org.foo.Whee>\n";
         expectedXml += "      <type>stilton</type>\n";
@@ -739,7 +739,7 @@
         expectedXml += "      <price>30</price>\n";
         expectedXml += "    </org.foo.Whee>\n";
         expectedXml += "  </result>\n";
-        expectedXml += "</batch-execution-results>\n";
+        expectedXml += "</execution-results>\n";
 
         assertXMLEqual( expectedXml,
                         outXml );




More information about the jboss-svn-commits mailing list