[seam-commits] Seam SVN: r12498 - in modules/drools/trunk: impl/src/main/java/org/jboss/seam/drools and 6 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Wed Apr 14 23:21:33 EDT 2010
Author: tsurdilovic
Date: 2010-04-14 23:21:31 -0400 (Wed, 14 Apr 2010)
New Revision: 12498
Added:
modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/EntryPoint.java
modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Query.java
modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Scanned.java
modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestRules.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestRules.java
Removed:
modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/KAgentConfigured.java
modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/KBaseConfigured.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/insertion/
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestQualifier.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestQualifier.java
Modified:
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeAgentProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeLoggerProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/kbase/KBaseTest-beans.xml
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/KSessionTest-beans.xml
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/ksessiontest.drl
Log:
new code added using <s:ApplyQualifiers /> xml config.
Added: modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/EntryPoint.java
===================================================================
--- modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/EntryPoint.java (rev 0)
+++ modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/EntryPoint.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -0,0 +1,28 @@
+package org.jboss.seam.drools.qualifiers;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.inject.Qualifier;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+ at Qualifier
+ at Target( { TYPE, METHOD, FIELD, PARAMETER })
+ at Documented
+ at Retention(RUNTIME)
+ at Inherited
+public @interface EntryPoint {
+ @Nonbinding String value() default "";
+}
Deleted: modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/KAgentConfigured.java
===================================================================
--- modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/KAgentConfigured.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/KAgentConfigured.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1,29 +0,0 @@
-package org.jboss.seam.drools.qualifiers;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
-/**
- * Qualifier for Drools KnowledgeBase configured for KnowledgeAgent.
- *
- * @author Tihomir Surdilovic
- */
- at Qualifier
- at Target( { TYPE, METHOD, FIELD, PARAMETER })
- at Documented
- at Retention(RUNTIME)
- at Inherited
-public @interface KAgentConfigured
-{
-
-}
Deleted: modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/KBaseConfigured.java
===================================================================
--- modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/KBaseConfigured.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/KBaseConfigured.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1,29 +0,0 @@
-package org.jboss.seam.drools.qualifiers;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
-/**
- * Qualifier for Drools KnowledgeBase default configuration.
- *
- * @author Tihomir Surdilovic
- */
- at Qualifier
- at Target( { TYPE, METHOD, FIELD, PARAMETER })
- at Documented
- at Retention(RUNTIME)
- at Inherited
-public @interface KBaseConfigured
-{
-
-}
Added: modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Query.java
===================================================================
--- modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Query.java (rev 0)
+++ modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Query.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -0,0 +1,28 @@
+package org.jboss.seam.drools.qualifiers;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.inject.Qualifier;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+ at Qualifier
+ at Target( { TYPE, METHOD, FIELD, PARAMETER })
+ at Documented
+ at Retention(RUNTIME)
+ at Inherited
+public @interface Query {
+ @Nonbinding String value() default "";
+}
Added: modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Scanned.java
===================================================================
--- modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Scanned.java (rev 0)
+++ modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Scanned.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -0,0 +1,27 @@
+package org.jboss.seam.drools.qualifiers;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+ at Qualifier
+ at Target( { TYPE, METHOD, FIELD, PARAMETER })
+ at Documented
+ at Retention(RUNTIME)
+ at Inherited
+public @interface Scanned {
+
+}
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1,12 +1,14 @@
package org.jboss.seam.drools;
-import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.rule.WorkingMemoryEntryPoint;
-import org.jboss.seam.drools.qualifiers.KAgentConfigured;
-import org.jboss.seam.drools.qualifiers.KBaseConfigured;
+import org.jboss.seam.drools.qualifiers.EntryPoint;
+import org.jboss.seam.drools.qualifiers.Scanned;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -14,12 +16,39 @@
*/
public class EntryPointProducer
{
- @Produces @KBaseConfigured WorkingMemoryEntryPoint produceEntryPoint(@KBaseConfigured StatefulKnowledgeSession ksession, Instance<String> entryPointNameInstance) {
- return ksession.getWorkingMemoryEntryPoint(entryPointNameInstance.get());
+ private static final Logger log = LoggerFactory.getLogger(EntryPointProducer.class);
+
+ @Produces
+ @EntryPoint
+ public WorkingMemoryEntryPoint produceEntryPoint(StatefulKnowledgeSession ksession, InjectionPoint ip) throws Exception
+ {
+ String entryPointName = ip.getAnnotated().getAnnotation(EntryPoint.class).value();
+ if (entryPointName != null && entryPointName.length() > 0)
+ {
+ log.debug("EntryPoint Name requested: " + entryPointName);
+ return ksession.getWorkingMemoryEntryPoint(entryPointName);
+ }
+ else
+ {
+ throw new IllegalStateException("EntryPoint must have a name.");
+ }
}
-
- @Produces @KAgentConfigured WorkingMemoryEntryPoint produceKAgentEntryPoint(@KAgentConfigured StatefulKnowledgeSession ksession, Instance<String> entryPointNameInstance) {
- return ksession.getWorkingMemoryEntryPoint(entryPointNameInstance.get());
+
+ @Produces
+ @EntryPoint
+ @Scanned
+ public WorkingMemoryEntryPoint produceScannedEntryPoint(@Scanned StatefulKnowledgeSession ksession, InjectionPoint ip) throws Exception
+ {
+ String entryPointName = ip.getAnnotated().getAnnotation(EntryPoint.class).value();
+ if (entryPointName != null && entryPointName.length() > 0)
+ {
+ log.debug("EntryPoint Name requested: " + entryPointName);
+ return ksession.getWorkingMemoryEntryPoint(ip.getAnnotated().getAnnotation(EntryPoint.class).value());
+ }
+ else
+ {
+ throw new IllegalStateException("EntryPoint must have a name.");
+ }
}
-
+
}
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeAgentProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeAgentProducer.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeAgentProducer.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -2,9 +2,7 @@
import java.util.Properties;
-import javax.enterprise.inject.Any;
import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
@@ -18,8 +16,7 @@
import org.drools.io.ResourceFactory;
import org.jboss.seam.drools.config.DroolsConfiguration;
import org.jboss.seam.drools.events.RuleResourceAddedEvent;
-import org.jboss.seam.drools.qualifiers.KAgentConfigured;
-import org.jboss.seam.drools.qualifiers.config.DroolsConfig;
+import org.jboss.seam.drools.qualifiers.Scanned;
import org.jboss.seam.drools.utils.ConfigUtils;
import org.jboss.weld.extensions.resources.ResourceProvider;
import org.slf4j.Logger;
@@ -39,10 +36,9 @@
ResourceProvider resourceProvider;
@Produces
- @KAgentConfigured
- KnowledgeBase produceAgentKBase(Instance<DroolsConfiguration> kagentConfigInstance) throws Exception
+ @Scanned
+ public KnowledgeBase produceScannedKnowledgeBase(DroolsConfiguration kagentConfig) throws Exception
{
- DroolsConfiguration kagentConfig = kagentConfigInstance.get();
ResourceFactory.getResourceChangeScannerService().configure(getResourceChangeScannerConfig(kagentConfig.getResourceChangeScannerConfigPath()));
KnowledgeAgentConfiguration aconf = getKnowledgeAgentConfiguration(kagentConfig.getKnowledgeAgentConfigPath());
@@ -61,7 +57,7 @@
}
- public void disposeAgentKBase(@Disposes @KAgentConfigured KnowledgeBase kbase) {
+ public void disposeScannedKnowledgeBase(@Disposes @Scanned KnowledgeBase kbase) {
ResourceFactory.getResourceChangeNotifierService().stop();
ResourceFactory.getResourceChangeScannerService().stop();
}
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -26,7 +26,6 @@
import org.jboss.seam.drools.config.DroolsConfiguration;
import org.jboss.seam.drools.events.KnowledgeBuilderErrorsEvent;
import org.jboss.seam.drools.events.RuleResourceAddedEvent;
-import org.jboss.seam.drools.qualifiers.KBaseConfigured;
import org.jboss.seam.drools.utils.ConfigUtils;
import org.jboss.weld.extensions.resources.ResourceProvider;
import org.slf4j.Logger;
@@ -42,14 +41,15 @@
@Inject
BeanManager manager;
+
@Inject
ResourceProvider resourceProvider;
+
@Inject
DroolsExtension droolsExtension;
@Produces
- @KBaseConfigured
- public KnowledgeBase produceKBase(DroolsConfiguration kbaseConfig) throws Exception
+ public KnowledgeBase produceKnowledgeBase(DroolsConfiguration kbaseConfig) throws Exception
{
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(getKnowledgeBuilderConfiguration(kbaseConfig.getKnowledgeBuilderConfigPath()));
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeLoggerProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeLoggerProducer.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeLoggerProducer.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1,7 +1,6 @@
package org.jboss.seam.drools;
import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
import org.drools.event.KnowledgeRuntimeEventManager;
@@ -10,8 +9,7 @@
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.StatelessKnowledgeSession;
import org.jboss.seam.drools.config.DroolsConfiguration;
-import org.jboss.seam.drools.qualifiers.KAgentConfigured;
-import org.jboss.seam.drools.qualifiers.KBaseConfigured;
+import org.jboss.seam.drools.qualifiers.Scanned;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -24,31 +22,29 @@
private static final Logger log = LoggerFactory.getLogger(KnowledgeLoggerProducer.class);
@Produces
- @KBaseConfigured
- public KnowledgeRuntimeLogger produceStatefulKnowledgeLogger(@KBaseConfigured StatefulKnowledgeSession ksession, Instance<DroolsConfiguration> loggerConfigInstance)
+ public KnowledgeRuntimeLogger produceStatefulKnowledgeLogger(StatefulKnowledgeSession ksession, DroolsConfiguration loggerConfig)
{
- return getLogger(ksession, loggerConfigInstance.get());
+ return getLogger(ksession, loggerConfig);
}
@Produces
- @KAgentConfigured
- public KnowledgeRuntimeLogger produceStatefulKnowledgeLoggerForKAgent(@KAgentConfigured StatefulKnowledgeSession ksession, Instance<DroolsConfiguration> loggerConfigInstance)
+ @Scanned
+ public KnowledgeRuntimeLogger produceScannedStatefulKnowledgeLogger(@Scanned StatefulKnowledgeSession ksession, DroolsConfiguration loggerConfig)
{
- return getLogger(ksession, loggerConfigInstance.get());
+ return getLogger(ksession, loggerConfig);
}
@Produces
- @KBaseConfigured
- public KnowledgeRuntimeLogger produceStatelessKnowledgeLogger(@KBaseConfigured StatelessKnowledgeSession ksession, Instance<DroolsConfiguration> loggerConfigInstance)
+ public KnowledgeRuntimeLogger produceStatelessKnowledgeLogger(StatelessKnowledgeSession ksession, DroolsConfiguration loggerConfig)
{
- return getLogger(ksession, loggerConfigInstance.get());
+ return getLogger(ksession, loggerConfig);
}
@Produces
- @KAgentConfigured
- public KnowledgeRuntimeLogger produceStatelessKnowledgeLoggerForKAgent(@KAgentConfigured StatelessKnowledgeSession ksession, Instance<DroolsConfiguration> loggerConfigInstance)
+ @Scanned
+ public KnowledgeRuntimeLogger produceStatelessKnowledgeLoggerForKAgent(@Scanned StatelessKnowledgeSession ksession, DroolsConfiguration loggerConfig)
{
- return getLogger(ksession, loggerConfigInstance.get());
+ return getLogger(ksession, loggerConfig);
}
private KnowledgeRuntimeLogger getLogger(KnowledgeRuntimeEventManager ksession, DroolsConfiguration loggerConfig)
@@ -75,12 +71,12 @@
return krLogger;
}
- public void disposeKBaseConfiguredKnowledgeLogger(@Disposes @KBaseConfigured KnowledgeRuntimeLogger logger)
+ public void disposeKnowledgeRuntimeLogger(@Disposes KnowledgeRuntimeLogger logger)
{
logger.close();
}
- public void disposeKAgentConfiguredKnowledgeLogger(@Disposes @KAgentConfigured KnowledgeRuntimeLogger logger) {
+ public void disposeScannedKnowledgeRuntimeLogger(@Disposes @Scanned KnowledgeRuntimeLogger logger) {
logger.close();
}
}
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -3,9 +3,7 @@
import java.util.Iterator;
import java.util.Properties;
-import javax.enterprise.inject.Any;
import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
@@ -21,8 +19,7 @@
import org.drools.runtime.StatelessKnowledgeSession;
import org.jboss.seam.drools.bootstrap.DroolsExtension;
import org.jboss.seam.drools.config.DroolsConfiguration;
-import org.jboss.seam.drools.qualifiers.KAgentConfigured;
-import org.jboss.seam.drools.qualifiers.KBaseConfigured;
+import org.jboss.seam.drools.qualifiers.Scanned;
import org.jboss.seam.drools.utils.ConfigUtils;
import org.jboss.weld.extensions.resources.ResourceProvider;
import org.slf4j.Logger;
@@ -38,14 +35,15 @@
@Inject
BeanManager manager;
+
@Inject
ResourceProvider resourceProvider;
+
@Inject
DroolsExtension droolsExtension;
@Produces
- @KBaseConfigured
- public StatefulKnowledgeSession produceStatefulSession(@KBaseConfigured KnowledgeBase kbase, @Any DroolsConfiguration ksessionConfig) throws Exception
+ public StatefulKnowledgeSession produceStatefulSession(KnowledgeBase kbase,DroolsConfiguration ksessionConfig) throws Exception
{
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(getConfig(ksessionConfig.getKnowledgeSessionConfigPath()), null);
addEventListeners(ksession);
@@ -55,8 +53,8 @@
}
@Produces
- @KAgentConfigured
- StatefulKnowledgeSession produceStatefulSessionFromKAgent(@KAgentConfigured KnowledgeBase kbase, @Any DroolsConfiguration ksessionConfig) throws Exception
+ @Scanned
+ public StatefulKnowledgeSession produceScannedStatefulSession(@Scanned KnowledgeBase kbase, DroolsConfiguration ksessionConfig) throws Exception
{
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(getConfig(ksessionConfig.getKnowledgeSessionConfigPath()), null);
addEventListeners(ksession);
@@ -66,8 +64,8 @@
}
@Produces
- @KAgentConfigured
- StatelessKnowledgeSession produceStatelessSessionFromKAgent(@KAgentConfigured KnowledgeBase kbase, @Any DroolsConfiguration ksessionConfig) throws Exception
+ @Scanned
+ public StatelessKnowledgeSession produceScannedStatelessSession(@Scanned KnowledgeBase kbase, DroolsConfiguration ksessionConfig) throws Exception
{
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession(getConfig(ksessionConfig.getKnowledgeSessionConfigPath()));
addEventListeners(ksession);
@@ -76,8 +74,7 @@
}
@Produces
- @KBaseConfigured
- public StatelessKnowledgeSession produceStatelessSession(@KBaseConfigured KnowledgeBase kbase, @Any DroolsConfiguration ksessionConfig) throws Exception
+ public StatelessKnowledgeSession produceStatelessSession(KnowledgeBase kbase, DroolsConfiguration ksessionConfig) throws Exception
{
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession(getConfig(ksessionConfig.getKnowledgeSessionConfigPath()));
addEventListeners(ksession);
@@ -85,11 +82,12 @@
return ksession;
}
- public void disposeStatefulSession(@Disposes @Any StatefulKnowledgeSession session)
+ public void disposeStatefulSession(@Disposes StatefulKnowledgeSession session)
{
session.dispose();
}
-
+
+
private KnowledgeSessionConfiguration getConfig(String knowledgeSessionConfigPath) throws Exception
{
KnowledgeSessionConfiguration droolsKsessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1,9 +1,12 @@
package org.jboss.seam.drools;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.weld.extensions.resources.ResourceProvider;
+import org.drools.runtime.StatefulKnowledgeSession;
+import org.drools.runtime.rule.QueryResults;
+import org.jboss.seam.drools.qualifiers.Query;
+import org.jboss.seam.drools.qualifiers.Scanned;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -13,10 +16,37 @@
*/
public class QueryResultsProducer
{
- private static final Logger log = LoggerFactory.getLogger(KnowledgeBaseProducer.class);
+ private static final Logger log = LoggerFactory.getLogger(QueryResultsProducer.class);
- @Inject
- BeanManager manager;
- @Inject
- ResourceProvider resourceProvider;
+ @Produces
+ @Query
+ public QueryResults produceQueryResults(StatefulKnowledgeSession ksession, InjectionPoint ip)
+ {
+ String queryName = ip.getAnnotated().getAnnotation(Query.class).value();
+ if (queryName != null && queryName.length() > 0)
+ {
+ log.debug("Query Name requested: " + queryName);
+ return ksession.getQueryResults(queryName);
+ }
+ else
+ {
+ throw new IllegalStateException("Query must have a name.");
+ }
+ }
+
+ @Produces
+ @Query
+ @Scanned
+ public QueryResults produceScannedQueryResults(@Scanned StatefulKnowledgeSession ksession, InjectionPoint ip) {
+ String queryName = ip.getAnnotated().getAnnotation(Query.class).value();
+ if (queryName != null && queryName.length() > 0)
+ {
+ log.debug("Query Name requested: " + queryName);
+ return ksession.getQueryResults(queryName);
+ }
+ else
+ {
+ throw new IllegalStateException("Query must have a name.");
+ }
+ }
}
Added: modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml (rev 0)
+++ modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml 2010-04-15 03:21:31 UTC (rev 12498)
@@ -0,0 +1,189 @@
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:d="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
+ xmlns:drools="urn:java:org.drools:org.drools.runtime">
+
+ <s:genericBean class="org.jboss.seam.drools.config.DroolsConfiguration">
+ <d:KnowledgeBaseProducer>
+ <s:specializes />
+ <d:produceKnowledgeBase>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <d:DroolsConfiguration>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </d:DroolsConfiguration>
+ </s:parameters>
+ </d:produceKnowledgeBase>
+ </d:KnowledgeBaseProducer>
+
+ <d:KnowledgeSessionProducer>
+ <s:specializes />
+ <d:produceStatefulSession>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:KnowledgeBase>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:KnowledgeBase>
+ <d:DroolsConfiguration>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </d:DroolsConfiguration>
+ </s:parameters>
+ </d:produceStatefulSession>
+ <d:disposeStatefulSession>
+ <s:parameters>
+ <drools:StatefulKnowledgeSession>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:StatefulKnowledgeSession>
+ </s:parameters>
+ </d:disposeStatefulSession>
+ <d:produceScannedStatefulSession>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:KnowledgeBase>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:KnowledgeBase>
+ <d:DroolsConfiguration>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </d:DroolsConfiguration>
+ </s:parameters>
+ </d:produceScannedStatefulSession>
+ <!--<d:disposeScannedStatefulSession>
+ <s:parameters>
+ <drools:StatefulKnowledgeSession>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:StatefulKnowledgeSession>
+ </s:parameters>
+ </d:disposeScannedStatefulSession>
+ --><d:produceStatelessSession>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:KnowledgeBase>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:KnowledgeBase>
+ <d:DroolsConfiguration>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </d:DroolsConfiguration>
+ </s:parameters>
+ </d:produceStatelessSession>
+ <d:produceScannedStatelessSession>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:KnowledgeBase>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:KnowledgeBase>
+ <d:DroolsConfiguration>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </d:DroolsConfiguration>
+ </s:parameters>
+ </d:produceScannedStatelessSession>
+ </d:KnowledgeSessionProducer>
+
+ <d:KnowledgeAgentProducer>
+ <s:specializes />
+ <d:produceScannedKnowledgeBase>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <d:DroolsConfiguration>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </d:DroolsConfiguration>
+ </s:parameters>
+ </d:produceScannedKnowledgeBase>
+ <d:disposeScannedKnowledgeBase>
+ <s:parameters>
+ <drools:KnowledgeBase>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:KnowledgeBase>
+ </s:parameters>
+ </d:disposeScannedKnowledgeBase>
+ </d:KnowledgeAgentProducer>
+
+ <d:EntryPointProducer>
+ <s:specializes />
+ <d:produceEntryPoint>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:StatefulKnowledgeSession>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:StatefulKnowledgeSession>
+ </s:parameters>
+ </d:produceEntryPoint>
+ <d:produceScannedEntryPoint>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:StatefulKnowledgeSession>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:StatefulKnowledgeSession>
+ </s:parameters>
+ </d:produceScannedEntryPoint>
+ </d:EntryPointProducer>
+
+ <d:KnowledgeLoggerProducer>
+ <s:specializes />
+ <d:produceStatefulKnowledgeLogger>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:StatefulKnowledgeSession>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:StatefulKnowledgeSession>
+ <d:DroolsConfiguration>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </d:DroolsConfiguration>
+ </s:parameters>
+ </d:produceStatefulKnowledgeLogger>
+ <d:produceScannedStatefulKnowledgeLogger>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:StatefulKnowledgeSession>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:StatefulKnowledgeSession>
+ <d:DroolsConfiguration>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </d:DroolsConfiguration>
+ </s:parameters>
+ </d:produceScannedStatefulKnowledgeLogger>
+ </d:KnowledgeLoggerProducer>
+
+ <d:QueryResultsProducer>
+ <s:specializes />
+ <d:produceQueryResults>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:StatefulKnowledgeSession>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:StatefulKnowledgeSession>
+ </s:parameters>
+ </d:produceQueryResults>
+ <d:produceScannedQueryResults>
+ <s:ApplyQualifiers />
+ <s:parameters>
+ <drools:StatefulKnowledgeSession>
+ <s:Inject />
+ <s:ApplyQualifiers />
+ </drools:StatefulKnowledgeSession>
+ </s:parameters>
+ </d:produceScannedQueryResults>
+ </d:QueryResultsProducer>
+
+ </s:genericBean>
+
+</beans>
\ No newline at end of file
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -9,8 +9,6 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.drools.KnowledgeBaseProducer;
-import org.jboss.seam.drools.config.DroolsConfiguration;
-import org.jboss.seam.drools.qualifiers.KBaseConfigured;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.Archives;
import org.jboss.shrinkwrap.api.formatter.Formatters;
@@ -29,7 +27,7 @@
JavaArchive archive = Archives.create("test.jar", JavaArchive.class)
.addPackages(true, new KBaseTestFilter(), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
- .addClass(KBaseTestQualifier.class)
+ .addClass(KBaseTestRules.class)
.addClass(MyKnowledgeBaseEventListener.class)
.addResource(pkgPath + "/kbasetest.drl", ArchivePaths.create("kbasetest.drl"))
.addResource(pkgPath + "/kbuilderconfig.properties", ArchivePaths.create("kbuilderconfig.properties"))
@@ -39,44 +37,12 @@
return archive;
}
- @Inject
- @KBaseTestQualifier
- DroolsConfiguration config;
+ @Inject @KBaseTestRules KnowledgeBase kbase;
- @Inject
- @KBaseTestQualifier
- @KBaseConfigured
- KnowledgeBase kbase;
-
@Test
- public void testKBaseConfig()
- {
- // Assert.assertFalse(kbaseConfigResolver.select(new
- // KBaseConfigBinding("kbaseconfig1")).isUnsatisfied());
- // KnowledgeBaseConfig kbaseConfig = kbaseConfigResolver.select(new
- // KBaseConfigBinding("kbaseconfig1")).get();
- assertNotNull(config);
- System.out.println("\n\n\n**** " + config.toString() + "********\n\n\n");
- }
-
- @Test
public void testKBase()
{
assertNotNull(kbase);
assertTrue(kbase.getKnowledgePackage("org.jboss.seam.drools.test.kbase").getRules().size() == 3);
}
-
- // static class KBaseConfigBinding extends AnnotationLiteral<ForKBaseTest>
- // implements KBaseConfig
- // {
- // private String value = null;
- // public KBaseConfigBinding(String value)
- // {
- // this.value = value;
- // }
- //
- // public String value() {
- // return value;
- // }
- // }
}
Deleted: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestQualifier.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestQualifier.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestQualifier.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1,25 +0,0 @@
-package org.jboss.seam.drools.test.kbase;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
- at Qualifier
- at Target( { TYPE, METHOD, FIELD, PARAMETER })
- at Documented
- at Retention(RUNTIME)
- at Inherited
-public @interface KBaseTestQualifier
-{
-
-}
Copied: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestRules.java (from rev 12495, modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestQualifier.java)
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestRules.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestRules.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -0,0 +1,24 @@
+package org.jboss.seam.drools.test.kbase;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+ at Qualifier
+ at Target( { TYPE, METHOD, FIELD, PARAMETER })
+ at Documented
+ at Retention(RUNTIME)
+ at Inherited
+public @interface KBaseTestRules
+{
+
+}
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -9,7 +9,6 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.drools.KnowledgeBaseProducer;
-import org.jboss.seam.drools.qualifiers.KBaseConfigured;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.Archives;
import org.jboss.shrinkwrap.api.formatter.Formatters;
@@ -28,7 +27,7 @@
JavaArchive archive = Archives.create("test.jar", JavaArchive.class)
.addPackages(true, new KSessionTestFiler(), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
- .addClass(KSessionTestQualifier.class)
+ .addClass(KSessionTestRules.class)
.addResource(pkgPath + "/ksessiontest.drl", ArchivePaths.create("ksessiontest.drl"))
.addResource(pkgPath + "/kbuilderconfig.properties", ArchivePaths.create("kbuilderconfig.properties"))
.addResource(pkgPath + "/kbaseconfig.properties", ArchivePaths.create("kbaseconfig.properties"))
@@ -37,14 +36,12 @@
return archive;
}
- @Inject
- @KSessionTestQualifier
- @KBaseConfigured
- StatefulKnowledgeSession ksession;
+ @Inject @KSessionTestRules StatefulKnowledgeSession ksession;
@Test
public void testKSession()
{
assertNotNull(ksession);
+ assertTrue(ksession.getId() >= 0);
}
}
Deleted: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestQualifier.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestQualifier.java 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestQualifier.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1,24 +0,0 @@
-package org.jboss.seam.drools.test.ksession;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
- at Qualifier
- at Target( { TYPE, METHOD, FIELD, PARAMETER })
- at Documented
- at Retention(RUNTIME)
- at Inherited
-public @interface KSessionTestQualifier
-{
-
-}
Copied: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestRules.java (from rev 12495, modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestQualifier.java)
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestRules.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestRules.java 2010-04-15 03:21:31 UTC (rev 12498)
@@ -0,0 +1,24 @@
+package org.jboss.seam.drools.test.ksession;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+ at Qualifier
+ at Target( { TYPE, METHOD, FIELD, PARAMETER })
+ at Documented
+ at Retention(RUNTIME)
+ at Inherited
+public @interface KSessionTestRules
+{
+
+}
Modified: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/kbase/KBaseTest-beans.xml
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/kbase/KBaseTest-beans.xml 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/kbase/KBaseTest-beans.xml 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1,44 +1,16 @@
-<beans xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:s="urn:java:seam:core"
- xmlns:drools="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
- xmlns:test="urn:java:org.jboss.seam.drools.test.kbase">
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:d="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
+ xmlns:test="urn:java:org.jboss.seam.drools.test.kbase">
- <drools:DroolsConfiguration>
- <s:overrides/>
- <test:KBaseTestQualifier/>
- <drools:knowledgeBuilderConfigPath>kbuilderconfig.properties</drools:knowledgeBuilderConfigPath>
- <drools:knowledgeBaseConfigPath>kbaseconfig.properties</drools:knowledgeBaseConfigPath>
- <drools:ruleResources>
- <s:value>classpath;kbasetest.drl;DRL;forkbasetest</s:value>
- </drools:ruleResources>
- </drools:DroolsConfiguration>
- <drools:KnowledgeBaseProducer>
- <s:specializes/>
- <drools:produceKBase>
- <test:KBaseTestQualifier/>
- <s:parameters>
- <drools:DroolsConfiguration>
- <s:Inject/>
- <test:KBaseTestQualifier/>
- </drools:DroolsConfiguration>
- </s:parameters>
- </drools:produceKBase>
- </drools:KnowledgeBaseProducer>
-
- <!--
- WITH LATEST WELD-EXTENSION AND Instance<XYZ> zyx param in producer!
- <drools:KnowledgeBaseProducer>
- <s:specializes/>
- <drools:produceKBase>
- <test:KBaseTestQualifier/>
- <s:parameters>
- <s:Instance>
- <s:Inject/>
- <test:KBaseTestQualifier/>
- </s:Instance>
- </s:parameters>
- </drools:produceKBase>
- </drools:KnowledgeBaseProducer> -->
+ <d:DroolsConfiguration>
+ <test:KBaseTestRules />
+ <d:knowledgeBuilderConfigPath>kbuilderconfig.properties</d:knowledgeBuilderConfigPath>
+ <d:knowledgeBaseConfigPath>kbaseconfig.properties</d:knowledgeBaseConfigPath>
+ <d:ruleResources>
+ <s:value>classpath;kbasetest.drl;DRL;forkbasetest</s:value>
+ </d:ruleResources>
+ </d:DroolsConfiguration>
+
</beans>
Modified: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/KSessionTest-beans.xml
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/KSessionTest-beans.xml 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/KSessionTest-beans.xml 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1,47 +1,16 @@
-<beans xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:s="urn:java:seam:core"
- xmlns:d="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
- xmlns:drools="urn:java:org.drools:org.drools.runtime"
- xmlns:test="urn:java:org.jboss.seam.drools.test.ksession">
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:d="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
+ xmlns:test="urn:java:org.jboss.seam.drools.test.ksession">
- <d:DroolsConfiguration>
- <s:overrides/>
- <test:KSessionTestQualifier/>
- <d:knowledgeBuilderConfigPath>kbuilderconfig.properties</d:knowledgeBuilderConfigPath>
- <d:knowledgeBaseConfigPath>kbaseconfig.properties</d:knowledgeBaseConfigPath>
- <d:ruleResources>
- <s:value>classpath;ksessiontest.drl;DRL</s:value>
- </d:ruleResources>
- </d:DroolsConfiguration>
-
- <d:KnowledgeBaseProducer>
- <s:specializes/>
- <d:produceKBase>
- <test:KSessionTestQualifier/>
- <s:parameters>
- <d:DroolsConfiguration>
- <s:Inject/>
- <test:KSessionTestQualifier/>
- </d:DroolsConfiguration>
- </s:parameters>
- </d:produceKBase>
- </d:KnowledgeBaseProducer>
-
- <d:KnowledgeSessionProducer>
- <s:specializes/>
- <d:produceStatefulSession>
- <test:KSessionTestQualifier/>
- <s:parameters>
- <drools:KnowledgeBase>
- <s:Inject/>
- <test:KSessionTestQualifier/>
- </drools:KnowledgeBase>
- <d:DroolsConfiguration>
- <s:Inject/>
- <test:KSessionTestQualifier/>
- </d:DroolsConfiguration>
- </s:parameters>
- </d:produceStatefulSession>
- </d:KnowledgeSessionProducer>
+ <d:DroolsConfiguration>
+ <test:KSessionTestRules />
+ <d:knowledgeBuilderConfigPath>kbuilderconfig.properties
+ </d:knowledgeBuilderConfigPath>
+ <d:knowledgeBaseConfigPath>kbaseconfig.properties
+ </d:knowledgeBaseConfigPath>
+ <d:ruleResources>
+ <s:value>classpath;ksessiontest.drl;DRL</s:value>
+ </d:ruleResources>
+ </d:DroolsConfiguration>
</beans>
Modified: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/ksessiontest.drl
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/ksessiontest.drl 2010-04-14 21:59:36 UTC (rev 12497)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/ksessiontest.drl 2010-04-15 03:21:31 UTC (rev 12498)
@@ -1 +1,6 @@
package org.jboss.seam.drools.test.ksession
+
+rule dummy
+then
+ System.out.println("hello");
+end
\ No newline at end of file
More information about the seam-commits
mailing list