[jboss-svn-commits] JBL Code SVN: r24496 - in labs/jbossrules/trunk: drools-ant and 42 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Dec 23 19:54:34 EST 2008
Author: mark.proctor at jboss.com
Date: 2008-12-23 19:54:33 -0500 (Tue, 23 Dec 2008)
New Revision: 24496
Added:
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Action.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Adapter.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/CorePipelineProvider.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Emitter.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Expression.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Feeder.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Filter.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/JaxbPipelineProvider.java
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/Receiver.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/SmooksPipelineProvider.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Splitter.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Stage.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/StageExceptionHandler.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Transformer.java
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/.classpath
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/.project
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/pom.xml
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/dataloaders/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/impl/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/impl/Root.java
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/impl/XStreamTransformer.java
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/resources/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/dataloaders/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/DroolsXStreamStatefulSessionTest.java
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/DroolsXStreamStatelessSessionTest.java
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/XStreamDirectRoot.xml
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/XStreamNestedIterable.xml
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/test_XStreamDirectRoot.drl
labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/test_XStreamNestedIterable.drl
Removed:
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/
Modified:
labs/jbossrules/trunk/drools-ant/.classpath
labs/jbossrules/trunk/drools-api/.classpath
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/dataloader/DataLoaderFactory.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/dataloader/DataLoaderProvider.java
labs/jbossrules/trunk/drools-compiler/.classpath
labs/jbossrules/trunk/drools-core/.classpath
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/DataLoaderProviderImpl.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatefulKnowledgeSessionDataLoaderImpl.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatefulKnowledgeSessionReceiverAdapter.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatelessKnowledgeSessionDataLoaderImpl.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatelessKnowledgeSessionReceiverAdapter.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BaseEmitter.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BaseStage.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/CorePipelineProviderImpl.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/IterateSplitter.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/MvelExpression.java
labs/jbossrules/trunk/drools-guvnor/.classpath
labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/main/java/org/drools/runtime/pipeline/impl/JaxbTransformer.java
labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/test/java/org/drools/runtime/pipeline/impl/DroolsJaxbTest.java
labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/.classpath
labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/main/java/org/drools/runtime/pipeline/impl/SmooksTransformer.java
labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/test/java/org/drools/runtime/pipeline/impl/DroolsSmookStatefulSessionTest.java
labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/test/java/org/drools/runtime/pipeline/impl/DroolsSmookStatelessSessionTest.java
labs/jbossrules/trunk/drools-pipeline/pom.xml
labs/jbossrules/trunk/drools-process/drools-process-task/.classpath
labs/jbossrules/trunk/drools-server/.classpath
labs/jbossrules/trunk/drools-solver/drools-solver-core/.classpath
labs/jbossrules/trunk/drools-solver/drools-solver-examples/.classpath
labs/jbossrules/trunk/drools-verifier/.classpath
labs/jbossrules/trunk/pom.xml
Log:
JBRULES-1903 Pipeline support for DataLoaders and Feeders\n-added xstream
Modified: labs/jbossrules/trunk/drools-ant/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-ant/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-ant/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -23,5 +23,5 @@
<classpathentry kind="var" path="M2_REPO/jexcelapi/jxl/2.4.2/jxl-2.4.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mvel/mvel2/2.0.5/mvel2-2.0.5.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-api/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-api/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-api/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -25,5 +25,5 @@
<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.8.0/xercesImpl-2.8.0.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/2.0.2/xml-apis-2.0.2.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/dataloader/DataLoaderFactory.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/dataloader/DataLoaderFactory.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/dataloader/DataLoaderFactory.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -1,9 +1,9 @@
package org.drools.runtime.dataloader;
import org.drools.ProviderInitializationException;
-import org.drools.definition.pipeline.Receiver;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.StatelessKnowledgeSession;
+import org.drools.runtime.pipeline.Receiver;
public class DataLoaderFactory {
private static volatile DataLoaderProvider provider;
Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/dataloader/DataLoaderProvider.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/dataloader/DataLoaderProvider.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/dataloader/DataLoaderProvider.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -1,8 +1,8 @@
package org.drools.runtime.dataloader;
-import org.drools.definition.pipeline.Receiver;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.StatelessKnowledgeSession;
+import org.drools.runtime.pipeline.Receiver;
public interface DataLoaderProvider {
StatefulKnowledgeSessionDataLoader newStatefulKnowledgeSessionDataLoader(StatefulKnowledgeSession ksession,
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Action.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Action.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Action.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Action.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,5 @@
+package org.drools.runtime.pipeline;
+
+public interface Action extends Emitter, Receiver, Stage {
+
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Action.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Adapter.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Adapter.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Adapter.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Adapter.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,4 @@
+package org.drools.runtime.pipeline;
+
+public interface Adapter extends Receiver, Stage {
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Adapter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/CorePipelineProvider.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/CorePipelineProvider.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/CorePipelineProvider.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/CorePipelineProvider.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,11 @@
+package org.drools.runtime.pipeline;
+
+public interface CorePipelineProvider {
+ public Expression newMvelExpression(String expression);
+
+ public Splitter newIterateSplitter();
+
+ public Adapter newStatefulKnowledgeSessionReceiverAdapter();
+
+ public Adapter newStatelessKnowledgeSessionReceiverAdapter();
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/CorePipelineProvider.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Emitter.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Emitter.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Emitter.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Emitter.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,12 @@
+package org.drools.runtime.pipeline;
+
+import java.util.Collection;
+
+public interface Emitter {
+ void addReceiver(Receiver receiver);
+
+ void removeReceiver(Receiver receiver);
+
+ Collection<Receiver> getReceivers();
+
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Emitter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Expression.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Expression.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Expression.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Expression.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,4 @@
+package org.drools.runtime.pipeline;
+
+public interface Expression extends Emitter, Receiver, Stage {
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Expression.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Feeder.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Feeder.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Feeder.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Feeder.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,5 @@
+package org.drools.runtime.pipeline;
+
+public interface Feeder extends Emitter, Stage {
+
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Feeder.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Filter.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Filter.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Filter.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Filter.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,5 @@
+package org.drools.runtime.pipeline;
+
+public interface Filter extends Emitter, Receiver, Stage {
+
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Filter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/JaxbPipelineProvider.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/JaxbPipelineProvider.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/JaxbPipelineProvider.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/JaxbPipelineProvider.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,7 @@
+package org.drools.runtime.pipeline;
+
+import javax.xml.bind.Unmarshaller;
+
+public interface JaxbPipelineProvider {
+ Transformer newJaxbTransformer(Unmarshaller unmarshaller);
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/JaxbPipelineProvider.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineFactory.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/PipelineFactory.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineFactory.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineFactory.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,134 @@
+package org.drools.runtime.pipeline;
+
+import javax.xml.bind.Unmarshaller;
+
+import org.drools.ProviderInitializationException;
+import org.milyn.Smooks;
+
+import com.thoughtworks.xstream.XStream;
+
+public class PipelineFactory {
+
+ private static CorePipelineProvider corePipelineProvider;
+
+ private static JaxbPipelineProvider jaxbPipelineProvider;
+
+ private static SmooksPipelineProvider smooksPipelineProvider;
+
+ private static XStreamPipelineProvider xstreamPipelineProvider;
+
+ public static Transformer newSmooksTransformer(Smooks smooks,
+ String rootId) {
+ return getSmooksPipelineProvider().newSmooksTransformer( smooks,
+ rootId );
+ }
+
+ public static Transformer newJaxbTransformer(Unmarshaller unmarshaller) {
+ return getJaxbPipelineProvider().newJaxbTransformer( unmarshaller );
+ }
+
+ public static Transformer newXStreamTransformer(XStream xstream) {
+ return getXStreamPipelineProvider().newXStreamTransformer( xstream );
+ }
+
+ public static Expression newMvelExpression(String expression) {
+ return getCorePipelineProvider().newMvelExpression( expression );
+ }
+
+ public static Splitter newIterateSplitter() {
+ return getCorePipelineProvider().newIterateSplitter();
+ }
+
+ public static Adapter newStatefulKnowledgeSessionReceiverAdapter() {
+ return getCorePipelineProvider().newStatefulKnowledgeSessionReceiverAdapter();
+ }
+
+ public static Adapter newStatelessKnowledgeSessionReceiverAdapter() {
+ return getCorePipelineProvider().newStatelessKnowledgeSessionReceiverAdapter();
+ }
+
+ private static synchronized void setCorePipelineProvider(CorePipelineProvider provider) {
+ PipelineFactory.corePipelineProvider = provider;
+ }
+
+ private static synchronized CorePipelineProvider getCorePipelineProvider() {
+ if ( corePipelineProvider == null ) {
+ loadCorePipelineProvider();
+ }
+ return corePipelineProvider;
+ }
+
+ private static void loadCorePipelineProvider() {
+ try {
+ Class<CorePipelineProvider> cls = (Class<CorePipelineProvider>) Class.forName( "org.drools.runtime.pipeline.impl.CorePipelineProviderImpl" );
+ setCorePipelineProvider( cls.newInstance() );
+ } catch ( Exception e2 ) {
+ throw new ProviderInitializationException( "org.drools.runtime.pipeline.impl.CorePipelineProviderImpl could not be set.",
+ e2 );
+ }
+ }
+
+ private static synchronized void setJaxbPipelineProvider(JaxbPipelineProvider provider) {
+ PipelineFactory.jaxbPipelineProvider = provider;
+ }
+
+ private static synchronized JaxbPipelineProvider getJaxbPipelineProvider() {
+ if ( jaxbPipelineProvider == null ) {
+ loadJaxbPipelineProvider();
+ }
+ return jaxbPipelineProvider;
+ }
+
+ private static void loadJaxbPipelineProvider() {
+ try {
+ Class<JaxbPipelineProvider> cls = (Class<JaxbPipelineProvider>) Class.forName( "org.drools.runtime.pipeline.impl.JaxbTransformer$JaxbPipelineProviderImpl" );
+ setJaxbPipelineProvider( cls.newInstance() );
+ } catch ( Exception e2 ) {
+ throw new ProviderInitializationException( "Provider org.drools.runtime.pipeline.impl.JaxbTransformer$JaxbPipelineProviderImpl could not be set.",
+ e2 );
+ }
+ }
+
+ private static synchronized void setSmooksPipelineProvider(SmooksPipelineProvider provider) {
+ PipelineFactory.smooksPipelineProvider = provider;
+ }
+
+ private static synchronized SmooksPipelineProvider getSmooksPipelineProvider() {
+ if ( smooksPipelineProvider == null ) {
+ loadSmooksPipelineProvider();
+ }
+ return smooksPipelineProvider;
+ }
+
+ private static void loadSmooksPipelineProvider() {
+ try {
+ Class<SmooksPipelineProvider> cls = (Class<SmooksPipelineProvider>) Class.forName( "org.drools.runtime.pipeline.impl.SmooksTransformer$SmooksPipelineProviderImpl" );
+ setSmooksPipelineProvider( cls.newInstance() );
+ } catch ( Exception e2 ) {
+ throw new ProviderInitializationException( "Provider org.drools.runtime.pipeline.impl.SmooksTransformer$SmooksPipelineProviderImpl could not be set.",
+ e2 );
+ }
+ }
+
+ private static synchronized void setXStreamPipelineProvider(XStreamPipelineProvider provider) {
+ PipelineFactory.xstreamPipelineProvider = provider;
+ }
+
+ private static synchronized XStreamPipelineProvider getXStreamPipelineProvider() {
+ if ( xstreamPipelineProvider == null ) {
+ loadXStreamPipelineProvider();
+ }
+ return xstreamPipelineProvider;
+ }
+
+ private static void loadXStreamPipelineProvider() {
+ try {
+ Class<XStreamPipelineProvider> cls = (Class<XStreamPipelineProvider>) Class.forName( "org.drools.runtime.pipeline.impl.XStreamTransformer$XStreamPipelineProviderImpl" );
+ setXStreamPipelineProvider( cls.newInstance() );
+ } catch ( Exception e2 ) {
+ throw new ProviderInitializationException( "Provider org.drools.runtime.pipeline.impl.XStreamTransformer$XStreamPipelineProviderImpl could not be set.",
+ e2 );
+ }
+ }
+
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/PipelineFactory.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Receiver.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Receiver.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Receiver.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Receiver.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,6 @@
+package org.drools.runtime.pipeline;
+
+
+public interface Receiver {
+ void signal(Object object, PipelineContext context);
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Receiver.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/SmooksPipelineProvider.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/SmooksPipelineProvider.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/SmooksPipelineProvider.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/SmooksPipelineProvider.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,8 @@
+package org.drools.runtime.pipeline;
+
+import org.milyn.Smooks;
+
+public interface SmooksPipelineProvider {
+ Transformer newSmooksTransformer(Smooks smooks,
+ String rootId);
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/SmooksPipelineProvider.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Splitter.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Splitter.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Splitter.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Splitter.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,5 @@
+package org.drools.runtime.pipeline;
+
+public interface Splitter extends Emitter, Receiver, Stage {
+
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Splitter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Stage.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Stage.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Stage.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Stage.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,5 @@
+package org.drools.runtime.pipeline;
+
+public interface Stage {
+ public void setStageExceptionHandler(StageExceptionHandler exceptionHandler);
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Stage.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/StageExceptionHandler.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/StageExceptionHandler.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/StageExceptionHandler.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/StageExceptionHandler.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,5 @@
+package org.drools.runtime.pipeline;
+
+public interface StageExceptionHandler {
+ public void handleException(Stage stage, Object object, Exception exception);
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/StageExceptionHandler.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Transformer.java (from rev 24491, labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/pipeline/Transformer.java)
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Transformer.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Transformer.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,5 @@
+package org.drools.runtime.pipeline;
+
+public interface Transformer extends Emitter, Receiver, Stage {
+
+}
Property changes on: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/pipeline/Transformer.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: labs/jbossrules/trunk/drools-compiler/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-compiler/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-compiler/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -19,5 +19,5 @@
<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mvel/mvel2/2.0.5/mvel2-2.0.5.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-core/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-core/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -13,5 +13,5 @@
<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mvel/mvel2/2.0.5/mvel2-2.0.5.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/DataLoaderProviderImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/DataLoaderProviderImpl.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/DataLoaderProviderImpl.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -1,11 +1,11 @@
package org.drools.runtime.dataloader.impl;
-import org.drools.definition.pipeline.Receiver;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.StatelessKnowledgeSession;
import org.drools.runtime.dataloader.DataLoaderProvider;
import org.drools.runtime.dataloader.StatefulKnowledgeSessionDataLoader;
import org.drools.runtime.dataloader.StatelessKnowledgeSessionDataLoader;
+import org.drools.runtime.pipeline.Receiver;
public class DataLoaderProviderImpl
implements
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatefulKnowledgeSessionDataLoaderImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatefulKnowledgeSessionDataLoaderImpl.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatefulKnowledgeSessionDataLoaderImpl.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -3,10 +3,10 @@
import java.util.Collection;
import java.util.Map;
-import org.drools.definition.pipeline.Emitter;
-import org.drools.definition.pipeline.Receiver;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.dataloader.StatefulKnowledgeSessionDataLoader;
+import org.drools.runtime.pipeline.Emitter;
+import org.drools.runtime.pipeline.Receiver;
public class StatefulKnowledgeSessionDataLoaderImpl
implements
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatefulKnowledgeSessionReceiverAdapter.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatefulKnowledgeSessionReceiverAdapter.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatefulKnowledgeSessionReceiverAdapter.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -3,7 +3,7 @@
*/
package org.drools.runtime.dataloader.impl;
-import org.drools.definition.pipeline.Adapter;
+import org.drools.runtime.pipeline.Adapter;
import org.drools.runtime.pipeline.PipelineContext;
import org.drools.runtime.pipeline.impl.BaseStage;
import org.drools.runtime.rule.FactHandle;
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatelessKnowledgeSessionDataLoaderImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatelessKnowledgeSessionDataLoaderImpl.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatelessKnowledgeSessionDataLoaderImpl.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -1,10 +1,10 @@
package org.drools.runtime.dataloader.impl;
-import org.drools.definition.pipeline.Receiver;
import org.drools.runtime.Parameters;
import org.drools.runtime.StatelessKnowledgeSession;
import org.drools.runtime.StatelessKnowledgeSessionResults;
import org.drools.runtime.dataloader.StatelessKnowledgeSessionDataLoader;
+import org.drools.runtime.pipeline.Receiver;
public class StatelessKnowledgeSessionDataLoaderImpl implements StatelessKnowledgeSessionDataLoader {
private StatelessKnowledgeSession ksession;
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatelessKnowledgeSessionReceiverAdapter.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatelessKnowledgeSessionReceiverAdapter.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/dataloader/impl/StatelessKnowledgeSessionReceiverAdapter.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -3,7 +3,7 @@
*/
package org.drools.runtime.dataloader.impl;
-import org.drools.definition.pipeline.Adapter;
+import org.drools.runtime.pipeline.Adapter;
import org.drools.runtime.pipeline.PipelineContext;
import org.drools.runtime.pipeline.impl.BaseStage;
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BaseEmitter.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BaseEmitter.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BaseEmitter.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -5,9 +5,9 @@
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
-import org.drools.definition.pipeline.Emitter;
-import org.drools.definition.pipeline.Receiver;
+import org.drools.runtime.pipeline.Emitter;
import org.drools.runtime.pipeline.PipelineContext;
+import org.drools.runtime.pipeline.Receiver;
public class BaseEmitter extends BaseStage
implements
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BaseStage.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BaseStage.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/BaseStage.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -1,7 +1,7 @@
package org.drools.runtime.pipeline.impl;
-import org.drools.definition.pipeline.Stage;
-import org.drools.definition.pipeline.StageExceptionHandler;
+import org.drools.runtime.pipeline.Stage;
+import org.drools.runtime.pipeline.StageExceptionHandler;
public class BaseStage implements Stage {
private StageExceptionHandler exceptionHandler;
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/CorePipelineProviderImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/CorePipelineProviderImpl.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/CorePipelineProviderImpl.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -1,11 +1,11 @@
package org.drools.runtime.pipeline.impl;
-import org.drools.definition.pipeline.Adapter;
-import org.drools.definition.pipeline.CorePipelineProvider;
-import org.drools.definition.pipeline.Expression;
-import org.drools.definition.pipeline.Splitter;
import org.drools.runtime.dataloader.impl.StatefulKnowledgeSessionReceiverAdapter;
import org.drools.runtime.dataloader.impl.StatelessKnowledgeSessionReceiverAdapter;
+import org.drools.runtime.pipeline.Adapter;
+import org.drools.runtime.pipeline.CorePipelineProvider;
+import org.drools.runtime.pipeline.Expression;
+import org.drools.runtime.pipeline.Splitter;
public class CorePipelineProviderImpl implements CorePipelineProvider {
public Expression newMvelExpression(String expression) {
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/IterateSplitter.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/IterateSplitter.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/IterateSplitter.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -1,7 +1,7 @@
package org.drools.runtime.pipeline.impl;
-import org.drools.definition.pipeline.Splitter;
import org.drools.runtime.pipeline.PipelineContext;
+import org.drools.runtime.pipeline.Splitter;
public class IterateSplitter extends BaseEmitter
implements
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/MvelExpression.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/MvelExpression.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/runtime/pipeline/impl/MvelExpression.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -2,9 +2,9 @@
import java.io.Serializable;
-import org.drools.definition.pipeline.Expression;
-import org.drools.definition.pipeline.Receiver;
+import org.drools.runtime.pipeline.Expression;
import org.drools.runtime.pipeline.PipelineContext;
+import org.drools.runtime.pipeline.Receiver;
import org.mvel2.MVEL;
import org.mvel2.ParserContext;
import org.mvel2.compiler.ExpressionCompiler;
Modified: labs/jbossrules/trunk/drools-guvnor/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-guvnor/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -85,5 +85,5 @@
<classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/2.0.2/xml-apis-2.0.2.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/main/java/org/drools/runtime/pipeline/impl/JaxbTransformer.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/main/java/org/drools/runtime/pipeline/impl/JaxbTransformer.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/main/java/org/drools/runtime/pipeline/impl/JaxbTransformer.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -8,9 +8,9 @@
import javax.xml.bind.Unmarshaller;
import javax.xml.transform.Source;
-import org.drools.definition.pipeline.JaxbPipelineProvider;
-import org.drools.definition.pipeline.Transformer;
+import org.drools.runtime.pipeline.JaxbPipelineProvider;
import org.drools.runtime.pipeline.PipelineContext;
+import org.drools.runtime.pipeline.Transformer;
import org.drools.runtime.pipeline.impl.BaseEmitter;
import org.drools.runtime.pipeline.impl.BaseStage;
import org.xml.sax.InputSource;
Modified: labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/test/java/org/drools/runtime/pipeline/impl/DroolsJaxbTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/test/java/org/drools/runtime/pipeline/impl/DroolsJaxbTest.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/test/java/org/drools/runtime/pipeline/impl/DroolsJaxbTest.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -32,14 +32,14 @@
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.builder.help.KnowledgeBuilderHelper;
-import org.drools.definition.pipeline.Expression;
-import org.drools.definition.pipeline.PipelineFactory;
-import org.drools.definition.pipeline.Splitter;
-import org.drools.definition.pipeline.Transformer;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.dataloader.StatefulKnowledgeSessionDataLoader;
import org.drools.runtime.dataloader.impl.StatefulKnowledgeSessionDataLoaderImpl;
+import org.drools.runtime.pipeline.Expression;
+import org.drools.runtime.pipeline.PipelineFactory;
+import org.drools.runtime.pipeline.Splitter;
+import org.drools.runtime.pipeline.Transformer;
import org.drools.runtime.rule.FactHandle;
import com.sun.tools.xjc.Language;
Modified: labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -28,5 +28,5 @@
<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.8.0/xercesImpl-2.8.0.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/2.0.2/xml-apis-2.0.2.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/main/java/org/drools/runtime/pipeline/impl/SmooksTransformer.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/main/java/org/drools/runtime/pipeline/impl/SmooksTransformer.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/main/java/org/drools/runtime/pipeline/impl/SmooksTransformer.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -2,9 +2,9 @@
import javax.xml.transform.Source;
-import org.drools.definition.pipeline.SmooksPipelineProvider;
-import org.drools.definition.pipeline.Transformer;
import org.drools.runtime.pipeline.PipelineContext;
+import org.drools.runtime.pipeline.SmooksPipelineProvider;
+import org.drools.runtime.pipeline.Transformer;
import org.drools.runtime.pipeline.impl.BaseEmitter;
import org.milyn.Smooks;
import org.milyn.container.ExecutionContext;
Modified: labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/test/java/org/drools/runtime/pipeline/impl/DroolsSmookStatefulSessionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/test/java/org/drools/runtime/pipeline/impl/DroolsSmookStatefulSessionTest.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/test/java/org/drools/runtime/pipeline/impl/DroolsSmookStatefulSessionTest.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -15,16 +15,16 @@
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
-import org.drools.definition.pipeline.Expression;
-import org.drools.definition.pipeline.PipelineFactory;
-import org.drools.definition.pipeline.Splitter;
-import org.drools.definition.pipeline.Transformer;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.dataloader.DataLoaderFactory;
import org.drools.runtime.dataloader.StatefulKnowledgeSessionDataLoader;
import org.drools.runtime.dataloader.impl.StatefulKnowledgeSessionDataLoaderImpl;
import org.drools.runtime.dataloader.impl.StatefulKnowledgeSessionReceiverAdapter;
+import org.drools.runtime.pipeline.Expression;
+import org.drools.runtime.pipeline.PipelineFactory;
+import org.drools.runtime.pipeline.Splitter;
+import org.drools.runtime.pipeline.Transformer;
import org.drools.runtime.pipeline.impl.DroolsSmooksConfiguration;
import org.drools.runtime.pipeline.impl.IterateSplitter;
import org.drools.runtime.pipeline.impl.MvelExpression;
Modified: labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/test/java/org/drools/runtime/pipeline/impl/DroolsSmookStatelessSessionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/test/java/org/drools/runtime/pipeline/impl/DroolsSmookStatelessSessionTest.java 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-smooks/src/test/java/org/drools/runtime/pipeline/impl/DroolsSmookStatelessSessionTest.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -14,14 +14,14 @@
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
-import org.drools.definition.pipeline.Expression;
-import org.drools.definition.pipeline.PipelineFactory;
-import org.drools.definition.pipeline.Splitter;
-import org.drools.definition.pipeline.Transformer;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatelessKnowledgeSession;
import org.drools.runtime.dataloader.StatelessKnowledgeSessionDataLoader;
import org.drools.runtime.dataloader.impl.StatelessKnowledgeSessionDataLoaderImpl;
+import org.drools.runtime.pipeline.Expression;
+import org.drools.runtime.pipeline.PipelineFactory;
+import org.drools.runtime.pipeline.Splitter;
+import org.drools.runtime.pipeline.Transformer;
import org.milyn.Smooks;
import org.milyn.io.StreamUtils;
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/.classpath (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,22 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" including="**" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.1.1/antlr-runtime-3.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.4.2.v_883_R34x/core-3.4.2.v_883_R34x.jar"/>
+ <classpathentry kind="src" path="/drools-api"/>
+ <classpathentry kind="src" path="/drools-compiler"/>
+ <classpathentry kind="src" path="/drools-core"/>
+ <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/janino/janino/2.5.15/janino-2.5.15.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jmock/jmock/2.5.0.1/jmock-2.5.0.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/joda-time/joda-time/1.5.2/joda-time-1.5.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mvel/mvel2/2.0.5/mvel2-2.0.5.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
+</classpath>
\ No newline at end of file
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/.project
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/.project (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/.project 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,17 @@
+<projectDescription>
+ <name>drools-transformer-xstream</name>
+ <comment>A rule production system</comment>
+ <projects>
+ <project>drools-api</project>
+ <project>drools-compiler</project>
+ <project>drools-core</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/pom.xml (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/pom.xml 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>drools</artifactId>
+ <groupId>org.drools</groupId>
+ <version>5.0.0.SNAPSHOT</version>
+ </parent>
+
+ <artifactId>drools-transformer-xstream</artifactId>
+ <packaging>jar</packaging>
+ <name>Drools :: Transformer :: XStream</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>dist.codehaus.org</id>
+ <url>http://dist.codehaus.org</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+</project>
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/impl/Root.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/impl/Root.java (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/impl/Root.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,21 @@
+package org.drools.runtime.pipeline.impl;
+
+import java.util.List;
+
+public class Root {
+ private List children;
+
+ public Root() {
+
+ }
+
+ public List getChildren() {
+ return children;
+ }
+
+ public void setChildren(List children) {
+ this.children = children;
+ }
+
+
+}
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/impl/XStreamTransformer.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/impl/XStreamTransformer.java (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/main/java/org/drools/runtime/pipeline/impl/XStreamTransformer.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,50 @@
+package org.drools.runtime.pipeline.impl;
+
+import java.io.InputStream;
+import java.io.Reader;
+
+import javax.xml.transform.Source;
+
+import org.drools.runtime.pipeline.PipelineContext;
+import org.drools.runtime.pipeline.SmooksPipelineProvider;
+import org.drools.runtime.pipeline.Transformer;
+import org.drools.runtime.pipeline.XStreamPipelineProvider;
+import org.drools.runtime.pipeline.impl.BaseEmitter;
+import com.thoughtworks.xstream.XStream;;
+
+public class XStreamTransformer extends BaseEmitter
+ implements
+ Transformer {
+ private XStream xstream;
+
+ public XStreamTransformer(XStream xstream) {
+ this.xstream = xstream;
+
+ }
+
+ public void signal(Object object,
+ PipelineContext context) {
+ this.xstream.setClassLoader( context.getClassLoader() );
+ Object result = null;
+ try {
+ if ( object instanceof Reader ) {
+ result = this.xstream.fromXML( ( Reader ) object );
+ } else if ( object instanceof InputStream ) {
+ result = this.xstream.fromXML( ( InputStream ) object );
+ }
+ } catch ( Exception e ) {
+ handleException( this,
+ object,
+ e );
+ }
+ emit( result,
+ context );
+ }
+
+ public static class XStreamPipelineProviderImpl implements XStreamPipelineProvider {
+ public Transformer newXStreamTransformer(XStream xstream) {
+ return new XStreamTransformer( xstream );
+ }
+ }
+
+}
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/DroolsXStreamStatefulSessionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/DroolsXStreamStatefulSessionTest.java (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/DroolsXStreamStatefulSessionTest.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,119 @@
+package org.drools.runtime.pipeline.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.TestCase;
+
+import org.drools.KnowledgeBase;
+import org.drools.KnowledgeBaseFactory;
+import org.drools.builder.KnowledgeBuilder;
+import org.drools.builder.KnowledgeBuilderFactory;
+import org.drools.builder.ResourceType;
+import org.drools.common.InternalRuleBase;
+import org.drools.impl.KnowledgeBaseImpl;
+import org.drools.impl.StatefulKnowledgeSessionImpl;
+import org.drools.io.ResourceFactory;
+import org.drools.runtime.StatefulKnowledgeSession;
+import org.drools.runtime.dataloader.DataLoaderFactory;
+import org.drools.runtime.dataloader.StatefulKnowledgeSessionDataLoader;
+import org.drools.runtime.dataloader.impl.StatefulKnowledgeSessionDataLoaderImpl;
+import org.drools.runtime.dataloader.impl.StatefulKnowledgeSessionReceiverAdapter;
+import org.drools.runtime.pipeline.Expression;
+import org.drools.runtime.pipeline.PipelineFactory;
+import org.drools.runtime.pipeline.Splitter;
+import org.drools.runtime.pipeline.Transformer;
+import org.drools.runtime.pipeline.impl.IterateSplitter;
+import org.drools.runtime.pipeline.impl.MvelExpression;
+import org.drools.runtime.rule.FactHandle;
+
+import com.thoughtworks.xstream.XStream;
+
+public class DroolsXStreamStatefulSessionTest extends TestCase {
+
+ public void testDirectRoot() throws Exception {
+ KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+
+ kbuilder.add( ResourceFactory.newClassPathResource( "test_XStreamDirectRoot.drl",
+ DroolsXStreamStatefulSessionTest.class ),
+ ResourceType.DRL );
+
+ assertFalse( kbuilder.hasErrors() );
+
+ KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
+ kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
+
+ StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
+ List list = new ArrayList();
+ ksession.setGlobal( "list",
+ list );
+
+ XStream xstream = new XStream();
+ Transformer transformer = PipelineFactory.newXStreamTransformer( xstream );
+ transformer.addReceiver( PipelineFactory.newStatefulKnowledgeSessionReceiverAdapter() );
+
+ StatefulKnowledgeSessionDataLoader dataLoader = DataLoaderFactory.newStatefulKnowledgeSessionDataLoader( ksession,
+ transformer );
+ Map<FactHandle, Object> handles = dataLoader.insert( getClass().getResourceAsStream( "XStreamDirectRoot.xml" ) );
+ ksession.fireAllRules();
+
+ assertEquals( 1,
+ handles.size() );
+ assertEquals( 1,
+ list.size() );
+
+ assertEquals( "example.OrderItem",
+ list.get( 0 ).getClass().getName() );
+ }
+
+ public void testNestedIterable() throws Exception {
+ KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+
+ kbuilder.add( ResourceFactory.newClassPathResource( "test_XStreamNestedIterable.drl",
+ DroolsXStreamStatefulSessionTest.class ),
+ ResourceType.DRL );
+
+ assertFalse( kbuilder.hasErrors() );
+
+ KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
+ kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
+
+ StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
+ List list = new ArrayList();
+ ksession.setGlobal( "list",
+ list );
+
+ XStream xstream = new XStream();
+ Transformer transformer = PipelineFactory.newXStreamTransformer( xstream );
+ Expression expression = PipelineFactory.newMvelExpression( "this" );
+ transformer.addReceiver( expression );
+ Splitter splitter = PipelineFactory.newIterateSplitter();
+ expression.addReceiver( splitter );
+ splitter.addReceiver( PipelineFactory.newStatefulKnowledgeSessionReceiverAdapter() );
+
+ StatefulKnowledgeSessionDataLoader dataLoader = DataLoaderFactory.newStatefulKnowledgeSessionDataLoader( ksession,
+ transformer );
+
+ Map<FactHandle, Object> handles = dataLoader.insert( getClass().getResourceAsStream( "XStreamNestedIterable.xml" ) );
+ ksession.fireAllRules();
+
+ assertEquals( 2,
+ handles.size() );
+ assertEquals( 2,
+ list.size() );
+
+ assertEquals( "example.OrderItem",
+ list.get( 0 ).getClass().getName() );
+ assertEquals( "example.OrderItem",
+ list.get( 1 ).getClass().getName() );
+
+ assertNotSame( list.get( 0 ),
+ list.get( 1 ) );
+ }
+
+}
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/DroolsXStreamStatelessSessionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/DroolsXStreamStatelessSessionTest.java (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/DroolsXStreamStatelessSessionTest.java 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,101 @@
+package org.drools.runtime.pipeline.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.TestCase;
+
+import org.drools.KnowledgeBase;
+import org.drools.KnowledgeBaseFactory;
+import org.drools.builder.KnowledgeBuilder;
+import org.drools.builder.KnowledgeBuilderFactory;
+import org.drools.builder.ResourceType;
+import org.drools.io.ResourceFactory;
+import org.drools.runtime.StatelessKnowledgeSession;
+import org.drools.runtime.dataloader.StatelessKnowledgeSessionDataLoader;
+import org.drools.runtime.dataloader.impl.StatelessKnowledgeSessionDataLoaderImpl;
+import org.drools.runtime.pipeline.Expression;
+import org.drools.runtime.pipeline.PipelineFactory;
+import org.drools.runtime.pipeline.Splitter;
+import org.drools.runtime.pipeline.Transformer;
+
+import com.thoughtworks.xstream.XStream;
+
+public class DroolsXStreamStatelessSessionTest extends TestCase {
+
+ public void testSmooksDirectRoot() throws Exception {
+ KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+
+ kbuilder.add( ResourceFactory.newClassPathResource( "test_XStreamDirectRoot.drl",
+ DroolsXStreamStatefulSessionTest.class ),
+ ResourceType.DRL );
+
+ assertFalse( kbuilder.hasErrors() );
+
+ KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
+ kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
+
+ StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
+ List list = new ArrayList();
+ ksession.setGlobal( "list",
+ list );
+
+ XStream xstream = new XStream();
+ Transformer transformer = PipelineFactory.newXStreamTransformer( xstream );
+ transformer.addReceiver( PipelineFactory.newStatelessKnowledgeSessionReceiverAdapter() );
+
+ StatelessKnowledgeSessionDataLoader dataLoader = new StatelessKnowledgeSessionDataLoaderImpl( ksession,
+ transformer );
+ dataLoader.executeObject( getClass().getResourceAsStream( "XStreamDirectRoot.xml" ) );
+
+ assertEquals( 1,
+ list.size() );
+
+ assertEquals( "example.OrderItem",
+ list.get( 0 ).getClass().getName() );
+ }
+
+ public void testSmooksNestedIterable() throws Exception {
+ KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+
+ kbuilder.add( ResourceFactory.newClassPathResource( "test_XStreamNestedIterable.drl",
+ DroolsXStreamStatefulSessionTest.class ),
+ ResourceType.DRL );
+
+ assertFalse( kbuilder.hasErrors() );
+
+ KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
+ kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
+
+ StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
+ List list = new ArrayList();
+ ksession.setGlobal( "list",
+ list );
+
+ XStream xstream = new XStream();
+ Transformer transformer = PipelineFactory.newXStreamTransformer( xstream );
+ Expression expression = PipelineFactory.newMvelExpression( "this" );
+ transformer.addReceiver( expression );
+ Splitter splitter = PipelineFactory.newIterateSplitter();
+ expression.addReceiver( splitter );
+ splitter.addReceiver( PipelineFactory.newStatelessKnowledgeSessionReceiverAdapter() );
+
+ StatelessKnowledgeSessionDataLoader dataLoader = new StatelessKnowledgeSessionDataLoaderImpl( ksession,
+ transformer );
+ dataLoader.executeIterable( getClass().getResourceAsStream( "XStreamNestedIterable.xml" ) );
+
+ assertEquals( 2,
+ list.size() );
+
+ assertEquals( "example.OrderItem",
+ list.get( 0 ).getClass().getName() );
+ assertEquals( "example.OrderItem",
+ list.get( 1 ).getClass().getName() );
+
+ assertNotSame( list.get( 0 ),
+ list.get( 1 ) );
+ }
+
+}
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/XStreamDirectRoot.xml
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/XStreamDirectRoot.xml (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/XStreamDirectRoot.xml 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,5 @@
+<example.OrderItem>
+ <productId>222</productId>
+ <quantity>7</quantity>
+ <price>5.20</price>
+</example.OrderItem>
\ No newline at end of file
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/XStreamNestedIterable.xml
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/XStreamNestedIterable.xml (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/XStreamNestedIterable.xml 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,12 @@
+<java.util.ArrayList>
+ <example.OrderItem>
+ <productId>111</productId>
+ <quantity>2</quantity>
+ <price>8.90</price>
+ </example.OrderItem>
+ <example.OrderItem>
+ <productId>222</productId>
+ <quantity>7</quantity>
+ <price>5.20</price>
+ </example.OrderItem>
+</java.util.ArrayList>
\ No newline at end of file
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/test_XStreamDirectRoot.drl
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/test_XStreamDirectRoot.drl (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/test_XStreamDirectRoot.drl 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,16 @@
+package example
+
+global java.util.List list;
+
+declare OrderItem
+ productId : long
+ quantity : Integer
+ price : double
+end
+
+rule someRule
+when
+ $i : OrderItem()
+then
+ list.add( $i );
+end
\ No newline at end of file
Added: labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/test_XStreamNestedIterable.drl
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/test_XStreamNestedIterable.drl (rev 0)
+++ labs/jbossrules/trunk/drools-pipeline/drools-transformer-xstream/src/test/resources/org/drools/runtime/pipeline/impl/test_XStreamNestedIterable.drl 2008-12-24 00:54:33 UTC (rev 24496)
@@ -0,0 +1,16 @@
+package example
+
+global java.util.List list;
+
+declare OrderItem
+ productId : long
+ quantity : Integer
+ price : double
+end
+
+rule someRule
+when
+ $i : OrderItem()
+then
+ list.add( $i );
+end
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-pipeline/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/pom.xml 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-pipeline/pom.xml 2008-12-24 00:54:33 UTC (rev 24496)
@@ -15,6 +15,7 @@
<modules>
<module>drools-transformer-smooks</module>
<module>drools-transformer-jaxb</module>
+ <module>drools-transformer-xstream</module>
</modules>
</project>
Modified: labs/jbossrules/trunk/drools-process/drools-process-task/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -52,5 +52,5 @@
<classpathentry kind="var" path="M2_REPO/org/subethamail/subethasmtp-wiser/1.2/subethasmtp-wiser-1.2.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/2.0.2/xml-apis-2.0.2.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-server/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-server/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-server/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -22,5 +22,5 @@
<classpathentry kind="var" path="M2_REPO/stax/stax/1.2.0/stax-1.2.0.jar"/>
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-solver/drools-solver-core/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-solver/drools-solver-core/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-solver/drools-solver-core/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -23,5 +23,5 @@
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.4.3/slf4j-log4j12-1.4.3.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-solver/drools-solver-examples/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-solver/drools-solver-examples/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-solver/drools-solver-examples/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -24,5 +24,5 @@
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.4.3/slf4j-log4j12-1.4.3.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-verifier/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-verifier/.classpath 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/drools-verifier/.classpath 2008-12-24 00:54:33 UTC (rev 24496)
@@ -18,5 +18,5 @@
<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mvel/mvel2/2.0.5/mvel2-2.0.5.jar"/>
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
</classpath>
\ No newline at end of file
Modified: labs/jbossrules/trunk/pom.xml
===================================================================
--- labs/jbossrules/trunk/pom.xml 2008-12-23 21:10:06 UTC (rev 24495)
+++ labs/jbossrules/trunk/pom.xml 2008-12-24 00:54:33 UTC (rev 24496)
@@ -909,7 +909,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
- <version>1.3</version>
+ <version>1.3.1</version>
</dependency>
<dependency><!-- TODO remove me as xstream brings in xpp3_min -->
<groupId>xpp3</groupId>
More information about the jboss-svn-commits
mailing list