[jboss-svn-commits] JBL Code SVN: r24317 - in labs/jbossrules/trunk: drools-api/src/main/java/org/drools/io and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Dec 9 05:32:30 EST 2008
Author: Rikkola
Date: 2008-12-09 05:32:29 -0500 (Tue, 09 Dec 2008)
New Revision: 24317
Added:
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/event/rule/DebugAgendaEventListener.java
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/event/rule/DebugWorkingMemoryEventListener.java
Modified:
labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/Resource.java
labs/jbossrules/trunk/drools-examples/drools-examples-drl/src/main/java/org/drools/examples/HelloWorldExample.java
Log:
Added DebugAgendaEventListner and DebugWorkingMemoryEventListner.
Added: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/event/rule/DebugAgendaEventListener.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/event/rule/DebugAgendaEventListener.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/event/rule/DebugAgendaEventListener.java 2008-12-09 10:32:29 UTC (rev 24317)
@@ -0,0 +1,31 @@
+package org.drools.event.rule;
+
+public class DebugAgendaEventListener
+ implements
+ AgendaEventListener {
+
+ public void activationCancelled(ActivationCancelledEvent event) {
+ System.err.println( event );
+ }
+
+ public void activationCreated(ActivationCreatedEvent event) {
+ System.err.println( event );
+ }
+
+ public void afterActivationFired(AfterActivationFiredEvent event) {
+ System.err.println( event );
+ }
+
+ public void agendaGroupPopped(AgendaGroupPoppedEvent event) {
+ System.err.println( event );
+ }
+
+ public void agendaGroupPushed(AgendaGroupPushedEvent event) {
+ System.err.println( event );
+ }
+
+ public void beforeActivationFired(BeforeActivationFiredEvent event) {
+ System.err.println( event );
+ }
+
+}
Added: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/event/rule/DebugWorkingMemoryEventListener.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/event/rule/DebugWorkingMemoryEventListener.java (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/event/rule/DebugWorkingMemoryEventListener.java 2008-12-09 10:32:29 UTC (rev 24317)
@@ -0,0 +1,19 @@
+package org.drools.event.rule;
+
+public class DebugWorkingMemoryEventListener
+ implements
+ WorkingMemoryEventListener {
+
+ public void objectInserted(ObjectInsertedEvent event) {
+ System.err.println( event );
+ }
+
+ public void objectRetracted(ObjectRetractedEvent event) {
+ System.err.println( event );
+ }
+
+ public void objectUpdated(ObjectUpdatedEvent event) {
+ System.err.println( event );
+ }
+
+}
Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/Resource.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/Resource.java 2008-12-09 08:52:09 UTC (rev 24316)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/Resource.java 2008-12-09 10:32:29 UTC (rev 24317)
@@ -11,7 +11,7 @@
*/
public interface Resource {
/**
- * Open an InputStream to the resource, the user most close this when finished.
+ * Open an InputStream to the resource, the user must close this when finished.
*
* @return
* @throws IOException
Modified: labs/jbossrules/trunk/drools-examples/drools-examples-drl/src/main/java/org/drools/examples/HelloWorldExample.java
===================================================================
--- labs/jbossrules/trunk/drools-examples/drools-examples-drl/src/main/java/org/drools/examples/HelloWorldExample.java 2008-12-09 08:52:09 UTC (rev 24316)
+++ labs/jbossrules/trunk/drools-examples/drools-examples-drl/src/main/java/org/drools/examples/HelloWorldExample.java 2008-12-09 10:32:29 UTC (rev 24317)
@@ -10,6 +10,8 @@
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.definition.KnowledgePackage;
+import org.drools.event.rule.DebugAgendaEventListener;
+import org.drools.event.rule.DebugWorkingMemoryEventListener;
import org.drools.io.ResourceFactory;
import org.drools.logger.KnowledgeRuntimeLogger;
import org.drools.logger.KnowledgeRuntimeLoggerFactory;
@@ -46,13 +48,13 @@
.newStatefulKnowledgeSession();
ksession.setGlobal("list", new ArrayList<Object>());
- // ksession.addEventListener( new DebugAgendaEventListener() );
- // ksession.addEventListener( new DebugWorkingMemoryEventListener() );
+ ksession.addEventListener(new DebugAgendaEventListener());
+ ksession.addEventListener(new DebugWorkingMemoryEventListener());
// setup the audit logging
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory
.newFileLogger(ksession, "log/helloworld");
-
+
final Message message = new Message();
message.setMessage("Hello World");
message.setStatus(Message.HELLO);
More information about the jboss-svn-commits
mailing list