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

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Dec 9 12:46:30 EST 2008


Author: mark.proctor at jboss.com
Date: 2008-12-09 12:46:30 -0500 (Tue, 09 Dec 2008)
New Revision: 24322

Added:
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/package.html
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/logger/package.html
Modified:
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgent.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgentConfiguration.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgentFactory.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/builder/ProcessBuilder.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/builder/RuleBuilder.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/KnowledgeDefinition.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/KnowledgePackage.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/Resource.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ClassObjectFilter.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/GlobalParams.java
   labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ObjectFilter.java
Log:
-some more javadoc improvements

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgent.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgent.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgent.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -18,7 +18,8 @@
  * <p>
  * The Follow example constructs an agent that will build a new KnowledgeBase from the files specified in the path String.
  * It will poll those files every 30 seconds to see if they are updated. If new files are found it will construct a new 
- * KnowledgeBase, instead of upating the existing one, due to the "newInstance" set to "true":
+ * KnowledgeBase, instead of updating the existing one, due to the "newInstance" set to "true" (however currently only the value of
+ * "true" is supported and is hard coded into the engine):
  * <p/>
  * <pre>
  * // Set the interval on the ResourceChangeScannerService if you are to use it and default of 60s is not desirable.
@@ -44,10 +45,11 @@
  * 
  * KnowledgeAgents can take a empty KnowledgeBase or a populated one. If a populated KnowledgeBase is provided, the KnowledgeAgent
  * will iterate KnowledgeBase and subscribe to the Resource that it finds. While it is possible for the KnowledgeBuilder to build
- * all resources found in a directory, that information is lost by the KnowledgeBuilder so those directories will not be continously scanned.
+ * all resources found in a directory, that information is lost by the KnowledgeBuilder so those directories will not be continuously scanned.
  * Only directories specified as part of the applyChangeSet(Resource) method are monitored.
  * 
  * @see org.drools.agent.KnowledgeAgentFactory
+ * @see org.drools.agent.KnowledgeAgentConfiguration
  * 
  */
 public interface KnowledgeAgent {

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgentConfiguration.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgentConfiguration.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgentConfiguration.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -5,9 +5,11 @@
 /**
  * drools.agent.scanResources = <true|false>
  * drools.agent.scanDirectories = <true|false>
- * drools.agent.newInstance = <true|false>
+ * drools.agent.newInstance = <true|false> // currently this is hard coded to true
  * drools.agent.monitorChangeSetEvents = <true|false>
  *
+ * @see org.drools.agent.KnowledgeAgent
+ * @see org.drools.agent.KnowledgeAgentConfiguration 
  */
 public interface KnowledgeAgentConfiguration extends PropertiesConfiguration {
 

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgentFactory.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgentFactory.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/agent/KnowledgeAgentFactory.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -3,11 +3,53 @@
 import java.util.Properties;
 
 import org.drools.KnowledgeBase;
-import org.drools.KnowledgeBaseConfiguration;
-import org.drools.SystemEventListener;
 import org.drools.ProviderInitializationException;
 
-
+/**
+ * <p>
+ * The KnowlegeAgent is created by the KnowlegeAgentFactory. It's role is to provide a cached
+ * KnowlegeBase and to update or rebuild this KnowlegeBase as the resources it uses are changed.
+ * The strategy for this is determined by the configuration given to the factory, but it is 
+ * typically pull based using regular polling. We hope to add push based updates and rebuilds in future
+ * versions.
+ * </p>
+ * <p>
+ * The Follow example constructs an agent that will build a new KnowledgeBase from the files specified in the path String.
+ * It will poll those files every 30 seconds to see if they are updated. If new files are found it will construct a new 
+ * KnowledgeBase, instead of updating the existing one, due to the "newInstance" set to "true" (however currently only the value of
+ * "true" is supported and is hard coded into the engine):
+ * <p/>
+ * <pre>
+ * // Set the interval on the ResourceChangeScannerService if you are to use it and default of 60s is not desirable.
+ * ResourceChangeScannerConfiguration sconf = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
+ * sconf.setProperty( "drools.resource.scanner.interval",
+ *                    "30" ); // set the disk scanning interval to 30s, default is 60s
+ * ResourceFactory.getResourceChangeScannerService().configure( sconf );
+ * 
+ * KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
+ *
+ * KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
+ *       aconf.setProperty( "drools.agent.scanDirectories",
+ *                          "true" ); // we want to scan directories, not just files, turning this on turns on file scanning
+ *       aconf.setProperty( "drools.agent.newInstance",
+ *                          "true" ); // resource changes results in a new instance of the KnowledgeBase being built, 
+ *                                    // this cannot currently be set to false for incremental building
+ *       
+ *       KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "test agent", // the name of the agent
+ *                                                                        kbase, // the rulebase to use, the Agent will also monitor any exist knowledge definitions
+ *                                                                        aconf );
+ *       kagent.applyChangeSet( ResourceFactory.newUrlResource( url ) ); // resource to the change-set xml for the resources to add
+ * </pre>
+ * 
+ * KnowledgeAgents can take a empty KnowledgeBase or a populated one. If a populated KnowledgeBase is provided, the KnowledgeAgent
+ * will iterate KnowledgeBase and subscribe to the Resource that it finds. While it is possible for the KnowledgeBuilder to build
+ * all resources found in a directory, that information is lost by the KnowledgeBuilder so those directories will not be continuously scanned.
+ * Only directories specified as part of the applyChangeSet(Resource) method are monitored.
+ * 
+ * @see org.drools.agent.KnowledgeAgent
+ * @see org.drools.agent.KnowledgeAgentConfiguration
+ * 
+ */
 public class KnowledgeAgentFactory {
     private static KnowledgeAgentProvider provider;
     

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/builder/ProcessBuilder.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/builder/ProcessBuilder.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/builder/ProcessBuilder.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -1,5 +1,9 @@
 package org.drools.builder;
 
+/**
+ * This is a mixin style interface who's role is to provide process specific methods to the KnowledgeBuilder, currently there are none.
+ *
+ */
 public interface ProcessBuilder {
 
 }

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/builder/RuleBuilder.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/builder/RuleBuilder.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/builder/RuleBuilder.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -1,5 +1,9 @@
 package org.drools.builder;
 
+/**
+ * This is a mixin style interface who's role is to provide rule specific methods to the KnowledgeBuilder, currently there are none.
+ *
+ */
 public interface RuleBuilder {
 
 }

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/KnowledgeDefinition.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/KnowledgeDefinition.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/KnowledgeDefinition.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -1,5 +1,9 @@
 package org.drools.definition;
 
+/**
+ * Marker interface for all KnowlegeDefinition's
+ *
+ */
 public interface KnowledgeDefinition {
 
 }

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/KnowledgePackage.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/KnowledgePackage.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/definition/KnowledgePackage.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -7,7 +7,7 @@
 
 /**
  * This provides a collection of knowledge definitions that can be given to a KnowledgeBase.
- * The name is used to provide "namespace" spearation of those definitions.
+ * The name is used to provide "namespace" separation of those definitions.
  * 
  *
  */

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 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/Resource.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -6,7 +6,7 @@
 
 /**
  * <p>
- * Generic interface to provide a Reader or Input stream for the underlying IO resource.
+ * Generic interface to provide a Reader or InputStream for the underlying IO resource.
  * </p>
  */
 public interface Resource {

Added: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/package.html
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/package.html	                        (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/io/package.html	2008-12-09 17:46:30 UTC (rev 24322)
@@ -0,0 +1,3 @@
+<body>
+	The builder package is responsible for building knowledge difinitions from artifact resources.
+</body>
\ No newline at end of file

Added: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/logger/package.html
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/logger/package.html	                        (rev 0)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/logger/package.html	2008-12-09 17:46:30 UTC (rev 24322)
@@ -0,0 +1,3 @@
+<body>
+	Logger classes use to log the KnowledgeRuntime's execution.
+</body>
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ClassObjectFilter.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ClassObjectFilter.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ClassObjectFilter.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -2,7 +2,6 @@
 
 /**
  * Filters Objects by Class, only accepting Classes of the specified type
- * @author mproctor
  *
  */
 public class ClassObjectFilter

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/GlobalParams.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/GlobalParams.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/GlobalParams.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -4,8 +4,6 @@
 import java.util.Map;
 
 /**
- * 
- * @author mproctor
  *
  */
 public interface GlobalParams {

Modified: labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ObjectFilter.java
===================================================================
--- labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ObjectFilter.java	2008-12-09 17:18:37 UTC (rev 24321)
+++ labs/jbossrules/trunk/drools-api/src/main/java/org/drools/runtime/ObjectFilter.java	2008-12-09 17:46:30 UTC (rev 24322)
@@ -2,7 +2,6 @@
 
 /**
  * ObjectFilter is used with WorkingMemories to filter out instances during Iteration
- * @author mproctor
  *
  */
 public interface ObjectFilter {




More information about the jboss-svn-commits mailing list