You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(233) |
Sep
(199) |
Oct
(206) |
Nov
(185) |
Dec
(270) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(232) |
Feb
(426) |
Mar
(623) |
Apr
(592) |
May
(506) |
Jun
(389) |
Jul
(160) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
| 2007 |
Jan
(1) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(5) |
Oct
(9) |
Nov
(6) |
Dec
(6) |
| 2008 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(2) |
Sep
(12) |
Oct
(10) |
Nov
(54) |
Dec
(49) |
| 2009 |
Jan
(19) |
Feb
(13) |
Mar
(20) |
Apr
(24) |
May
(44) |
Jun
(29) |
Jul
(32) |
Aug
(10) |
Sep
(7) |
Oct
(10) |
Nov
(4) |
Dec
(17) |
| 2010 |
Jan
(14) |
Feb
(5) |
Mar
(23) |
Apr
(50) |
May
(31) |
Jun
(9) |
Jul
(5) |
Aug
(4) |
Sep
(7) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
| 2011 |
Jan
(12) |
Feb
(5) |
Mar
(5) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2012 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jbo...@li...> - 2006-06-01 04:03:22
|
Author: dam...@jb... Date: 2006-06-01 00:03:18 -0400 (Thu, 01 Jun 2006) New Revision: 4539 Added: labs/jbosslabs/tags/Labs-Portal-2.0-ComTheme-06.01.06/ Log: Tagging for the 06.01.06 Labs promote. Copied: labs/jbosslabs/tags/Labs-Portal-2.0-ComTheme-06.01.06 (from rev 4538, labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme) |
|
From: <jbo...@li...> - 2006-06-01 03:42:25
|
Author: mic...@jb... Date: 2006-05-31 23:42:17 -0400 (Wed, 31 May 2006) New Revision: 4538 Modified: labs/jbossrules/trunk/documentation/training/developers-course/Module 1 - Introduction.odp Log: module 1 finished Modified: labs/jbossrules/trunk/documentation/training/developers-course/Module 1 - Introduction.odp =================================================================== (Binary files differ) |
Author: dam...@jb... Date: 2006-05-31 21:42:02 -0400 (Wed, 31 May 2006) New Revision: 4537 Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-ear/src/META-INF/application.xml labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/server/kosmos-services-servlet.xml labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/server/web.xml labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/maven.xml labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-wiki/src/etc/org/jboss/wiki/filedatasource.properties Log: MERGED: -r 4359:4362 https://svn.labs.jboss.org/labs/jbosslabs/tags/Labs-Portal-2.0-ComTheme-05.23.06 . for the 06-01-2006 promote. Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-ear/src/META-INF/application.xml =================================================================== --- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-ear/src/META-INF/application.xml 2006-06-01 00:14:24 UTC (rev 4536) +++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-ear/src/META-INF/application.xml 2006-06-01 01:42:02 UTC (rev 4537) @@ -13,11 +13,12 @@ <web-uri>blog-portlet.war</web-uri> </web> </module> + <!-- DIE KOSMOS DIE <module> <web> <web-uri>kosmos-portlet.war</web-uri> </web> - </module> + </module>--> <module> <web> <web-uri>primates-portlet.war</web-uri> @@ -28,11 +29,12 @@ <web-uri>polls-portlet.war</web-uri> </web> </module> + <!-- DIE KOSMOS DIE <module> <web> <web-uri>kosmos-server.war</web-uri> </web> - </module> + </module>--> <module> <web> <web-uri>federation-register.war</web-uri> Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml =================================================================== --- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml 2006-06-01 00:14:24 UTC (rev 4536) +++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/portlet/portlet.xml 2006-06-01 01:42:02 UTC (rev 4537) @@ -11,7 +11,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8080/kosmos-server/kosmos-services/jira-service</value> + <value>http://labs.jboss.com:8080/kosmos-server/kosmos-services/jira-service</value> </init-param> <init-param> <name>monitored.urls</name> @@ -72,7 +72,7 @@ </init-param> <init-param> <name>service.url</name> - <value>http://localhost:8080/kosmos-server/kosmos-services/svn-service</value> + <value>http://labs.jboss.com:8080/kosmos-server/kosmos-services/svn-service</value> </init-param> <init-param> <name>monitored.urls</name> Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/server/kosmos-services-servlet.xml =================================================================== --- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/server/kosmos-services-servlet.xml 2006-06-01 00:14:24 UTC (rev 4536) +++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/server/kosmos-services-servlet.xml 2006-06-01 01:42:02 UTC (rev 4537) @@ -4,7 +4,7 @@ <beans> <!-- CC service --> <bean id="ccService" class="hu.midori.kosmos.server.cc.CcServiceImpl"> - <property name="store" ref="labsCachedDataStore"/> + <property name="store" ref="shotokuCachedDataStore"/> </bean> <bean name="/cc-service" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service" ref="ccService"/> @@ -13,7 +13,7 @@ <!-- JIRA service --> <bean id="jiraService" class="hu.midori.kosmos.server.jira.JiraServiceImpl"> - <property name="store" ref="labsCachedDataStore"/> + <property name="store" ref="shotokuCachedDataStore"/> </bean> <bean name="/jira-service" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service" ref="jiraService"/> @@ -22,7 +22,7 @@ <!-- SF service --> <bean id="sfService" class="hu.midori.kosmos.server.sf.SfServiceImpl"> - <property name="store" ref="labsCachedDataStore"/> + <property name="store" ref="shotokuCachedDataStore"/> </bean> <bean name="/sf-service" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service" ref="sfService"/> @@ -31,15 +31,16 @@ <!-- SVN service --> <bean id="svnService" class="hu.midori.kosmos.server.svn.SvnServiceImpl"> - <property name="store" ref="labsCachedDataStore"/> + <property name="store" ref="shotokuCachedDataStore"/> </bean> <bean name="/svn-service" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service" ref="svnService"/> <property name="serviceInterface" value="hu.midori.kosmos.protocol.SvnService"/> </bean> - <!-- Labs cached data store --> - <bean id="labsCachedDataStore" class="org.jboss.kosmos.LabsCachedDataStore"> - </bean> - + <!-- Shotoku cached data store --> + <bean id="shotokuCachedDataStore" class="org.jboss.kosmos.ShotokuCachedDataStore"> + <property name="fileAccessUrl" value="http://localhost:8080/file-access"/> + <property name="prefix" value="kosmos/images/kosmos-cache"/> + </bean> </beans> \ No newline at end of file Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/server/web.xml =================================================================== --- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/server/web.xml 2006-06-01 00:14:24 UTC (rev 4536) +++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/conf/server/web.xml 2006-06-01 01:42:02 UTC (rev 4537) @@ -10,7 +10,7 @@ <context-param> <param-name>webdav.url</param-name> - <param-value>https://labs-stats:jbo...@cm.../trunk/forge/portal-content/kosmos/images</param-value> + <param-value>https://labs-stats:jbo...@cm.../prod/forge/portal-content/kosmos/images</param-value> </context-param> <context-param> <param-name>webdav.user</param-name> Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/maven.xml =================================================================== --- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/maven.xml 2006-06-01 00:14:24 UTC (rev 4536) +++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-kosmos/maven.xml 2006-06-01 01:42:02 UTC (rev 4537) @@ -13,15 +13,18 @@ </goal> <goal name="build"> - <attainGoal name="java:compile" /> + <!-- DIE KOSMOS DIE + <attainGoal name="java:compile" /> --> </goal> <goal name="deploy"> <!-- Unzipping the jar-s --> + + <!-- DIE KOSMOS DIE <ant:unzip src="to-copy/kosmos-server.war" dest="target/kosmos-server.war" overwrite="true" /> - <ant:unzip src="to-copy/kosmos-portlet.war" dest="target/kosmos-portlet.war" overwrite="true" /> + <ant:unzip src="to-copy/kosmos-portlet.war" dest="target/kosmos-portlet.war" overwrite="true" /> --> - <!-- Copying configuration files --> + <!-- Copying configuration files DIE KOSMOS DIE <ant:copy todir="target/kosmos-server.war/WEB-INF" overwrite="true"> <ant:fileset dir="conf/server"> <ant:filename name="**/*" /> @@ -31,24 +34,25 @@ <ant:fileset dir="conf/portlet"> <ant:filename name="**/*" /> </ant:fileset> - </ant:copy> + </ant:copy> --> - <!-- Copying cache class --> + <!-- Copying cache class DIE KOSMOS DIE <ant:copy todir="target/kosmos-server.war/WEB-INF/classes" overwrite="true"> <ant:fileset dir="target/classes"> <ant:filename name="**/*" /> </ant:fileset> - </ant:copy> + </ant:copy> --> - <!-- Deleting old deployment --> + <!-- Deleting old deployment DIE KOSMOS DIE <ant:delete dir="${local.deploy.dir}/kosmos-server.war" /> <ant:delete dir="${local.deploy.dir}/kosmos-portlet.war" /> - - <!-- Deploying new packages --> + --> + + <!-- Deploying new packages DIE KOSMOS DIE <ant:copy todir="../${forge.ear.dir}/target/${forge.ear.name}" overwrite="true"> <ant:fileset dir="target"> <ant:filename name="kosmos*/**" /> </ant:fileset> - </ant:copy> + </ant:copy>--> </goal> </project> Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-wiki/src/etc/org/jboss/wiki/filedatasource.properties =================================================================== --- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-wiki/src/etc/org/jboss/wiki/filedatasource.properties 2006-06-01 00:14:24 UTC (rev 4536) +++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-wiki/src/etc/org/jboss/wiki/filedatasource.properties 2006-06-01 01:42:02 UTC (rev 4537) @@ -1,7 +1,7 @@ # FileDataSource configuration file # pathToMedia - points, where JSPWiki file structure is situated -pathToMedia = /usr/local/forge/wiki +pathToMedia = /services/jbf-portal/wiki # pathToAttachements - points, where JSPWiki attachemets are situated -pathToAttachements = /usr/local/forge/wiki \ No newline at end of file +pathToAttachements = /services/jbf-portal/wiki |
|
From: <jbo...@li...> - 2006-05-31 21:51:32
|
Author: jfr...@jb...
Date: 2006-05-31 17:51:27 -0400 (Wed, 31 May 2006)
New Revision: 4535
Modified:
labs/jbossweb/trunk/src/share/classes/org/apache/catalina/servlets/php/ScriptEnvironment.java
Log:
Fill the environmnent variables with the SSL information.
Modified: labs/jbossweb/trunk/src/share/classes/org/apache/catalina/servlets/php/ScriptEnvironment.java
===================================================================
--- labs/jbossweb/trunk/src/share/classes/org/apache/catalina/servlets/php/ScriptEnvironment.java 2006-05-31 20:49:43 UTC (rev 4534)
+++ labs/jbossweb/trunk/src/share/classes/org/apache/catalina/servlets/php/ScriptEnvironment.java 2006-05-31 21:51:27 UTC (rev 4535)
@@ -58,7 +58,7 @@
* The Request attribute key for the client certificate chain.
*/
private static final String CERTIFICATE_KEY = "javax.servlet.request.X509Certificate";
- private static final String CIPHER_SUITE = "javax.servlet.request.cipher_suite"
+ private static final String CIPHER_SUITE = "javax.servlet.request.cipher_suite";
private static final String SSL_SESSION = "javax.servlet.request.ssl_session";
private static final String KEY_SIZE = "javax.servlet.request.key_size";
@@ -497,14 +497,46 @@
if (req.isSecure()) {
envp.put("HTTPS", "ON");
+ envp.put("SSL_CIPHER", req.getAttribute(CIPHER_SUITE));
+ envp.put("SSL_SESSION_ID", req.getAttribute(SSL_SESSION));
+ envp.put("SSL_CIPHER_USEKEYSIZE", req.getAttribute(KEY_SIZE));
X509Certificate[] certs =
(X509Certificate[])req.getAttribute(CERTIFICATE_KEY);
if (certs != null) {
- for (int c = 0; c < certs.length; c++) {
- envp.put("CERT_ISSUER",
- nullsToBlanks(certs[c].getIssuerX500Principal().getName()));
- // TODO: Add more HTTPS params.
+ // Well use the first, normaly the client certificate.
+ envp.put("SSL_SERVER_V_START", certs[0].getNotAfter().toString());
+ envp.put("SSL_SERVER_V_END", certs[0].getNotBefore().toString());
+
+ envp.put("SSL_CLIENT_A_KEY", certs[0].getSigAlgName());
+
+ // Oops getEncoded gives a DER not PEM encoded ... envp.put("SSL_CLIENT_CERT", certs[0].getEncoded());
+
+ envp.put("SSL_SERVER_M_SERIAL", certs[0].getSerialNumber().toString());
+ envp.put("SSL_SERVER_M_VERSION", String.valueOf(certs[0].getVersion()));
+
+ // Subject
+ envp.put("SSL_CLIENT_S_DN", certs[0].getSubjectX500Principal().getName());
+ // To fill the elements C,ST... Email
+ String pr = certs[0].getSubjectX500Principal().getName();
+ String prs[] = pr.split(", ");
+ for (int c = 0; c < prs.length; c++) {
+ String pprs[] = prs[c].split("=");
+ envp.put("SSL_CLIENT_S_DN_" + pprs[0], pprs[1]);
}
+
+ // Issuer
+ envp.put("SSL_CLIENT_I_DN", certs[0].getIssuerX500Principal().getName());
+ // To fill the elements C,ST... Email Still to TODO.
+ pr = certs[0].getSubjectX500Principal().getName();
+ prs = pr.split(", ");
+ for (int c = 0; c < prs.length; c++) {
+ String pprs[] = prs[c].split("=");
+ envp.put("SSL_CLIENT_I_DN_" + pprs[0], pprs[1]);
+ }
+
+
+ // envp.put("CERT_ISSUER",
+ // nullsToBlanks(certs[c].getIssuerX500Principal().getName()));
}
}
|
|
From: <jbo...@li...> - 2006-05-31 20:49:46
|
Author: szimano Date: 2006-05-31 16:49:43 -0400 (Wed, 31 May 2006) New Revision: 4534 Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp Log: google.pl -> google.com Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp =================================================================== --- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp 2006-05-31 20:38:41 UTC (rev 4533) +++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp 2006-05-31 20:49:43 UTC (rev 4534) @@ -60,7 +60,7 @@ </tbody></table> </div> <div id="ControlMenu"> - <form id="TopSearch" action="http://www.google.pl/search" onsubmit="document.forms[0].q.value = document.forms[0].q.value + ' site:jboss.org';"> + <form id="TopSearch" action="http://www.google.com/search" onsubmit="document.forms[0].q.value = document.forms[0].q.value + ' site:jboss.org';"> <ul> <li><a href="<% |
|
From: <jbo...@li...> - 2006-05-31 20:38:55
|
Author: szimano Date: 2006-05-31 16:38:41 -0400 (Wed, 31 May 2006) New Revision: 4533 Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp Log: google search in labs Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp =================================================================== --- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp 2006-05-31 19:33:50 UTC (rev 4532) +++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-theme/jbossForgeLayout.war/layouts/jbossForge.jsp 2006-05-31 20:38:41 UTC (rev 4533) @@ -60,7 +60,7 @@ </tbody></table> </div> <div id="ControlMenu"> - <form id="TopSearch" action="http://www.jboss.com/search.jsp"> + <form id="TopSearch" action="http://www.google.pl/search" onsubmit="document.forms[0].q.value = document.forms[0].q.value + ' site:jboss.org';"> <ul> <li><a href="<% @@ -77,7 +77,7 @@ <li><a href="http://www.jboss.com/careers">Careers</a></li> <li><a href="http://www.jboss.com/company/contact">Contact Us</a></li> <li> - <input style="border: 1px solid #6e6e6e; font: 10px Verdana, Helvetica, Arial, sans-serif; padding-left: 2px; margin-left: 10px;" name="query" onfocus="SearchFocus(this)" onblur="SearchBlur(this)" value="Search..." /> + <input style="border: 1px solid #6e6e6e; font: 10px Verdana, Helvetica, Arial, sans-serif; padding-left: 2px; margin-left: 10px;" name="q" onfocus="SearchFocus(this)" onblur="SearchBlur(this)" value="Search..." /> <input class="searchbutton" type="image" src="/file-access/default/theme/images/spacer.gif" value="go" align="middle" /> </li> </ul> |
|
From: <jbo...@li...> - 2006-05-31 19:33:59
|
Author: mar...@jb...
Date: 2006-05-31 15:33:50 -0400 (Wed, 31 May 2006)
New Revision: 4532
Modified:
labs/jbossrules/trunk/build.xml
Log:
-build corrections
Modified: labs/jbossrules/trunk/build.xml
===================================================================
--- labs/jbossrules/trunk/build.xml 2006-05-31 19:32:10 UTC (rev 4531)
+++ labs/jbossrules/trunk/build.xml 2006-05-31 19:33:50 UTC (rev 4532)
@@ -372,7 +372,7 @@
**************************************************
-->
- <target name="compile-jsr94" depends="init">
+ <target name="compile-jsr94" depends="build-compiler">
<antcall target="compile-module">
<param name="module" value="drools-jsr94"/>
</antcall>
@@ -493,7 +493,8 @@
excludepackagenames="org.drools.asm.*"
destdir="target/docs/apidocs"
author="false"
- version="false">
+ version="false"
+ source="1.4">
<sourcepath>
<pathelement path="drools-core/src/main/java" />
|
|
From: <jbo...@li...> - 2006-05-31 19:33:14
|
Author: mar...@jb... Date: 2006-05-31 15:32:10 -0400 (Wed, 31 May 2006) New Revision: 4531 Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Agenda.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/AgendaEventListener.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/AgendaFilter.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Authoring.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Authoring.svg labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Copy of Section-What_is_a_Rule_Engine.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Inference_Engine.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Inference_Engine.svg labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Logical_Assertion.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Logical_Assertion.svg labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/PackageBuilder.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/PackageBuilderConfiguration.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/RuleBase.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/RuleBaseConfiguration.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/RuleBaseFactory.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Runtime.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Runtime.svg labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-The_Drools_Rule_Engine.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Stated_Assertion.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Stated_Assertion.svg labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Truth_Maintenance_System.drl.vsd labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Two_Phase.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Two_Phase.svg labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Two_Phase.vsd labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/WorkingMemory.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/WorkingMemoryEventListener.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/arch_overview.vsd Removed: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Agenda.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Event_Model.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Rule_Base.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Working_Memory.xml Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Rules.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-What_is_a_Rule_Engine.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Overview.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Package.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Query.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml labs/jbossrules/trunk/documentation/manual/en/master.xml Log: -updated docs Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml 2006-05-31 19:25:18 UTC (rev 4530) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml 2006-05-31 19:32:10 UTC (rev 4531) @@ -3,16 +3,20 @@ <title>Getting the examples</title> <para>Some examples are included as "integration tests" in the Drools source - code. On top of these, you can download the drools-examples module. This - module is always having more samples added to it by users. The example - project in eclipse requires that you have the plugin instilled: load up the - drools-examples project (it has an eclipse project already setup). The rules - all have example classes that execute the rules. If you want to try the - examples in another project (or another IDE) then you will need to setup the - dependencies by hand of course.</para> + code - specifically the drools-compiler module. On top of these, you can + download the drools-examples module; which is a self contained Eclipse + project. This module is always having more samples added to it by users. The + example project in eclipse requires that you have the plugin instilled: load + up the drools-examples project (it has an eclipse project already setup). + The rules all have example classes that execute the rules. If you want to + try the examples in another project (or another IDE) then you will need to + setup the dependencies by hand of course.</para> <para>The examples can be found at http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-examples/ (you can browse online, or use a subversion client and download the project into Eclipse</para> + + <para>Future documentation will include walk throughs for each of the + examples.</para> </section> \ No newline at end of file Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Agenda.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Agenda.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/AgendaEventListener.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/AgendaEventListener.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/AgendaFilter.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/AgendaFilter.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Authoring.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Authoring.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Authoring.svg =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Authoring.svg 2006-05-31 19:25:18 UTC (rev 4530) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Authoring.svg 2006-05-31 19:32:10 UTC (rev 4531) @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<!-- Generated by Microsoft Visio 11.0, SVG Export, v1.0 Authoring.svg Page-1 --> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="4.86755in" + height="4.12084in" viewBox="0 0 350.464 296.7" xml:space="preserve" color-interpolation-filters="sRGB" class="st8"> + <v:documentProperties v:langID="1033" v:metric="true" v:viewMarkup="false"/> + + <style type="text/css"> + <![CDATA[ + .st1 {fill:#e8eef7;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st2 {fill:#000000;font-family:Arial;font-size:1.00001em} + .st3 {font-size:1em} + .st4 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st5 {marker-end:url(#mrkr13-28);stroke:#4677bf;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st6 {fill:#4677bf;fill-opacity:1;stroke:#4677bf;stroke-opacity:1;stroke-width:0.08695652173913} + .st7 {fill:none;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} + .st8 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3} + ]]> + </style> + + <defs id="Markers"> + <g id="lend13"> + <path d="M 3 1 L 0 0 L 3 -1 L 3 1 " style="stroke:none"/> + </g> + <marker id="mrkr13-28" class="st6" v:arrowType="13" v:arrowSize="2" v:setback="34.5" refX="-34.5" orient="auto" + markerUnits="strokeWidth"> + <use xlink:href="#lend13" transform="scale(-11.5,-11.5) "/> + </marker> + </defs> + <g v:mID="0" v:index="1" v:groupContext="foregroundPage"> + <title>Page-1</title> + <v:pageProperties v:drawingScale="0.0393701" v:pageScale="0.0393701" v:drawingUnits="24" v:shadowOffsetX="8.50394" + v:shadowOffsetY="-8.50394"/> + <v:layer v:name="Connector" v:index="0"/> + <g id="shape1-1" v:mID="1" v:groupContext="shape" transform="translate(87.4444,-253.941)"> + <title>Rectangle</title> + <desc>Parser</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/> + <v:textRect cx="42.5197" cy="275.441" width="85.04" height="42.5197"/> + <rect x="0" y="254.181" width="85.0394" height="42.5197" rx="5.66929" ry="5.66929" class="st1"/> + <text x="24.85" y="279.04" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Parser</text> </g> + <g id="shape5-4" v:mID="5" v:groupContext="shape" transform="translate(87.4444,-167.484)"> + <title>Rectangle.5</title> + <desc>(descr) Intermediate AST</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/> + <v:textRect cx="42.5197" cy="275.441" width="85.04" height="42.5197"/> + <rect x="0" y="254.181" width="85.0394" height="42.5197" rx="5.66929" ry="5.66929" class="st1"/> + <text x="23.86" y="264.64" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>(descr)<v:newlineChar/><tspan + x="9.17" dy="1.2em" class="st3">Intermediate </tspan><tspan x="30.86" dy="1.2em" class="st3">AST</tspan></text> </g> + <g id="shape6-9" v:mID="6" v:groupContext="shape" transform="translate(4.39717,-163.705)"> + <title>Document</title> + <desc>xml drl</desc> + <v:userDefs> + <v:ud v:nameU="visDescription" v:val="VT4(Use to add a document or file to your system diagram.)"/> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> + <v:textRect cx="25.5118" cy="271.189" width="51.03" height="51.0236"/> + <path d="M34.02 228.67 L51.02 245.68 L34.02 245.68 L34.02 228.67 Z M0 228.67 L0 296.7 L51.02 296.7 L51.02 245.68 L34.02 + 245.68 L34.02 228.67 L0 228.67 Z" class="st4"/> + <text x="16.17" y="267.59" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>xml<v:newlineChar/><tspan + x="18.83" dy="1.2em" class="st3">drl</tspan></text> </g> + <g id="shape2-13" v:mID="2" v:groupContext="shape" transform="translate(9.49165,-0.24)"> + <title>Rectangle.2</title> + <desc>Package Builder</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197" v:verticalAlign="0"/> + <v:textRect cx="120.472" cy="236.464" width="240.95" height="120.472"/> + <rect x="0" y="176.228" width="240.945" height="120.472" rx="5.66929" ry="5.66929" class="st1"/> + <text x="4" y="191.03" class="st2" v:langID="2057"><v:paragraph/><v:tabList/>Package Builder</text> </g> + <g id="shape3-16" v:mID="3" v:groupContext="shape" transform="translate(151.799,-7.32661)"> + <title>Rectangle.3</title> + <desc>Code Generator</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/> + <v:textRect cx="42.5197" cy="275.441" width="85.04" height="42.5197"/> + <rect x="0" y="254.181" width="85.0394" height="42.5197" rx="5.66929" ry="5.66929" class="st1"/> + <text x="28.18" y="271.84" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Code <tspan x="15.51" + dy="1.2em" class="st3">Generator</tspan></text> </g> + <g id="shape4-20" v:mID="4" v:groupContext="shape" transform="translate(151.799,-64.0195)"> + <title>Rectangle.4</title> + <desc>Compiler</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/> + <v:textRect cx="42.5197" cy="275.441" width="85.04" height="42.5197"/> + <rect x="0" y="254.181" width="85.0394" height="42.5197" rx="5.66929" ry="5.66929" class="st1"/> + <text x="18.52" y="279.04" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Compiler</text> </g> + <g id="shape8-23" v:mID="8" v:groupContext="shape" v:layerMember="0" transform="translate(122.877,-167.484)"> + <title>Dynamic connector</title> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <path d="M7.09 296.7 L7.09 335.19" class="st5"/> + </g> + <g id="shape11-29" v:mID="11" v:groupContext="shape" v:layerMember="0" transform="translate(122.877,-253.941)"> + <title>Dynamic connector.11</title> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <path d="M7.09 296.7 L7.09 332.36" class="st5"/> + </g> + <g id="shape13-34" v:mID="13" v:groupContext="shape" transform="translate(0.72,-169.988)"> + <title>Sheet.13</title> + <rect x="0" y="280.7" width="104" height="16" rx="5.66929" ry="5.66929" class="st7"/> + </g> + <g id="shape7-36" v:mID="7" v:groupContext="shape" v:layerMember="0" transform="translate(29.909,-231.736)"> + <title>Dynamic connector.7</title> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <path d="M0 296.7 L0 258.91 A5.66929 5.66929 0 0 1 5.67 253.24 L49.26 253.24" class="st5"/> + </g> + <g id="shape9-41" v:mID="9" v:groupContext="shape" transform="translate(299.2,-26.4605)"> + <title>Document.9</title> + <desc>package</desc> + <v:userDefs> + <v:ud v:nameU="visDescription" v:val="VT4(Use to add a document or file to your system diagram.)"/> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> + <v:textRect cx="25.5118" cy="271.189" width="51.03" height="51.0236"/> + <path d="M34.02 228.67 L51.02 245.68 L34.02 245.68 L34.02 228.67 Z M0 228.67 L0 296.7 L51.02 296.7 L51.02 245.68 L34.02 + 245.68 L34.02 228.67 L0 228.67 Z" class="st4"/> + <text x="2.81" y="274.79" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>package</text> </g> + <g id="shape10-44" v:mID="10" v:groupContext="shape" v:layerMember="0" transform="translate(250.437,-53.3896)"> + <title>Dynamic connector.10</title> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <path d="M0 289.61 L40.48 289.61" class="st5"/> + </g> + </g> +</svg> Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Copy of Section-What_is_a_Rule_Engine.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Copy of Section-What_is_a_Rule_Engine.xml 2006-05-31 19:25:18 UTC (rev 4530) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Copy of Section-What_is_a_Rule_Engine.xml 2006-05-31 19:32:10 UTC (rev 4531) @@ -0,0 +1,576 @@ +<?xml version="1.0" encoding="UTF-8"?> +<section> + <title>What is a Rule Engine</title> + + <section> + <title>Background</title> + + <para>Artificial Intelligence (A.I.) is a very broad research area that + focuses on "Making computers think like people" and includes disciplines + like Neural Networks, Genetic Algorithms, Decision Trees, Frame Systems + and Expert Systems. Knowledge representation is the area of A.I. concerned + with how knowledge is represented and manipulated. Expert Systems use + Knowledge representation to facilitate the codification of knowledge into + a knowledge base which can be used for reasoning - i.e. we can process + data with this knowledge base to infer conclusions. Expert Systems are + also known as Knowledge-based Systems and Knowledge-based Expert System + and are considered 'applied artificial intelligence'; the process of + developing with an Expert System is Knowledge Engineering. Drools is a + Rule Engine that uses the Rule Based approached to implement an Expert + System and is more correctly classified as a Production Rules + System.</para> + + <para>The brain of a Rule Based approach is the Inference Engine; the role + of the Inference Engine is to infer conclusions about facts, from the + rules. </para> + + <figure> + <title>Inference Engine</title> + + <mediaobject> + <imageobject> + <imagedata align="center" fileref="Rule_Engine.svg" format="SVG" /> + </imageobject> + + <imageobject> + <imagedata align="center" fileref="Inference_Engine.png" + format="PNG" /> + </imageobject> + </mediaobject> + </figure> + + <para>A Production Rule is a two-part structure using logic to express one + or more conditions which when met result in execution of actions.</para> + + <programlisting>if + <conditions> +then + <actions></programlisting> + + <para>This is achieved using First Order Logic, or predicate logic, which + extends Propositional Logic. <ulink + url="http://en.wikipedia.org/wiki/Emil_Leon_Post">Emil Leon Post</ulink> + was the first to develop an inference based system using symbols to + express logic - as a consequence of this he was able to prove that any + logical system (including mathematics) could be expressed with such a + system.</para> + + <para>A proposition is a statement that can be classified as true or + false. If the truth can be determined from statement alone it is said to + be a "closed statement". In programming terms this is an expression that + does not reference any variables:</para> + + <para>10 = = 2 * 5</para> + + <para>Expressions that evaluate against one or more variables, facts, are + "open statements", in that we cannot determine whether the statement is + true until we have a variable instance to evaluate against:</para> + + <para>Person.sex == "male"</para> + + <para>With SQL if we look at the conclusion's action as simply returning + the matched fact to the user:</para> + + <para>select * from People where People.sex == "male"</para> + + <para>For any rows, which represent our facts, that are returned we have + inferred that those facts are male people. The following diagram shows how + the above SQL statement and People table can be represented in terms of + the previous Inference Engine diagram.</para> + + <figure> + <title>SQL as a simplistic Inference Engine</title> + + <mediaobject> + <imageobject> + <imagedata align="center" fileref="Male_People.svg" format="SVG" /> + </imageobject> + + <imageobject> + <imagedata align="center" fileref="Male_People.png" format="PNG" /> + </imageobject> + </mediaobject> + </figure> + + <para>So in java we can say that a simple proposition is of the form + 'variable' 'operator' 'value' - where we often refer to 'value' as being a + literal value - a proposition can be thought as a field constraint. + Further to this propositions can be combined with conjuntive and + disjuntive connectives, which is the logic theorists way of saying + '&&' and '||'. The following shows two open propositional + statements connected together with a single disjunctive connective.</para> + + <programlisting>person.getEyeColor().equals("blue") || person.getEyeColor().equals("green") </programlisting> + + <para>However Propositional Logic is not Turing complete in that you are + limited to the problems you can define because it cannot express criteria + for the structure of data. First Order Logic (FOL), or Predicate Logic, + extends Propositional Logic with two new quantifier concepts to allow + expressions defining structure - specifically universal and existential + quantifiers. Universal quantifiers allow you to check that something is + true for everything. Existential quantifiers check for the existence of + something, in that it occurs at least once.</para> + + <para>Imagine we have two classes - Student and Module. Module represents + each of the courses the Student attended for that semester, referenced by + the List collection. At the end of the semester each Module has a score. + If the Student has a Module score below 40 then they will fail that + semester - the existential quantifier can be used used with the "less than + 40" open proposition to check for the existence of a Module that is true + for the specified criteria.</para> + + <programlisting>public class Student { + private String name; + private List modules; + + ... +}</programlisting> + + <programlisting>public Class Module { + private String name; + private String studentName; + private int score;</programlisting> + + <para>Java is Turing complete in that you can write code, among other + things, to iterate data structures to check for existence. The following + should return a List of students who have failed the semester.</para> + + <programlisting>List failedStudents = new ArrayList(); + +for ( Iterator studentIter = students.iterator(); studentIter.hasNext() { + Student student = ( Student ) studentIter.next(); + for ( Iterator it = student.getModules.iterator(); it.hasNext(); ) { + Module module = ( Module ) it.next(); + if ( module.getScore() < 40 ) { + failedStudents.add( student ) ; + break; + } + } +}</programlisting> + + <para>Early SQL implementations where not Turing complete as they did not + provide quantifiers to asses the structure of data. However modern SQL + engines allow nesting of SQL which can be combined with keywords like + 'exists' and 'in': The following query would return a set of Students who + have failed the semester.</para> + + <programlisting>select + * +from + Students s +where exists ( + select + * + from + Modules m + where + m.student_name = s.name and + m.score < 40 +)</programlisting> + + <para>So modern SQL engines confuse things even more, by showing some + capabilities to support First Order Logic - still one of the key + differentiators here is in the design approach to solving this problem; as + an Inference Engine can handle far more complex rules involving many facts + and quantifiers in a stateful manner which may not be possible to express + in SQL and if it was would likely bring an SQL Engine to its knees - where + as an Inference Engine's design approach caters for First Order Logic. + Further to this an Inference Engine is stateful and thus reacts to changes + in data, as part of a Productions Rules System, which enables the logical + relationships between the results of the actions inferred by the data and + rules - this is called Truth Maintenance - .A Query Engine simply returns + results, so it has no support for Truth Maintenance. For example the + "Honest Politician" example, which always ensures that hope and decomcracy + exists.</para> + + <programlisting>when + an honest Politician exists +then + logically assert Hope + +when + Hope exists +then + print "Hurrah!!! Democracy Lives" + +when + Hope does not exist +then + print "Democracy is Doomed" +</programlisting> + + <para></para> + + <para></para> + + <para>To help gain a better understanding we can build a simple linear + rule engine</para> + + <programlisting>// Interface for Production Rules +public interface Rule { + public void evaluate(Object[] objects); +} +</programlisting> + + <programlisting>public class LinearInferenceEngine { + Rules[] rules; + + public LinearInferenceEngine(Rule[] rules) { + this.rules = rules; + } + + public void evaluate(Object[] objects) { + for ( int i = 0; i < rules.length; i++ ) { + rules[i].evaluate( objects ); + } + } +}</programlisting> + + <programlisting>// The production rule - a simple proposition +public class FindMalePeople implements Rule { + public evaluate(Object[] objects) { + Person person = ( Person ) objects[i]; + if ( person.getSex().equals( "male" ) { + consequence( people[i] ); + } + } + + // The consequence + private void consequence(Person person) { + System.out.println(Person.getName() + " is male" ); + } +} +</programlisting> + + <programlisting>// The Facts +Person[] people = new Person[] { new Person("mark", "male"), new Person("bob", "male"), new Person("janet", "female") }; + +// The Production Rules +Rule rules[] = new Rule[] { new FindMalePeople() }; + +/ The Linear Inference Engine +LinearInferenceEngine engine = new LinearInferenceEngine( rules ); + +// Evaluate Facts against the Productions Rules using the Linear Inference Engine +for ( int i = 0; i < people.length; i++ ) { + engine.evaluate( new Object[] { people[i] } ); +}</programlisting> + + <para>However what differentiates a Rule Engine from SQL is its ability to + deal with First Order Logic and actions</para> + + <figure> + <title>Additional Reading</title> + + <itemizedlist> + <listitem> + <para>"Expert Systems - Principles and Programming" (2005) by Joseph + C. Giarratano, Gary D. Riley</para> + </listitem> + + <listitem> + <para>"Introduction to Expert Systems" (1999) by Peter + Jackson</para> + </listitem> + + <listitem> + <para>"Knowledge Representation and Reasing" (2004) by Ronald J. + Brachman, Hector J. Levesque</para> + </listitem> + </itemizedlist> + </figure> + + <para>A Rule Engine like Drools is centred around the concept of + logicproduction rules (IF conditions THEN actions). Emil Leon Post (<ulink + url="http://en.wikipedia.org/wiki/Emil_Leon_Post">http://en.wikipedia.org/wiki/Emil_Leon_Post)</ulink> + was the first to use production systems in logic - as a consequence of + this he was able to prove that any logical system (including mathematics) + could be written with production rules. Quite an amazing proof, this + essentially means that you can represent any system/problem with + production rules (back in the real world there are constraints of + processing power and efficiency of course !).</para> + + <para>You may also have heard of "Expert Systems" in the context of rule + engines. You can think of expert systems as a rule engine + the + codification of knowledge for a specific problem domain (+ a user + interface !). In that sense, Drools is a platform for expert systems. + Historically, rule engines popularity grew out of expert systems success + (for example, EMYCIN was one of the first "shells" for an expert system, + which was created from the MYCIN medical diagnosis expert system).</para> + </section> + + <section> + <title>Rules</title> + + <para>A <indexterm> + <primary>Rule</primary> + </indexterm>Rule is the codification of business knowledge. A Rule has + attributes, a Left Hand Side (LHS) and a Right Hand Side (RHS). Drools + allows the following attributes:</para> + + <itemizedlist> + <listitem> + <para>salience</para> + </listitem> + + <listitem> + <para>agenda-group</para> + </listitem> + + <listitem> + <para>no-loop</para> + </listitem> + + <listitem> + <para>auto-focus</para> + </listitem> + + <listitem> + <para>duration</para> + </listitem> + </itemizedlist> + + <programlisting>rule “<name>” + <attribute> <value> + when + <LHS> + then + <RHS> +end +</programlisting> + + <para>The LHS of the Rule consists of one or more Conditions. As the Rule + Engine is made aware of new data or changes to existing data it matches + the data against the Conditions, when all the Conditions are met and true + the RHS, and its actions, are executed; the RHS, called the <indexterm> + <primary>Consequence</primary> + </indexterm>Consequence. The LHS and the RHS is analogous to:</para> + + <programlisting>if ( <LHS> ) { + <RHS> +}</programlisting> + + <para>Rules are associated with a namespace via the + <literal>package</literal> keyword; other Rule Engines may call this a + <indexterm> + <primary>Rule Set</primary> + </indexterm>Rule Set. A Package declares imports, global variables, + functions and rules.</para> + + <programlisting>package com.sample + +import java.util.List +import com.sample.Cheese + +global List cheeses + +function void exampleFunction(Cheese cheese) { + System.out.println( cheese ); +} + +rule “A Cheesy Rule” + when + cheese : Cheese( type == "stilton" ) + then + exampleFunction( cheese ); + cheeses.add( cheese ); +end</programlisting> + + <para>The process of matching the new or existing modified data against + rules is called <indexterm> + <primary>Pattern Matching</primary> + </indexterm> Pattern Matching, the engine which does this matching is + the <indexterm> + <primary>Inference Engine</primary> + </indexterm>Inference Engine. The Rule's are referred to as the + <indexterm> + <primary>Production Memory</primary> + </indexterm>Production Memory and the data that the Inference Engine + matches against is the <indexterm> + <primary>WorkingMemory</primary> + </indexterm>Working Memory. the Agenda manages the execution of the + matched Rules. There are a number of algorithms used for Pattern Matching + by Inference Engines including:</para> + + <itemizedlist> + <listitem> + <para>Linear</para> + </listitem> + + <listitem> + <para>Rete</para> + </listitem> + + <listitem> + <para>Treat</para> + </listitem> + + <listitem> + <para>Leaps</para> + </listitem> + </itemizedlist> + + <para>Drools has implementations for both Rete and Leaps; Leaps is still + considered experiment. The Drools <indexterm> + <primary>Rete</primary> + </indexterm>Rete implementation is called ReteOO signifying that this + Drools has an enhanced and optimised implementation of the Rete algorithm. + Other Rete based engines also have marketting terms for their prioprietary + enhancements to Rete, like RetePlus and Rete III,</para> + + <figure> + <title>A Basic Rete network</title> + + <mediaobject> + <imageobject> + <imagedata align="center" fileref="Rule_Engine.svg" format="SVG" /> + </imageobject> + + <imageobject> + <imagedata align="center" fileref="Rule_Engine.png" format="PNG" /> + </imageobject> + </mediaobject> + </figure> + + <para>The LHS of a rule is made up of <indexterm> + <primary>Conditional Element</primary> + </indexterm>iConditional Elements and <indexterm> + <primary>Field Constraint</primary> + </indexterm>iField Constraints. The following example shows a <indexterm> + <primary>Literal Field Constraint</primary> + </indexterm>iLiteral Field Constraint used with a Cheese Fact; the + combination of Field Constraints on a Fact is known as a <indexterm> + <primary>Column</primary> + </indexterm>Column.</para> + + <programlisting>rule "Cheddar Cheese" + when + Cheese( type == "cheddar" ) + then + System.out.println( "cheddar" ); +end</programlisting> + + <para>The example above is similar to :</para> + + <programlisting>public void cheddarCheese(Cheese cheese) { + if ( cheese.getType().equals("cheddar") { + System.out.println( "cheddar" ); + } +}</programlisting> + + <para>Rule engines are a complete de-coupling of data from the logic. + Rules cannot be called directly as they are not methods or functions + instead Rules fire in response to changes in Working Memory's data, It may + help to think of this de-coupling as a specialised event sytem. The + Consequence is the Listener to the full matching of the LHS events.</para> + + <para>Rule Engines are much like a database where Rule's LHS define the + queries on the Working Memory. The previous rule can be expressed in + <indexterm> + <primary>SQL</primary> + </indexterm>SQL as:</para> + + <programlisting> select * from Cheese where type == "cheddar"</programlisting> + + <para>A <indexterm> + <primary>DataBase</primary> + </indexterm>Database executes SQL, on request, where as a Rule Engine + will process data against its rules, its Production Memory, as it's + asserted; this process is known as <indexterm> + <primary>Pattern Matching</primary> + </indexterm>Pattern Matching. When added to the Production Memory, + Rule's are decomposed into a graph using the <indexterm> + <primary>Rete</primary> + </indexterm>Rete algorithm. Rete is one of the standard Rule Engine + algorithms developed by <indexterm> + <primary>Charles Forgey</primary> + </indexterm>Charles Forgey in 1979 which is covered in greater detail in + a Rete Algorithm chapter.</para> + + <figure> + <title>A Basic Rete network</title> + + <mediaobject> + <imageobject> + <imagedata align="center" fileref="A_Basic_Rete_Network.svg" + format="SVG" /> + </imageobject> + + <imageobject> + <imagedata align="center" fileref="A_Basic_Rete_Network.png" + format="PNG" /> + </imageobject> + </mediaobject> + </figure> + + <para>Each Fact type in our Working Memory, such as <code>Cheese</code>, + is represented by an <indexterm> + <primary>Object Type</primary> + </indexterm>Object Type class, shown as the root node in our graph. When + Facts are asserted into the Working Memory the Rule Engine finds the + matching Object Type node and propagates the asserted Fact onto the next + node. The Object Type node maintains a memory of all matched Facts. in our + example the next node in the graph is a <indexterm> + <primary>Field Constraint</primary> + </indexterm>Field Constraint, <code>type == "cheddar", </code>its job is + to filter Facts using the given constraint; if the type of + <code>Cheese</code> is not "cheddar" the Fact progresses no further in the + network, if it is "cheddar" it is rememebered in the <indexterm> + <primary>Alpha Node</primary> + </indexterm>Alpha Node's memory and propagated onto the next node in the + network.. Alpha Node is classic Rete terminology for single input/single + output nodes, in that it receives a single Fact of a specified Object Type + and propates a single Fact of specified Object Type.</para> + + <para>At this point we have what is known as a <indexterm> + <primary>Partial Match</primary> + </indexterm>Partial Match, in that we have matched facts against some, + but not all, of the Rule's nodes. <indexterm> + <primary>Left Input Adapter Node</primary> + </indexterm>s will be explained later, suffice to say it always + propagetes onto the next node, in this case a <indexterm> + <primary>Terminal Node</primary> + </indexterm>Terminal Node. The Terminal Node is our end node, now we say + the Rule is Fully Matched and ready to fire.</para> + + <para>Earlier we mentioned that a Rule Engine is much like a Database, we + can prove this by using a <indexterm> + <primary>Query</primary> + </indexterm>Query construct. A Query is Rule with a special Terminal + node; instead of executing a Consequence the Terminal node stores matching + Facts in a list, which is returned as the result. Lets prove this</para> + + <programlisting>query "Find cheeses with a cost of 5" + Cheese( price == 5 ) +end</programlisting> + + <programlisting>// First create the facts +Cheese stilton = new Cheese("stilton", 8); // type, price +Cheese cheddar = new Cheese("cheddar", 5); // type, price +Cheese mozarella = new Cheese("mozarella", 5); // type, price + +// Now assert them into the Working Memory +workingMemory.assertObject( stilton ); +workingMemory.assertObject( cheddar ); +workingMemory.assertObject( mozarella ); + +List results = workingMemory.getQueryResults( "Find cheeses with a cost of 5" );</programlisting> + + <para>When we get the Query Results the List has a size of two and + references "cheddar" and "mozarella", as expected. If we had used a Rule + construct instead of a Query the Terminal Node's Consequence would have + attempted to fire twice, once for "cheddar" and once for + "mozarella".</para> + + <para>When a Rule is Fully Matched it does not fire immediately (in Rete, + but in Leaps it does !). Instead the Rule plus the matched Facts are + <indexterm> + <primary>Activated</primary> + </indexterm>Activated placed onto the <indexterm> + <primary>Agenda</primary> + </indexterm>Agenda; which is responsible for the scheduling and firing + <indexterm> + <primary>Activation</primary> + </indexterm>Activations.</para> + </section> +</section> \ No newline at end of file Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Inference_Engine.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Inference_Engine.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Inference_Engine.svg =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Inference_Engine.svg 2006-05-31 19:25:18 UTC (rev 4530) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Inference_Engine.svg 2006-05-31 19:32:10 UTC (rev 4531) @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<!-- Generated by Microsoft Visio 11.0, SVG Export, v1.0 Inference_Engine.svg Page-1 --> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="6.52453in" + height="3.99817in" viewBox="0 0 469.766 287.869" xml:space="preserve" color-interpolation-filters="sRGB" class="st9"> + <v:documentProperties v:langID="1033" v:metric="true" v:viewMarkup="false"/> + + <style type="text/css"> + <![CDATA[ + .st1 {fill:#ffffff} + .st2 {stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} + .st3 {fill:#000000;font-family:Arial;font-size:1.66667em} + .st4 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st5 {font-size:1em} + .st6 {marker-end:url(#mrkr13-23);stroke:#4677bf;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st7 {fill:#4677bf;fill-opacity:1;stroke:#4677bf;stroke-opacity:1;stroke-width:0.08695652173913} + .st8 {marker-end:url(#mrkr4-34);stroke:#4677bf;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st9 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3} + ]]> + </style> + + <defs id="Markers"> + <g id="lend13"> + <path d="M 3 1 L 0 0 L 3 -1 L 3 1 " style="stroke:none"/> + </g> + <marker id="mrkr13-23" class="st7" v:arrowType="13" v:arrowSize="2" v:setback="34.5" refX="-34.5" orient="auto" + markerUnits="strokeWidth"> + <use xlink:href="#lend13" transform="scale(-11.5,-11.5) "/> + </marker> + <g id="lend4"> + <path d="M 2 1 L 0 0 L 2 -1 L 2 1 " style="stroke:none"/> + </g> + <marker id="mrkr4-34" class="st7" v:arrowType="4" v:arrowSize="2" v:setback="23" refX="-23" orient="auto" + markerUnits="strokeWidth"> + <use xlink:href="#lend4" transform="scale(-11.5,-11.5) "/> + </marker> + </defs> + <g v:mID="0" v:index="1" v:groupContext="foregroundPage"> + <title>Page-1</title> + <v:pageProperties v:drawingScale="0.0393701" v:pageScale="0.0393701" v:drawingUnits="24" v:shadowOffsetX="8.50394" + v:shadowOffsetY="-8.50394"/> + <v:layer v:name="Network" v:index="0"/> + <v:layer v:name="Connector" v:index="1"/> + <g id="shape12-1" v:mID="12" v:groupContext="shape" v:layerMember="0" transform="translate(0.72,-187.327)"> + <title>Datastore.12</title> + <desc>Rules</desc> + <v:custProps> + <v:cp v:nameU="Manufacturer" v:lbl="Manufacturer" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="ProductNumber" v:lbl="Product Number" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="PartNumber" v:lbl="Part Number" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="ProductDescription" v:lbl="Product Description" v:type="0" v:sortKey="1" v:invis="false" + v:ask="false" v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="AssetNumber" v:lbl="Asset Number" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="SerialNumber" v:lbl="Serial Number" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="Location" v:lbl="Location" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" v:langID="1033" + v:val="VT4()"/> + <v:cp v:nameU="Building" v:lbl="Building" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" v:langID="1033" + v:val="VT4()"/> + <v:cp v:nameU="Room" v:lbl="Room" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" v:langID="1033" + v:val="VT4()"/> + <v:cp v:nameU="Department" v:lbl="Department" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + </v:custProps> + <v:userDefs> + <v:ud v:nameU="visDescription" + v:val="VT4(Use to add a a database, data source, or data storage device to your system diagram.)"/> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(0,0,0,0)" v:tabSpace="42.5197"/> + <v:textRect cx="49.9109" cy="244.196" width="99.83" height="62.3887"/> + <path d="M0 200.52 L0 275.39 A49.9109 12.4777 -180 1 0 99.82 275.39 L99.82 200.52 A49.9109 12.4777 -180 0 0 0 200.52 Z" + class="st1"/> + <path d="M0 200.52 L0 275.39 A49.9109 12.4777 -180 1 0 99.82 275.39 L99.82 200.52 A49.9109 12.4777 -180 0 0 0 200.52" + class="st2"/> + <path d="M0 200.52 A49.9109 12.4777 -180 1 0 99.82 200.52" class="st2"/> + <text x="24.33" y="250.2" class="st3" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Rules</text> </g> + <g id="shape13-6" v:mID="13" v:groupContext="shape" v:layerMember="0" transform="translate(369.224,-187.327)"> + <title>Datastore.13</title> + <desc>Facts</desc> + <v:custProps> + <v:cp v:nameU="Manufacturer" v:lbl="Manufacturer" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="ProductNumber" v:lbl="Product Number" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="PartNumber" v:lbl="Part Number" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="ProductDescription" v:lbl="Product Description" v:type="0" v:sortKey="1" v:invis="false" + v:ask="false" v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="AssetNumber" v:lbl="Asset Number" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="SerialNumber" v:lbl="Serial Number" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + <v:cp v:nameU="Location" v:lbl="Location" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" v:langID="1033" + v:val="VT4()"/> + <v:cp v:nameU="Building" v:lbl="Building" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" v:langID="1033" + v:val="VT4()"/> + <v:cp v:nameU="Room" v:lbl="Room" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" v:langID="1033" + v:val="VT4()"/> + <v:cp v:nameU="Department" v:lbl="Department" v:type="0" v:sortKey="1" v:invis="false" v:ask="false" + v:langID="1033" v:val="VT4()"/> + </v:custProps> + <v:userDefs> + <v:ud v:nameU="visDescription" + v:val="VT4(Use to add a a database, data source, or data storage device to your system diagram.)"/> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(0,0,0,0)" v:tabSpace="42.5197"/> + <v:textRect cx="49.9109" cy="244.196" width="99.83" height="62.3887"/> + <path d="M0 200.52 L0 275.39 A49.9109 12.4777 -180 1 0 99.82 275.39 L99.82 200.52 A49.9109 12.4777 -180 0 0 0 200.52 Z" + class="st1"/> + <path d="M0 200.52 L0 275.39 A49.9109 12.4777 -180 1 0 99.82 275.39 L99.82 200.52 A49.9109 12.4777 -180 0 0 0 200.52" + class="st2"/> + <path d="M0 200.52 A49.9109 12.4777 -180 1 0 99.82 200.52" class="st2"/> + <text x="25.45" y="250.2" class="st3" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Facts</text> </g> + <g id="shape15-11" v:mID="15" v:groupContext="shape" transform="translate(161.182,-138.464)"> + <title>Rectangle.18</title> + <desc>Inference Engine</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197" v:verticalAlign="0"/> + <v:textRect cx="73.7008" cy="259.522" width="147.41" height="56.6929"/> + <rect x="0" y="231.176" width="147.402" height="56.6929" class="st4"/> + <text x="32.01" y="253.18" class="st3" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Inference <tspan + x="42.56" dy="1.2em" class="st5">Engine</tspan></text> </g> + <g id="shape17-15" v:mID="17" v:groupContext="shape" transform="translate(164.017,-0.24)"> + <title>Rectangle.22</title> + <desc>Conclusions</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/> + <v:textRect cx="70.8661" cy="262.357" width="141.74" height="51.0236"/> + <rect x="0" y="236.845" width="141.732" height="51.0236" class="st4"/> + <text x="16.4" y="268.36" class="st3" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Conclusions</text> </g> + <g id="shape18-18" v:mID="18" v:groupContext="shape" v:layerMember="1" transform="translate(100.542,-237.238)"> + <title>Dynamic connector.18</title> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <path d="M0 287.87 L10.63 287.87 A10.6299 10.6299 0 0 1 21.26 298.5 L21.26 338.61 A19.6902 19.6902 -180 0 0 40.95 358.3 + L52.36 358.3" class="st6"/> + </g> + <g id="shape19-24" v:mID="19" v:groupContext="shape" v:layerMember="1" transform="translate(369.224,-237.238)"> + <title>Dynamic connector.19</title> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <path d="M0 287.87 L-10.63 287.87 A10.6299 10.6299 -180 0 0 -21.26 298.5 L-21.26 338.61 A19.6902 19.6902 0 0 1 -40.95 + 358.3 L-52.36 358.3" class="st6"/> + </g> + <g id="shape14-29" v:mID="14" v:groupContext="shape" v:layerMember="1" transform="translate(227.796,-138.464)"> + <title>Dynamic connector.6</title> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <path d="M7.09 287.87 L7.09 369.55" class="st8"/> + </g> + </g> +</svg> Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Logical_Assertion.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Logical_Assertion.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Logical_Assertion.svg =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Logical_Assertion.svg 2006-05-31 19:25:18 UTC (rev 4530) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Logical_Assertion.svg 2006-05-31 19:32:10 UTC (rev 4531) @@ -0,0 +1,287 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<!-- Generated by Microsoft Visio 11.0, SVG Export, v1.0 Logical_Assertion.svg Page-1 --> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="6.5421in" + height="5.12478in" viewBox="0 0 471.031 368.984" xml:space="preserve" color-interpolation-filters="sRGB" class="st7"> + <v:documentProperties v:langID="1033" v:metric="true" v:viewMarkup="false"/> + + <style type="text/css"> + <![CDATA[ + .st1 {fill:#e8eef7;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st2 {fill:#000000;font-family:Arial;font-size:0.666664em} + .st3 {font-size:1em} + .st4 {marker-end:url(#mrkr4-15);stroke:#4677bf;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st5 {fill:#4677bf;fill-opacity:1;stroke:#4677bf;stroke-opacity:1;stroke-width:0.08695652173913} + .st6 {fill:#ffffff;stroke:none;stroke-linecap:butt;stroke-width:7.2} + .st7 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3} + ]]> + </style> + + <defs id="Markers"> + <g id="lend4"> + <path d="M 2 1 L 0 0 L 2 -1 L 2 1 " style="stroke:none"/> + </g> + <marker id="mrkr4-15" class="st5" v:arrowType="4" v:arrowSize="2" v:setback="23" refX="-23" orient="auto" + markerUnits="strokeWidth"> + <use xlink:href="#lend4" transform="scale(-11.5,-11.5) "/> + </marker> + </defs> + <g v:mID="0" v:index="1" v:groupContext="foregroundPage"> + <title>Page-1</title> + <v:pageProperties v:drawingScale="0.0393701" v:pageScale="0.0393701" v:drawingUnits="24" v:shadowOffsetX="8.50394" + v:shadowOffsetY="-8.50394"/> + <v:layer v:name="Flowchart" v:index="0"/> + <v:layer v:name="Connector" v:index="1"/> + <g id="shape1-1" v:mID="1" v:groupContext="shape" v:layerMember="0" transform="translate(264.334,-241.185)"> + <title>Decision</title> + <desc>Does the Object already exist?</desc> + <v:custProps> + <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> + <v:cp v:nameU="Duration" v:lbl="Duration" v:type="2" v:langID="1033"/> + <v:cp v:nameU="Resources" v:lbl="Resources" v:langID="1033"/> + </v:custProps> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> + <v:textRect cx="38.9764" cy="333.551" width="64.97" height="53.1496"/> + <path d="M0 333.55 L38.98 298.12 L77.95 333.55 L38.98 368.98 L0 333.55 Z" class="st1"/> + <text x="10.29" y="331.15" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Does the Object <tspan + x="14.29" dy="1.2em" class="st3">already exist</tspan>?</text> </g> + <g id="shape2-5" v:mID="2" v:groupContext="shape" v:layerMember="0" transform="translate(264.334,-106.539)"> + <title>Decision.2</title> + <desc>Is the Object STATED or JUSTIFED?</desc> + <v:custProps> + <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> + <v:cp v:nameU="Duration" v:lbl="Duration" v:type="2" v:langID="1033"/> + <v:cp v:nameU="Resources" v:lbl="Resources" v:langID="1033"/> + </v:custProps> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> + <v:textRect cx="38.9764" cy="333.551" width="64.97" height="53.1496"/> + <path d="M0 333.55 L38.98 298.12 L77.95 333.55 L38.98 368.98 L0 333.55 Z" class="st1"/> + <text x="16.52" y="326.35" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Is the Object <tspan + x="18.52" dy="1.2em" class="st3">STATED or </tspan><tspan x="17.64" dy="1.2em" class="st3">JUSTIFED</tspan>?</text> </g> + <g id="shape3-10" v:mID="3" v:groupContext="shape" v:layerMember="1" transform="translate(296.224,-241.185)"> + <title>Dynamic connector</title> + <desc>yes</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/> + <v:textRect cx="7.08661" cy="400.874" width="40" height="17.6036"/> + <path d="M7.09 368.98 L7.09 427.24" class="st4"/> + <rect v:rectContext="textBkgnd" x="0.486913" y="396.074" width="12.4494" height="9.59985" class="st6"/> + <text x="0.86" y="403.27" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>yes</text> </g> + <g id="shape5-18" v:mID="5" v:groupContext="shape" v:layerMember="0" transform="translate(399.925,-120.712)"> + <title>Process</title> + <desc>Can’t Justify a STATED fact, return existing FactHandle.</desc> + <v:custProps> + <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> + <v:cp v:nameU="Duration" v:lbl="Duration" v:type="2" v:langID="1033"/> + <v:cp v:nameU="Resources" v:lbl="Resources" v:langID="1033"/> + </v:custProps> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> + <v:textRect cx="35.4331" cy="347.724" width="70.87" height="42.5197"/> + <rect x="0" y="326.464" width="70.8661" height="42.5197" rx="5.66929" ry="5.66929" class="st1"/> + <text x="10.3" y="335.72" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Can’t Justify a <tspan + x="10.98" dy="1.2em" class="st3">STATED fact</tspan>, <tspan x="10.3" dy="1.2em" class="st3">return existing </tspan><tspan + x="13.86" dy="1.2em" class="st3">FactHandle</tspan>.</text> </g> + <g id="shape6-24" v:mID="6" v:groupContext="shape" v:layerMember="1" transform="translate(342.287,-134.886)"> + <title>Dynamic connector.6</title> + <desc>STATED</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/> + <v:textRect cx="28.8189" cy="361.897" width="42.54" height="17.6036"/> + <path d="M0 361.9 L52.12 361.9" class="st4"/> + <rect v:rectContext="textBkgnd" x="12.6728" y="357.098" width="31.5582" height="9.59985" class="st6"/> + <text x="13.05" y="364.3" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>STATED</text> </g> + <g id="shape7-31" v:mID="7" v:groupContext="shape" v:layerMember="1" transform="translate(296.224,-106.539)"> + <title>Dynamic connector.7</title> + <desc>JUSTIFIED</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/> + <v:textRect cx="7.08661" cy="400.874" width="51.43" height="17.6036"/> + <path d="M7.09 368.98 L7.09 427.24" class="st4"/> + <rect v:rectContext="textBkgnd" x="-13.5213" y="396.074" width="40.4451" height="9.59985" class="st6"/> + <text x="-13.15" y="403.27" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>JUSTIFIED</text> </g> + <g id="shape8-38" v:mID="8" v:groupContext="shape" v:layerMember="0" transform="translate(267.878,-0.24)"> + <title>Process.8</title> + <desc>Add additional justification and return existing FactHandle</desc> + <v:custProps> + <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> + <v:cp v:nameU="Duration" v:lbl="Duration" v:type="2" v:langID="1033"/> + <v:cp v:nameU="Resources" v:lbl="Resources" v:langID="1033"/> + </v:custProps> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> + <v:textRect cx="35.4331" cy="347.724" width="70.87" height="42.5197"/> + <rect x="0" y="326.464" width="70.8661" height="42.5197" rx="5.66929" ry="5.66929" class="st1"/> + <text x="10.07" y="335.72" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Add additional <tspan + x="7.85" dy="1.2em" class="st3">justification and </tspan><tspan x="10.3" dy="1.2em" class="st3">return existing </tspan><tspan + x="14.97" dy="1.2em" class="st3">FactHandle</tspan></text> </g> + <g id="shape4-44" v:mID="4" v:groupContext="shape" v:layerMember="0" transform="translate(128.744,-241.185)"> + <title>Decision.4</title> + <desc>Is there an existing Equal Object?</desc> + <v:custProps> + <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> + <v:cp v:nameU="Duration" v:lbl="Duration" v:type="2" v:langID="1033"/> + <v:cp v:nameU="Resources" v:lbl="Resources" v:langID="1033"/> + </v:custProps> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> + <v:textRect cx="38.9764" cy="333.551" width="64.97" height="53.1496"/> + <path d="M0 333.55 L38.98 298.12 L77.95 333.55 L38.98 368.98 L0 333.55 Z" class="st1"/> + <text x="20.07" y="326.35" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Is there an <tspan + x="14.07" dy="1.2em" class="st3">existing Equal </tspan><tspan x="25.19" dy="1.2em" class="st3">Object</tspan>?</text> </g> + <g id="shape9-49" v:mID="9" v:groupContext="shape" v:layerMember="1" transform="translate(264.334,-269.531)"> + <title>Dynamic connector.9</title> + <desc>no</desc> + <v:userDefs> + <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> + </v:userDefs> + <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/> + <v:textRect cx="-28.8189" cy="361.897" width="40" height="17.6036"/> + <path d="M0 361.9 L-52.12 361.9" class="st4"/> + <rect v:rectContext="textBkgnd" x="-33.6429" y="357.098" width="8.89838" height="9.59985" class="st6"/> + <text x="-33.27" y="364.3" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>no</text> </g> + <g id="shape10-56" v:mID="10" v:groupContext="shape" v:layerMember="1" transform="translate(160.634,-241.185)"> + <title>Dynamic connector.10</title> + <desc>yes</desc> + <v:userDefs> + <v:ud v:nameU="vi... [truncated message content] |
|
From: <jbo...@li...> - 2006-05-31 19:25:23
|
Author: mar...@jb... Date: 2006-05-31 15:25:18 -0400 (Wed, 31 May 2006) New Revision: 4530 Modified: labs/jbossrules/trunk/drools-ide/icons/Thumbs.db Log: -deleted Modified: labs/jbossrules/trunk/drools-ide/icons/Thumbs.db =================================================================== (Binary files differ) |
|
From: <jbo...@li...> - 2006-05-31 17:31:56
|
Author: jfr...@jb...
Date: 2006-05-31 13:31:41 -0400 (Wed, 31 May 2006)
New Revision: 4529
Modified:
labs/jbossweb/trunk/src/share/classes/org/apache/catalina/servlets/php/ScriptEnvironment.java
Log:
Add the 3 variables from where we have to extract the
SSL environment for php.
Modified: labs/jbossweb/trunk/src/share/classes/org/apache/catalina/servlets/php/ScriptEnvironment.java
===================================================================
--- labs/jbossweb/trunk/src/share/classes/org/apache/catalina/servlets/php/ScriptEnvironment.java 2006-05-31 17:07:13 UTC (rev 4528)
+++ labs/jbossweb/trunk/src/share/classes/org/apache/catalina/servlets/php/ScriptEnvironment.java 2006-05-31 17:31:41 UTC (rev 4529)
@@ -58,6 +58,9 @@
* The Request attribute key for the client certificate chain.
*/
private static final String CERTIFICATE_KEY = "javax.servlet.request.X509Certificate";
+ private static final String CIPHER_SUITE = "javax.servlet.request.cipher_suite"
+ private static final String SSL_SESSION = "javax.servlet.request.ssl_session";
+ private static final String KEY_SIZE = "javax.servlet.request.key_size";
/** context of the enclosing servlet */
private ServletContext context = null;
|
Author: mar...@jb...
Date: 2006-05-31 13:07:01 -0400 (Wed, 31 May 2006)
New Revision: 4527
Added:
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/Agenda.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/DefaultAgenda.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/InternalAgenda.java
Removed:
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/Agenda.java
Modified:
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/SynchronizedWorkingMemory.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/WorkingMemory.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/ScheduledAgendaItem.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsAgenda.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsWorkingMemory.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/TerminalNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/spi/AgendaGroup.java
labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/AgendaTest.java
labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/LogicalAssertionTest.java
labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/SchedulerTest.java
Log:
-Moved Agenda impl access to InternalAgenda interface
Added: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/Agenda.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/Agenda.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/Agenda.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -0,0 +1,83 @@
+package org.drools;
+
+import org.drools.spi.Activation;
+import org.drools.spi.ActivationGroup;
+import org.drools.spi.AgendaGroup;
+
+public interface Agenda {
+
+ public WorkingMemory getWorkingMemory();
+
+ public org.drools.util.LinkedList getScheduledItems();
+
+ public boolean setFocus(AgendaGroup agendaGroup);
+
+ public void setFocus(String name);
+
+ public AgendaGroup getFocus();
+
+ public AgendaGroup getAgendaGroup(String name);
+
+ public AgendaGroup[] getAgendaGroups();
+
+ public AgendaGroup[] getStack();
+
+ public ActivationGroup getActivationGroup(String name);
+
+ /**
+ * Iterates all the <code>AgendGroup<code>s in the focus stack returning the total number of <code>Activation</code>s
+ * @return
+ * total number of <code>Activation</code>s on the focus stack
+ */
+ public int focusStackSize();
+
+ /**
+ * Iterates all the modules in the focus stack returning the total number of <code>Activation</code>s
+ * @return
+ * total number of activations on the focus stack
+ */
+ public int agendaSize();
+
+ public Activation[] getActivations();
+
+ public Activation[] getScheduledActivations();
+
+ /**
+ * Clears all Activations from the Agenda
+ *
+ */
+ public void clearAgenda();
+
+ /**
+ * Clears all Activations from an Agenda Group. Any Activations that are also in an Xor Group are removed the
+ * the Xor Group.
+ *
+ * @param agendaGroup
+ */
+ public void clearAgendaGroup(String name);
+
+ /**
+ * Clears all Activations from an Agenda Group. Any Activations that are also in an Xor Group are removed the
+ * the Xor Group.
+ *
+ * @param agendaGroup
+ */
+ public void clearAgendaGroup(AgendaGroup agendaGroup);
+
+ /**
+ * Clears all Activations from an Activation-Group. Any Activations that are also in an Agenda Group are removed
+ * from the Agenda Group.
+ *
+ * @param activationGroup
+ */
+ public void clearActivationGroup(String name);
+
+ /**
+ * Clears all Activations from an Xor Group. Any Activations that are also in an Agenda Group are removed
+ * from the Agenda Group.
+ *
+ * @param activationGroup
+ */
+ public void clearActivationGroup(ActivationGroup activationGroup);
+
+}
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/SynchronizedWorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/SynchronizedWorkingMemory.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/SynchronizedWorkingMemory.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -19,7 +19,6 @@
import java.util.List;
import java.util.Map;
-import org.drools.common.Agenda;
import org.drools.event.AgendaEventListener;
import org.drools.event.WorkingMemoryEventListener;
import org.drools.spi.AgendaFilter;
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/WorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/WorkingMemory.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/WorkingMemory.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -20,7 +20,6 @@
import java.util.List;
import java.util.Map;
-import org.drools.common.Agenda;
import org.drools.event.AgendaEventListener;
import org.drools.event.WorkingMemoryEventListener;
import org.drools.spi.AgendaFilter;
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
+import org.drools.Agenda;
import org.drools.FactException;
import org.drools.FactHandle;
import org.drools.NoSuchFactHandleException;
@@ -100,7 +101,7 @@
protected final TruthMaintenanceSystem tms;
/** Rule-firing agenda. */
- protected Agenda agenda;
+ protected DefaultAgenda agenda;
protected final List factQueue = new ArrayList();
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/Agenda.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/Agenda.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/Agenda.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -1,426 +0,0 @@
-package org.drools.common;
-
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.drools.WorkingMemory;
-import org.drools.spi.Activation;
-import org.drools.spi.ActivationGroup;
-import org.drools.spi.AgendaFilter;
-import org.drools.spi.AgendaGroup;
-import org.drools.spi.ConsequenceException;
-import org.drools.spi.KnowledgeHelper;
-import org.drools.util.LinkedListNode;
-import org.drools.util.Queueable;
-
-/**
- * Rule-firing Agenda.
- *
- * <p>
- * Since many rules may be matched by a single assertObject(...) all scheduled
- * actions are placed into the <code>Agenda</code>.
- * </p>
- *
- * <p>
- * While processing a scheduled action, it may modify or retract objects in
- * other scheduled actions, which must then be removed from the agenda.
- * Non-invalidated actions are left on the agenda, and are executed in turn.
- * </p>
- *
- * @author <a href="mailto:bo...@en...">bob mcwhirter </a>
- * @author <a href="mailto:si...@re...">Simon Harris </a>
- */
-public class Agenda
- implements
- Serializable {
- // ------------------------------------------------------------
- // Instance members
- // ------------------------------------------------------------
-
- /**
- *
- */
- private static final long serialVersionUID = -9112292414291983688L;
-
- /** Working memory of this Agenda. */
- private final WorkingMemory workingMemory;
-
- private org.drools.util.LinkedList scheduledActivations;
-
- /** Items time-delayed. */
-
- private final Map agendaGroups;
-
- private final Map activationGroups;
-
- private final LinkedList focusStack;
-
- private AgendaGroupImpl currentModule;
-
- private AgendaGroup main;
-
- // ------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------
-
- /**
- * Construct.
- *
- * @param workingMemory
- * The <code>WorkingMemory</code> of this agenda.
- * @param conflictResolver
- * The conflict resolver.
- */
- public Agenda(final WorkingMemory workingMemory) {
- this.workingMemory = workingMemory;
- this.agendaGroups = new HashMap();
- this.activationGroups = new HashMap();
- this.focusStack = new LinkedList();
-
- // MAIN should always be the first AgendaGroup and can never be removed
- this.main = new AgendaGroupImpl( AgendaGroup.MAIN );
-
- this.agendaGroups.put( AgendaGroup.MAIN,
- this.main );
-
- this.focusStack.add( this.main );
-
- }
-
- public WorkingMemory getWorkingMemory() {
- return this.workingMemory;
- }
-
- /**
- * Schedule an agenda item for delayed firing.
- *
- * @param item
- * The item to schedule.
- */
- public void scheduleItem(final ScheduledAgendaItem item) {
- Scheduler.getInstance().scheduleAgendaItem( item );
-
- if ( this.scheduledActivations == null ) {
- this.scheduledActivations = new org.drools.util.LinkedList();
- }
-
- this.scheduledActivations.add( item );
- }
-
- public void removeScheduleItem(final ScheduledAgendaItem item) {
- this.scheduledActivations.remove( item );
- item.cancel();
- }
-
- public org.drools.util.LinkedList getScheduledItems() {
- return this.scheduledActivations;
- }
-
- public void addAgendaGroup(final AgendaGroup agendaGroup) {
- this.agendaGroups.put( agendaGroup.getName(),
- agendaGroup );
- }
-
- public boolean setFocus(final AgendaGroup agendaGroup) {
- // Set the focus to the agendaGroup if it doesn't already have the focus
- if ( this.focusStack.getLast() != agendaGroup ) {
- this.focusStack.add( agendaGroup );
- return true;
- }
- return false;
- }
-
- public void setFocus(final String name) {
- AgendaGroup agendaGroup = (AgendaGroup) this.agendaGroups.get( name );
-
- // Agenda may not have been created yet, if not create it.
- if ( agendaGroup == null ) {
- agendaGroup = new AgendaGroupImpl( name );
- this.workingMemory.getAgenda().addAgendaGroup( agendaGroup );
- }
- setFocus( agendaGroup );
- }
-
- public AgendaGroup getFocus() {
- return (AgendaGroup) this.focusStack.getLast();
- }
-
- /**
- * Returns the next populated Agenda Group. If all groups are empty then return the MAIN, dfault, Agenda Group
- *
- * @return
- */
- public AgendaGroup getNextFocus() {
- AgendaGroupImpl agendaGroup = null;
- // Iterate untill we find a populate AgendaModule or we reach the MAIN, default, AgendaGroup
- while ( true ) {
- agendaGroup = (AgendaGroupImpl) this.focusStack.getLast();
-
- final boolean empty = agendaGroup.isEmpty();
-
- // No populated queus found so pop the focusStack and repeat
- if ( empty && (this.focusStack.size() > 1) ) {
- this.focusStack.removeLast();
- } else {
- agendaGroup = (empty) ? null : agendaGroup;
- break;
- }
- }
-
- return agendaGroup;
- }
-
- public void setCurrentAgendaGroup(final AgendaGroup agendaGroup) {
- this.currentModule = (AgendaGroupImpl) agendaGroup;
- }
-
- public AgendaGroup getCurrentAgendaGroup() {
- return this.currentModule;
- }
-
- public AgendaGroup getAgendaGroup(final String name) {
- return (AgendaGroup) this.agendaGroups.get( name );
- }
-
- public AgendaGroup[] getAgendaGroups() {
- return (AgendaGroup[]) this.agendaGroups.values().toArray( new AgendaGroup[this.agendaGroups.size()] );
- }
-
- public AgendaGroup[] getStack() {
- return (AgendaGroup[]) this.focusStack.toArray( new AgendaGroup[this.focusStack.size()] );
- }
-
- public ActivationGroup getActivationGroup(final String name) {
- ActivationGroupImpl activationGroup = (ActivationGroupImpl) this.activationGroups.get( name );
- if ( activationGroup == null ) {
- activationGroup = new ActivationGroupImpl( name );
- this.activationGroups.put( name,
- activationGroup );
- }
- return activationGroup;
- }
-
- /**
- * Iterates all the <code>AgendGroup<code>s in the focus stack returning the total number of <code>Activation</code>s
- * @return
- * total number of <code>Activation</code>s on the focus stack
- */
- public int focusStackSize() {
- int size = 0;
- for ( final Iterator iterator = this.focusStack.iterator(); iterator.hasNext(); ) {
- final AgendaGroup group = (AgendaGroupImpl) iterator.next();
- size += group.size();
- }
- return size;
- }
-
- /**
- * Iterates all the modules in the focus stack returning the total number of <code>Activation</code>s
- * @return
- * total number of activations on the focus stack
- */
- public int agendaSize() {
- int size = 0;
- for ( final Iterator iterator = this.agendaGroups.values().iterator(); iterator.hasNext(); ) {
- final AgendaGroup group = (AgendaGroupImpl) iterator.next();
- size += group.size();
- }
- return size;
- }
-
- public Activation[] getActivations() {
- final List list = new ArrayList();
- for ( final Iterator it = this.agendaGroups.values().iterator(); it.hasNext(); ) {
- final AgendaGroup group = (AgendaGroup) it.next();
- list.addAll( Arrays.asList( group.getActivations() ) );
- }
- return (Activation[]) list.toArray( new Activation[list.size()] );
- }
-
- public Activation[] getScheduledActivations() {
- final List list = new ArrayList( this.scheduledActivations.size() );
- for ( LinkedListNode node = this.scheduledActivations.getFirst(); node != null; node = node.getNext() ) {
- list.add( node );
- }
- return (Activation[]) list.toArray( new Activation[list.size()] );
- }
-
- /**
- * Clears all Activations from the Agenda
- *
- */
- public void clearAgenda() {
- // Cancel all items and fire a Cancelled event for each Activation
- for ( final Iterator agendaGroupIterator = this.agendaGroups.values().iterator(); agendaGroupIterator.hasNext(); ) {
- final AgendaGroupImpl group = (AgendaGroupImpl) agendaGroupIterator.next();
- clearAgendaGroup( group );
- }
-
- final EventSupport eventsupport = (EventSupport) this.workingMemory;
- if ( this.scheduledActivations != null && !this.scheduledActivations.isEmpty() ) {
- for ( ScheduledAgendaItem item = (ScheduledAgendaItem) this.scheduledActivations.removeFirst(); item != null; item = (ScheduledAgendaItem) this.scheduledActivations.removeFirst() ) {
- item.remove();
- eventsupport.getAgendaEventSupport().fireActivationCancelled( item );
- }
- }
- }
-
- /**
- * Clears all Activations from an Agenda Group. Any Activations that are also in an Xor Group are removed the
- * the Xor Group.
- *
- * @param agendaGroup
- */
- public void clearAgendaGroup(final String name) {
- final AgendaGroupImpl agendaGroup = (AgendaGroupImpl) this.agendaGroups.get( name );
- if ( agendaGroup != null ) {
- clearAgendaGroup( agendaGroup );
- }
- }
-
- /**
- * Clears all Activations from an Agenda Group. Any Activations that are also in an Xor Group are removed the
- * the Xor Group.
- *
- * @param agendaGroup
- */
- public void clearAgendaGroup(final AgendaGroupImpl agendaGroup) {
- final EventSupport eventsupport = (EventSupport) this.workingMemory;
-
- final Queueable[] queueable = agendaGroup.getQueueable();
- for ( int i = 0, length = queueable.length; i < length; i++ ) {
- final AgendaItem item = (AgendaItem) queueable[i];
- if ( item == null ) {
- continue;
- }
-
- // this must be set false before removal from the XorGroup. Otherwise the XorGroup will also try to cancel the Actvation
- item.setActivated( false );
-
- if ( item.getActivationGroupNode() != null ) {
- item.getActivationGroupNode().getActivationGroup().removeActivation( item );
- }
-
- eventsupport.getAgendaEventSupport().fireActivationCancelled( item );
- }
- agendaGroup.clear();
- }
-
- /**
- * Clears all Activations from an Activation-Group. Any Activations that are also in an Agenda Group are removed
- * from the Agenda Group.
- *
- * @param activationGroup
- */
- public void clearActivationGroup(final String name) {
- final ActivationGroup activationGroup = (ActivationGroup) this.activationGroups.get( name );
- if ( activationGroup != null ) {
- clearActivationGroup( activationGroup );
- }
- }
-
- /**
- * Clears all Activations from an Xor Group. Any Activations that are also in an Agenda Group are removed
- * from the Agenda Group.
- *
- * @param activationGroup
- */
- public void clearActivationGroup(final ActivationGroup activationGroup) {
- final EventSupport eventsupport = (EventSupport) this.workingMemory;
- for ( final Iterator it = activationGroup.iterator(); it.hasNext(); ) {
- final Activation activation = ((ActivationGroupNode) it.next()).getActivation();
- activation.setActivationGroupNode( null );
-
- if ( activation.isActivated() ) {
- activation.setActivated( false );
- activation.remove();
- eventsupport.getAgendaEventSupport().fireActivationCancelled( activation );
- }
- }
- activationGroup.clear();
- }
-
- /**
- * Fire the next scheduled <code>Agenda</code> item.
- *
- * @throws ConsequenceException
- * If an error occurs while firing an agenda item.
- */
- public boolean fireNextItem(final AgendaFilter filter) throws ConsequenceException {
- final AgendaGroupImpl group = (AgendaGroupImpl) getNextFocus();
-
- // return if there are no Activations to fire
- if ( group == null ) {
- return false;
- }
-
- final AgendaItem item = (AgendaItem) group.getNext();
- if ( item == null ) {
- return false;
- }
-
- if ( filter == null || filter.accept( item ) ) {
- fireActivation( item );
- }
-
- return true;
- }
-
- /**
- * Fire this item.
- *
- * @param workingMemory
- * The working memory context.
- *
- * @throws ConsequenceException
- * If an error occurs while attempting to fire the consequence.
- */
- public synchronized void fireActivation(final Activation activation) throws ConsequenceException {
- final EventSupport eventsupport = (EventSupport) this.workingMemory;
-
- eventsupport.getAgendaEventSupport().fireBeforeActivationFired( activation );
-
- if ( activation.getActivationGroupNode() != null ) {
- final ActivationGroup activationGroup = activation.getActivationGroupNode().getActivationGroup();
- activationGroup.removeActivation( activation );
- clearActivationGroup( activationGroup );
- }
- activation.setActivated( false );
-
- try {
- final KnowledgeHelper knowledgeHelper = new org.drools.base.DefaultKnowledgeHelper( activation,
- this.workingMemory );
- activation.getRule().getConsequence().evaluate( knowledgeHelper,
- this.workingMemory );
- } catch ( final Exception e ) {
- e.printStackTrace();
- throw new ConsequenceException( e,
- activation.getRule() );
- }
-
- eventsupport.getAgendaEventSupport().fireAfterActivationFired( activation );
- }
-
-}
Copied: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/DefaultAgenda.java (from rev 4507, labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/Agenda.java)
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/Agenda.java 2006-05-31 05:09:44 UTC (rev 4507)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/DefaultAgenda.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -0,0 +1,448 @@
+package org.drools.common;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.drools.Agenda;
+import org.drools.WorkingMemory;
+import org.drools.spi.Activation;
+import org.drools.spi.ActivationGroup;
+import org.drools.spi.AgendaFilter;
+import org.drools.spi.AgendaGroup;
+import org.drools.spi.ConsequenceException;
+import org.drools.spi.KnowledgeHelper;
+import org.drools.util.LinkedListNode;
+import org.drools.util.Queueable;
+
+/**
+ * Rule-firing Agenda.
+ *
+ * <p>
+ * Since many rules may be matched by a single assertObject(...) all scheduled
+ * actions are placed into the <code>Agenda</code>.
+ * </p>
+ *
+ * <p>
+ * While processing a scheduled action, it may modify or retract objects in
+ * other scheduled actions, which must then be removed from the agenda.
+ * Non-invalidated actions are left on the agenda, and are executed in turn.
+ * </p>
+ *
+ * @author <a href="mailto:bo...@en...">bob mcwhirter </a>
+ * @author <a href="mailto:si...@re...">Simon Harris </a>
+ */
+public class DefaultAgenda
+ implements
+ Serializable,
+ InternalAgenda {
+ // ------------------------------------------------------------
+ // Instance members
+ // ------------------------------------------------------------
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -9112292414291983688L;
+
+ /** Working memory of this Agenda. */
+ private final WorkingMemory workingMemory;
+
+ private org.drools.util.LinkedList scheduledActivations;
+
+ /** Items time-delayed. */
+
+ private final Map agendaGroups;
+
+ private final Map activationGroups;
+
+ private final LinkedList focusStack;
+
+ private AgendaGroupImpl currentModule;
+
+ private AgendaGroup main;
+
+ // ------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------
+
+ /**
+ * Construct.
+ *
+ * @param workingMemory
+ * The <code>WorkingMemory</code> of this agenda.
+ * @param conflictResolver
+ * The conflict resolver.
+ */
+ public DefaultAgenda(final WorkingMemory workingMemory) {
+ this.workingMemory = workingMemory;
+ this.agendaGroups = new HashMap();
+ this.activationGroups = new HashMap();
+ this.focusStack = new LinkedList();
+
+ // MAIN should always be the first AgendaGroup and can never be removed
+ this.main = new AgendaGroupImpl( AgendaGroup.MAIN );
+
+ this.agendaGroups.put( AgendaGroup.MAIN,
+ this.main );
+
+ this.focusStack.add( this.main );
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getWorkingMemory()
+ */
+ public WorkingMemory getWorkingMemory() {
+ return this.workingMemory;
+ }
+
+ /**
+ * Schedule an agenda item for delayed firing.
+ *
+ * @param item
+ * The item to schedule.
+ */
+ public void scheduleItem(final ScheduledAgendaItem item) {
+ Scheduler.getInstance().scheduleAgendaItem( item );
+
+ if ( this.scheduledActivations == null ) {
+ this.scheduledActivations = new org.drools.util.LinkedList();
+ }
+
+ this.scheduledActivations.add( item );
+ }
+
+ public void removeScheduleItem(final ScheduledAgendaItem item) {
+ this.scheduledActivations.remove( item );
+ item.cancel();
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getScheduledItems()
+ */
+ public org.drools.util.LinkedList getScheduledItems() {
+ return this.scheduledActivations;
+ }
+
+ public void addAgendaGroup(final AgendaGroup agendaGroup) {
+ this.agendaGroups.put( agendaGroup.getName(),
+ agendaGroup );
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#setFocus(org.drools.spi.AgendaGroup)
+ */
+ public boolean setFocus(final AgendaGroup agendaGroup) {
+ // Set the focus to the agendaGroup if it doesn't already have the focus
+ if ( this.focusStack.getLast() != agendaGroup ) {
+ this.focusStack.add( agendaGroup );
+ return true;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#setFocus(java.lang.String)
+ */
+ public void setFocus(final String name) {
+ AgendaGroup agendaGroup = (AgendaGroup) this.agendaGroups.get( name );
+
+ // Agenda may not have been created yet, if not create it.
+ if ( agendaGroup == null ) {
+ agendaGroup = new AgendaGroupImpl( name );
+ ( ( DefaultAgenda ) this.workingMemory.getAgenda() ).addAgendaGroup( agendaGroup );
+ }
+ setFocus( agendaGroup );
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getFocus()
+ */
+ public AgendaGroup getFocus() {
+ return (AgendaGroup) this.focusStack.getLast();
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getNextFocus()
+ */
+ public AgendaGroup getNextFocus() {
+ AgendaGroupImpl agendaGroup = null;
+ // Iterate untill we find a populate AgendaModule or we reach the MAIN, default, AgendaGroup
+ while ( true ) {
+ agendaGroup = (AgendaGroupImpl) this.focusStack.getLast();
+
+ final boolean empty = agendaGroup.isEmpty();
+
+ // No populated queus found so pop the focusStack and repeat
+ if ( empty && (this.focusStack.size() > 1) ) {
+ this.focusStack.removeLast();
+ } else {
+ agendaGroup = (empty) ? null : agendaGroup;
+ break;
+ }
+ }
+
+ return agendaGroup;
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#setCurrentAgendaGroup(org.drools.spi.AgendaGroup)
+ */
+ public void setCurrentAgendaGroup(final AgendaGroup agendaGroup) {
+ this.currentModule = (AgendaGroupImpl) agendaGroup;
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getCurrentAgendaGroup()
+ */
+ public AgendaGroup getCurrentAgendaGroup() {
+ return this.currentModule;
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getAgendaGroup(java.lang.String)
+ */
+ public AgendaGroup getAgendaGroup(final String name) {
+ return (AgendaGroup) this.agendaGroups.get( name );
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getAgendaGroups()
+ */
+ public AgendaGroup[] getAgendaGroups() {
+ return (AgendaGroup[]) this.agendaGroups.values().toArray( new AgendaGroup[this.agendaGroups.size()] );
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getStack()
+ */
+ public AgendaGroup[] getStack() {
+ return (AgendaGroup[]) this.focusStack.toArray( new AgendaGroup[this.focusStack.size()] );
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getActivationGroup(java.lang.String)
+ */
+ public ActivationGroup getActivationGroup(final String name) {
+ ActivationGroupImpl activationGroup = (ActivationGroupImpl) this.activationGroups.get( name );
+ if ( activationGroup == null ) {
+ activationGroup = new ActivationGroupImpl( name );
+ this.activationGroups.put( name,
+ activationGroup );
+ }
+ return activationGroup;
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#focusStackSize()
+ */
+ public int focusStackSize() {
+ int size = 0;
+ for ( final Iterator iterator = this.focusStack.iterator(); iterator.hasNext(); ) {
+ final AgendaGroup group = (AgendaGroupImpl) iterator.next();
+ size += group.size();
+ }
+ return size;
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#agendaSize()
+ */
+ public int agendaSize() {
+ int size = 0;
+ for ( final Iterator iterator = this.agendaGroups.values().iterator(); iterator.hasNext(); ) {
+ final AgendaGroup group = (AgendaGroupImpl) iterator.next();
+ size += group.size();
+ }
+ return size;
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getActivations()
+ */
+ public Activation[] getActivations() {
+ final List list = new ArrayList();
+ for ( final Iterator it = this.agendaGroups.values().iterator(); it.hasNext(); ) {
+ final AgendaGroup group = (AgendaGroup) it.next();
+ list.addAll( Arrays.asList( group.getActivations() ) );
+ }
+ return (Activation[]) list.toArray( new Activation[list.size()] );
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#getScheduledActivations()
+ */
+ public Activation[] getScheduledActivations() {
+ final List list = new ArrayList( this.scheduledActivations.size() );
+ for ( LinkedListNode node = this.scheduledActivations.getFirst(); node != null; node = node.getNext() ) {
+ list.add( node );
+ }
+ return (Activation[]) list.toArray( new Activation[list.size()] );
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#clearAgenda()
+ */
+ public void clearAgenda() {
+ // Cancel all items and fire a Cancelled event for each Activation
+ for ( final Iterator agendaGroupIterator = this.agendaGroups.values().iterator(); agendaGroupIterator.hasNext(); ) {
+ final AgendaGroupImpl group = (AgendaGroupImpl) agendaGroupIterator.next();
+ clearAgendaGroup( group );
+ }
+
+ final EventSupport eventsupport = (EventSupport) this.workingMemory;
+ if ( this.scheduledActivations != null && !this.scheduledActivations.isEmpty() ) {
+ for ( ScheduledAgendaItem item = (ScheduledAgendaItem) this.scheduledActivations.removeFirst(); item != null; item = (ScheduledAgendaItem) this.scheduledActivations.removeFirst() ) {
+ item.remove();
+ eventsupport.getAgendaEventSupport().fireActivationCancelled( item );
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#clearAgendaGroup(java.lang.String)
+ */
+ public void clearAgendaGroup(final String name) {
+ final AgendaGroupImpl agendaGroup = (AgendaGroupImpl) this.agendaGroups.get( name );
+ if ( agendaGroup != null ) {
+ clearAgendaGroup( agendaGroup );
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#clearAgendaGroup(org.drools.common.AgendaGroupImpl)
+ */
+ public void clearAgendaGroup(final AgendaGroup agendaGroup) {
+ final EventSupport eventsupport = (EventSupport) this.workingMemory;
+
+ final Queueable[] queueable = ( ( AgendaGroupImpl) agendaGroup ).getQueueable();
+ for ( int i = 0, length = queueable.length; i < length; i++ ) {
+ final AgendaItem item = (AgendaItem) queueable[i];
+ if ( item == null ) {
+ continue;
+ }
+
+ // this must be set false before removal from the XorGroup. Otherwise the XorGroup will also try to cancel the Actvation
+ item.setActivated( false );
+
+ if ( item.getActivationGroupNode() != null ) {
+ item.getActivationGroupNode().getActivationGroup().removeActivation( item );
+ }
+
+ eventsupport.getAgendaEventSupport().fireActivationCancelled( item );
+ }
+ ( ( AgendaGroupImpl )agendaGroup ).clear();
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#clearActivationGroup(java.lang.String)
+ */
+ public void clearActivationGroup(final String name) {
+ final ActivationGroup activationGroup = (ActivationGroup) this.activationGroups.get( name );
+ if ( activationGroup != null ) {
+ clearActivationGroup( activationGroup );
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.drools.common.AgendaI#clearActivationGroup(org.drools.spi.ActivationGroup)
+ */
+ public void clearActivationGroup(final ActivationGroup activationGroup) {
+ final EventSupport eventsupport = (EventSupport) this.workingMemory;
+ for ( final Iterator it = activationGroup.iterator(); it.hasNext(); ) {
+ final Activation activation = ((ActivationGroupNode) it.next()).getActivation();
+ activation.setActivationGroupNode( null );
+
+ if ( activation.isActivated() ) {
+ activation.setActivated( false );
+ activation.remove();
+ eventsupport.getAgendaEventSupport().fireActivationCancelled( activation );
+ }
+ }
+ activationGroup.clear();
+ }
+
+ /**
+ * Fire the next scheduled <code>Agenda</code> item.
+ *
+ * @throws ConsequenceException
+ * If an error occurs while firing an agenda item.
+ */
+ public boolean fireNextItem(final AgendaFilter filter) throws ConsequenceException {
+ final AgendaGroupImpl group = (AgendaGroupImpl) getNextFocus();
+
+ // return if there are no Activations to fire
+ if ( group == null ) {
+ return false;
+ }
+
+ final AgendaItem item = (AgendaItem) group.getNext();
+ if ( item == null ) {
+ return false;
+ }
+
+ if ( filter == null || filter.accept( item ) ) {
+ fireActivation( item );
+ }
+
+ return true;
+ }
+
+ /**
+ * Fire this item.
+ *
+ * @param workingMemory
+ * The working memory context.
+ *
+ * @throws ConsequenceException
+ * If an error occurs while attempting to fire the consequence.
+ */
+ public synchronized void fireActivation(final Activation activation) throws ConsequenceException {
+ final EventSupport eventsupport = (EventSupport) this.workingMemory;
+
+ eventsupport.getAgendaEventSupport().fireBeforeActivationFired( activation );
+
+ if ( activation.getActivationGroupNode() != null ) {
+ final ActivationGroup activationGroup = activation.getActivationGroupNode().getActivationGroup();
+ activationGroup.removeActivation( activation );
+ clearActivationGroup( activationGroup );
+ }
+ activation.setActivated( false );
+
+ try {
+ final KnowledgeHelper knowledgeHelper = new org.drools.base.DefaultKnowledgeHelper( activation,
+ this.workingMemory );
+ activation.getRule().getConsequence().evaluate( knowledgeHelper,
+ this.workingMemory );
+ } catch ( final Exception e ) {
+ e.printStackTrace();
+ throw new ConsequenceException( e,
+ activation.getRule() );
+ }
+
+ eventsupport.getAgendaEventSupport().fireAfterActivationFired( activation );
+ }
+
+}
Added: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/InternalAgenda.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/InternalAgenda.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/InternalAgenda.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -0,0 +1,23 @@
+package org.drools.common;
+
+import org.drools.Agenda;
+import org.drools.spi.Activation;
+import org.drools.spi.AgendaFilter;
+import org.drools.spi.AgendaGroup;
+import org.drools.spi.ConsequenceException;
+
+public interface InternalAgenda
+ extends
+ Agenda {
+
+ public void fireActivation(final Activation activation) throws ConsequenceException;
+
+ public void removeScheduleItem(final ScheduledAgendaItem item);
+
+ public boolean fireNextItem(AgendaFilter filter) throws ConsequenceException;
+
+ public void scheduleItem(final ScheduledAgendaItem item);
+
+ public void addAgendaGroup(final AgendaGroup agendaGroup);
+
+}
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/ScheduledAgendaItem.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/ScheduledAgendaItem.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/ScheduledAgendaItem.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -19,6 +19,7 @@
import java.io.Serializable;
import java.util.TimerTask;
+import org.drools.Agenda;
import org.drools.FactHandle;
import org.drools.rule.Rule;
import org.drools.spi.Activation;
@@ -56,7 +57,7 @@
/** The rule. */
private final Rule rule;
- private final Agenda agenda;
+ private final InternalAgenda agenda;
private final PropagationContext context;
@@ -82,7 +83,7 @@
*/
public ScheduledAgendaItem(final long activationNumber,
final Tuple tuple,
- final Agenda agenda,
+ final InternalAgenda agenda,
final PropagationContext context,
final Rule rule) {
this.tuple = tuple;
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsAgenda.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsAgenda.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsAgenda.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-import org.drools.common.Agenda;
+import org.drools.common.DefaultAgenda;
import org.drools.rule.Query;
import org.drools.spi.Activation;
import org.drools.spi.ConsequenceException;
@@ -26,7 +26,7 @@
* @author Alexander Bagerman
*
*/
-public class LeapsAgenda extends Agenda {
+public class LeapsAgenda extends DefaultAgenda {
/**
*
*/
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsWorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsWorkingMemory.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsWorkingMemory.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -690,7 +690,7 @@
// The AgendaGroup is defined but not yet added to the
// Agenda, so create the AgendaGroup and add to the Agenda.
agendaGroup = new AgendaGroupImpl( rule.getAgendaGroup() );
- this.getAgenda().addAgendaGroup( agendaGroup );
+ this.agenda.addAgendaGroup( agendaGroup );
}
leapsRule.setAgendaGroup( agendaGroup );
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -26,7 +26,7 @@
import org.drools.WorkingMemory;
import org.drools.base.DroolsQuery;
import org.drools.common.AbstractWorkingMemory;
-import org.drools.common.Agenda;
+import org.drools.common.DefaultAgenda;
import org.drools.common.DefaultFactHandle;
import org.drools.common.EqualityKey;
import org.drools.common.InternalFactHandle;
@@ -60,7 +60,7 @@
public ReteooWorkingMemory(final InternalRuleBase ruleBase) {
super( ruleBase,
ruleBase.newFactHandleFactory() );
- this.agenda = new Agenda( this );
+ this.agenda = new DefaultAgenda( this );
}
public void doAssertObject(final InternalFactHandle handle,
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/TerminalNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/TerminalNode.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/TerminalNode.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -18,10 +18,12 @@
import java.util.Iterator;
+import org.drools.Agenda;
import org.drools.RuleBaseConfiguration;
-import org.drools.common.Agenda;
+import org.drools.common.DefaultAgenda;
import org.drools.common.AgendaGroupImpl;
import org.drools.common.AgendaItem;
+import org.drools.common.InternalAgenda;
import org.drools.common.NodeMemory;
import org.drools.common.PropagationContextImpl;
import org.drools.common.ScheduledAgendaItem;
@@ -122,14 +124,14 @@
if ( this.rule.getNoLoop() && this.rule.equals( context.getRuleOrigin() ) ) {
return;
}
- final Agenda agenda = workingMemory.getAgenda();
+ final InternalAgenda agenda = (InternalAgenda) workingMemory.getAgenda();
final Duration dur = this.rule.getDuration();
if ( dur != null && dur.getDuration( tuple ) > 0 ) {
final ScheduledAgendaItem item = new ScheduledAgendaItem( context.getPropagationNumber(),
tuple,
- workingMemory.getAgenda(),
+ agenda,
context,
this.rule );
@@ -168,7 +170,7 @@
// The AgendaGroup is defined but not yet added to the
// Agenda, so create the AgendaGroup and add to the Agenda.
agendaGroup = new AgendaGroupImpl( this.rule.getAgendaGroup() );
- workingMemory.getAgenda().addAgendaGroup( agendaGroup );
+ agenda.addAgendaGroup( agendaGroup );
}
memory.setAgendaGroup( agendaGroup );
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/spi/AgendaGroup.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/spi/AgendaGroup.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/spi/AgendaGroup.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -1,6 +1,6 @@
package org.drools.spi;
-import org.drools.common.Agenda;
+import org.drools.common.DefaultAgenda;
/*
* Copyright 2005 JBoss Inc
@@ -22,7 +22,7 @@
* The <code>Agenda</code> can be partitioned into groups, called <code>AgendaGroup</code>s. <code>Rule</code>s can be assigned to
* these <code>AgendaGroup</code>s. Only rules in the focus group can fire.
*
- * @see Agenda
+ * @see DefaultAgenda
*
* @author <a href="mailto:mar...@jb...">Mark Proctor</a>
* @author <a href="mailto:bo...@we...">Bob McWhirter</a>
Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/AgendaTest.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/AgendaTest.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/AgendaTest.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -21,12 +21,14 @@
import java.util.List;
import java.util.Map;
+import org.drools.Agenda;
import org.drools.DroolsTestCase;
import org.drools.RuleBase;
import org.drools.WorkingMemory;
-import org.drools.common.Agenda;
+import org.drools.common.DefaultAgenda;
import org.drools.common.AgendaGroupImpl;
import org.drools.common.DefaultFactHandle;
+import org.drools.common.InternalAgenda;
import org.drools.common.PropagationContextImpl;
import org.drools.rule.Rule;
import org.drools.spi.Activation;
@@ -100,7 +102,7 @@
final RuleBase ruleBase = new ReteooRuleBase();
final ReteooWorkingMemory workingMemory = (ReteooWorkingMemory) ruleBase.newWorkingMemory();
- final Agenda agenda = workingMemory.getAgenda();
+ final InternalAgenda agenda = (InternalAgenda) workingMemory.getAgenda();
final Rule rule = new Rule( "test-rule" );
final TerminalNode node = new TerminalNode( 3,
@@ -192,7 +194,7 @@
final ReteooWorkingMemory workingMemory = (ReteooWorkingMemory) ruleBase.newWorkingMemory();
- final Agenda agenda = workingMemory.getAgenda();
+ final InternalAgenda agenda = (InternalAgenda) workingMemory.getAgenda();
// // create the AgendaGroups
final AgendaGroupImpl agendaGroup1 = new AgendaGroupImpl( "agendaGroup1" );
@@ -412,7 +414,7 @@
final RuleBase ruleBase = new ReteooRuleBase();
final ReteooWorkingMemory workingMemory = (ReteooWorkingMemory) ruleBase.newWorkingMemory();
- final Agenda agenda = workingMemory.getAgenda();
+ final InternalAgenda agenda = (InternalAgenda) workingMemory.getAgenda();
// create the agendaGroup
final AgendaGroupImpl agendaGroup = new AgendaGroupImpl( "agendaGroup" );
@@ -491,7 +493,7 @@
final ReteooWorkingMemory workingMemory = (ReteooWorkingMemory) ruleBase.newWorkingMemory();
- final Agenda agenda = workingMemory.getAgenda();
+ final InternalAgenda agenda = (InternalAgenda) workingMemory.getAgenda();
final List list = new ArrayList();
Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/LogicalAssertionTest.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/LogicalAssertionTest.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/LogicalAssertionTest.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -16,6 +16,7 @@
* limitations under the License.
*/
+import org.drools.Agenda;
import org.drools.Cheese;
import org.drools.DroolsTestCase;
import org.drools.FactException;
@@ -24,8 +25,9 @@
import org.drools.RuleBaseConfiguration;
import org.drools.WorkingMemory;
import org.drools.base.ClassObjectType;
-import org.drools.common.Agenda;
+import org.drools.common.DefaultAgenda;
import org.drools.common.DefaultFactHandle;
+import org.drools.common.InternalAgenda;
import org.drools.common.PropagationContextImpl;
import org.drools.rule.Rule;
import org.drools.spi.Consequence;
@@ -52,7 +54,7 @@
rule1 );
final ReteooWorkingMemory workingMemory = (ReteooWorkingMemory) ruleBase.newWorkingMemory();
- final Agenda agenda = workingMemory.getAgenda();
+ final InternalAgenda agenda = (InternalAgenda) workingMemory.getAgenda();
final Consequence consequence = new Consequence() {
/**
Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/SchedulerTest.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/SchedulerTest.java 2006-05-31 17:00:18 UTC (rev 4526)
+++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/SchedulerTest.java 2006-05-31 17:07:01 UTC (rev 4527)
@@ -19,10 +19,10 @@
import java.util.ArrayList;
import java.util.List;
+import org.drools.Agenda;
import org.drools.DroolsTestCase;
import org.drools.RuleBase;
import org.drools.WorkingMemory;
-import org.drools.common.Agenda;
import org.drools.common.DefaultFactHandle;
import org.drools.common.PropagationContextImpl;
import org.drools.rule.Rule;
|
Author: mar...@jb...
Date: 2006-05-31 13:07:13 -0400 (Wed, 31 May 2006)
New Revision: 4528
Modified:
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/RuleBuilder.java
labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/semantics/java/javaFunction.stg
labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/semantics/java/javaInvokers.stg
Log:
-Moved Agenda impl access to InternalAgenda interface
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java 2006-05-31 17:07:01 UTC (rev 4527)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java 2006-05-31 17:07:13 UTC (rev 4528)
@@ -76,6 +76,11 @@
this( pkg,
null );
}
+
+ public PackageBuilder(PackageBuilderConfiguration configuration) {
+ this( null,
+ configuration );
+ }
/**
* This allows you to pass in a pre existing package, and a configuration (for instance to set the classloader).
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/RuleBuilder.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/RuleBuilder.java 2006-05-31 17:07:01 UTC (rev 4527)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/RuleBuilder.java 2006-05-31 17:07:13 UTC (rev 4528)
@@ -857,6 +857,7 @@
}
buffer.append( "public class " + ucFirst( this.ruleDescr.getClassName() ) + " {" + lineSeparator );
+ buffer.append( " private static final long serialVersionUID = 7952983928232702826L;" + lineSeparator );
for ( int i = 0, size = this.methods.size() - 1; i < size; i++ ) {
buffer.append( this.methods.get( i ) + lineSeparator );
Modified: labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/semantics/java/javaFunction.stg
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/semantics/java/javaFunction.stg 2006-05-31 17:07:01 UTC (rev 4527)
+++ labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/semantics/java/javaFunction.stg 2006-05-31 17:07:13 UTC (rev 4528)
@@ -7,6 +7,8 @@
public class <className>
{
+ private static final long serialVersionUID = 7952983928232702826L;
+
public static <returnType> <methodName>(<parameterTypes, parameterNames:{ type, name | <type> <name>}; separator=",\n">) throws Exception {
<text>
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/semantics/java/javaInvokers.stg
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/semantics/java/javaInvokers.stg 2006-05-31 17:07:01 UTC (rev 4527)
+++ labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/semantics/java/javaInvokers.stg 2006-05-31 17:07:13 UTC (rev 4528)
@@ -58,6 +58,8 @@
public class <invokerClassName> implements org.drools.spi.ReturnValueExpression, org.drools.semantics.java.CompiledInvoker
{
+ private static final long serialVersionUID = 7952983928232702826L;
+
public Object evaluate(org.drools.spi.Tuple tuple,
org.drools.rule.Declaration[] declarations,
org.drools.WorkingMemory workingMemory) throws Exception {
@@ -84,6 +86,8 @@
public class <invokerClassName> implements org.drools.spi.PredicateExpression, org.drools.semantics.java.CompiledInvoker
{
+ private static final long serialVersionUID = 7952983928232702826L;
+
public boolean evaluate(org.drools.spi.Tuple tuple,
org.drools.FactHandle factHandle,
org.drools.rule.Declaration declaration,
@@ -117,6 +121,8 @@
public class <invokerClassName> implements org.drools.spi.EvalExpression, org.drools.semantics.java.CompiledInvoker
{
+ private static final long serialVersionUID = 7952983928232702826L;
+
public boolean evaluate(org.drools.spi.Tuple tuple,
org.drools.rule.Declaration[] declarations,
org.drools.WorkingMemory workingMemory) throws Exception {
@@ -142,6 +148,8 @@
public class <invokerClassName> implements org.drools.spi.Consequence
{
+ private static final long serialVersionUID = 7952983928232702826L;
+
public void evaluate(org.drools.spi.KnowledgeHelper knowledgeHelper,
org.drools.WorkingMemory workingMemory) throws Exception {
|
Author: wrzep
Date: 2006-05-31 13:00:18 -0400 (Wed, 31 May 2006)
New Revision: 4526
Modified:
labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java
labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java
labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java
labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java
labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java
labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java
labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java
Log:
JBLAB-599
Pawel
Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-31 16:07:56 UTC (rev 4525)
+++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-31 17:00:18 UTC (rev 4526)
@@ -69,10 +69,10 @@
ObjectMessage message = (ObjectMessage) msg;
+ String requestName = null;
+
try {
- String requestName =
- message.getStringProperty(Constants.NAME_PROPERTY);
-
+ requestName = message.getStringProperty(Constants.NAME_PROPERTY);
log.info("Request name: " + requestName);
if (requestName.equals(Constants.SAVE_MESSAGE)) {
@@ -87,11 +87,11 @@
(GetScoresRequest) message.getObject();
handleRequest(getScoresRequest);
}
-
- log.info("Finished processing request: " + requestName);
+ log.info("Finished processing request: " + requestName);
+
} catch (JMSException e) {
- log.error(e); //TODO
+ log.warn("Error processing request: " + requestName, e);
}
}
@@ -103,7 +103,7 @@
try {
ScoresManagerSync.save(projects, pluginsConf);
} catch (ScoresSaveException e) {
- log.error(e); //TODO
+ log.warn("Error processing save request.", e);
}
}
@@ -116,7 +116,7 @@
try {
pluginsValues = ScoresManagerSync.getScores(cal);
} catch (GetScoresException e) {
- log.error(e); //TODO
+ log.warn("Error processing get request, returning null values.");
// If something is wrong, response will contain null pluginsValues
}
@@ -126,5 +126,4 @@
RecordManager.add(timestamp, response);
}
-
}
Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java 2006-05-31 16:07:56 UTC (rev 4525)
+++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java 2006-05-31 17:00:18 UTC (rev 4526)
@@ -218,7 +218,7 @@
try {
node = dir.getNode(nodeName);
} catch (Exception e) {
- log.error("Error while getting shotoku node " +
+ log.info("Unable to get shotoku node " +
dir.getFullName() + "/" + nodeName);
throw new GetScoresException(e);
}
Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java 2006-05-31 16:07:56 UTC (rev 4525)
+++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java 2006-05-31 17:00:18 UTC (rev 4526)
@@ -23,7 +23,6 @@
package org.jboss.forge.status.service.impl.protocol;
import java.util.Calendar;
-import java.util.Date;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
@@ -49,7 +48,7 @@
private Map<String,PluginValuesImpl> values;
/** Creation date */
- private Date date;
+ private Calendar cal;
/**
* @param projects Projects present in the Status Matrix
@@ -57,7 +56,7 @@
*/
public PluginsValuesImpl(Projects projects, Plugins plugins) {
- date = Calendar.getInstance().getTime();
+ cal = Calendar.getInstance();
values = new HashMap<String,PluginValuesImpl>();
@@ -101,8 +100,8 @@
/**
* @return creation date
*/
- public Date getDate() {
- return date;
+ public Calendar getDate() {
+ return cal;
}
public boolean hasPlugin(String pluginId) {
Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java 2006-05-31 16:07:56 UTC (rev 4525)
+++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java 2006-05-31 17:00:18 UTC (rev 4526)
@@ -43,8 +43,6 @@
String remoteString = (String) properties.get(Tags.SERVICE_REMOTE_ELEMENT);
remoteService = remoteString.equals("true");
-
- System.out.println("remote " + remoteService + "\n props: " + properties);
}
public boolean isRemote() {
Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java 2006-05-31 16:07:56 UTC (rev 4525)
+++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java 2006-05-31 17:00:18 UTC (rev 4526)
@@ -22,8 +22,7 @@
package org.jboss.forge.status.service.protocol;
-import java.util.Date;
-
+import java.util.Calendar;
import java.io.Serializable;
import org.jboss.forge.status.exceptions.GetScoresException;
@@ -51,7 +50,7 @@
/**
* @return creation date
*/
- public Date getDate();
+ public Calendar getDate();
public boolean hasPlugin(String pluginId);
Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java 2006-05-31 16:07:56 UTC (rev 4525)
+++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java 2006-05-31 17:00:18 UTC (rev 4526)
@@ -58,16 +58,13 @@
public class ScoresManager {
- private static boolean isRemote;
private static Properties properties;
+ private Timestamp latestScoresTimestamp;
public static void init(String portalName, ServiceConf serviceConf) {
ScoresManagerSync.init(portalName, serviceConf);
- isRemote = serviceConf.isRemote();
- System.out.println("remote: " + isRemote);
-
properties = serviceConf.getProperties();
}
@@ -75,8 +72,6 @@
throws ScoresSaveException {
SaveRequest saveRequest = new SaveRequestImpl(pluginsConf, projects);
- //TODO request factory
- //conf factory?
// Send message
try {
Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java 2006-05-31 16:07:56 UTC (rev 4525)
+++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java 2006-05-31 17:00:18 UTC (rev 4526)
@@ -57,7 +57,6 @@
ScoresManagerSync.portalName = portalName;
isRemote = serviceConf.isRemote();
- System.out.println("remote: " + isRemote);
properties = serviceConf.getProperties();
}
|
|
From: <jbo...@li...> - 2006-05-31 16:08:04
|
Author: adamw Date: 2006-05-31 12:07:56 -0400 (Wed, 31 May 2006) New Revision: 4525 Added: labs/shotoku/trunk/shotoku-tags/ labs/shotoku/trunk/shotoku-tags/maven.xml labs/shotoku/trunk/shotoku-tags/project.properties labs/shotoku/trunk/shotoku-tags/project.xml labs/shotoku/trunk/shotoku-tags/shotoku-tags.iml labs/shotoku/trunk/shotoku-tags/src/ labs/shotoku/trunk/shotoku-tags/src/java/ labs/shotoku/trunk/shotoku-tags/src/java/org/ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagService.java labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagTools.java labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceLocal.java Log: http://jira.jboss.com/jira/browse/JBSHOTOKU-86 Initial checkin Property changes on: labs/shotoku/trunk/shotoku-tags ___________________________________________________________________ Name: svn:ignore + target Added: labs/shotoku/trunk/shotoku-tags/maven.xml =================================================================== --- labs/shotoku/trunk/shotoku-tags/maven.xml 2006-05-31 15:52:22 UTC (rev 4524) +++ labs/shotoku/trunk/shotoku-tags/maven.xml 2006-05-31 16:07:56 UTC (rev 4525) @@ -0,0 +1,17 @@ +<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> + <goal name="clean"> + <attainGoal name="prj-clean" /> + </goal> + + <goal name="build"> + <attainGoal name="java:compile" /> + <attainGoal name="ejb" /> + </goal> + + <goal name="deploy"> + <ant:copy + file="target/shotoku-tags.jar" + tofile="../target/${shotoku.sar.dir}/shotoku-tags.ejb3" + overwrite="true" /> + </goal> +</project> Added: labs/shotoku/trunk/shotoku-tags/project.properties =================================================================== --- labs/shotoku/trunk/shotoku-tags/project.properties 2006-05-31 15:52:22 UTC (rev 4524) +++ labs/shotoku/trunk/shotoku-tags/project.properties 2006-05-31 16:07:56 UTC (rev 4525) @@ -0,0 +1,4 @@ +maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/ + +maven.final.name=${pom.artifactId} + Added: labs/shotoku/trunk/shotoku-tags/project.xml =================================================================== --- labs/shotoku/trunk/shotoku-tags/project.xml 2006-05-31 15:52:22 UTC (rev 4524) +++ labs/shotoku/trunk/shotoku-tags/project.xml 2006-05-31 16:07:56 UTC (rev 4525) @@ -0,0 +1,25 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> +<project> + <pomVersion>3</pomVersion> + <extend>../project.xml</extend> + <id>shotoku-tags</id> + <name>Shotoku tags</name> + + <dependencies> + <dependency> + <groupId>shotoku</groupId> + <artifactId>shotoku-base</artifactId> + <jar>shotoku-base.jar</jar> + </dependency> + </dependencies> + + <build> + <sourceDirectory>src/java</sourceDirectory> + <resources> + <resource> + <directory>src/etc/</directory> + <include>**/*.xml</include> + </resource> + </resources> + </build> +</project> Added: labs/shotoku/trunk/shotoku-tags/shotoku-tags.iml =================================================================== --- labs/shotoku/trunk/shotoku-tags/shotoku-tags.iml 2006-05-31 15:52:22 UTC (rev 4524) +++ labs/shotoku/trunk/shotoku-tags/shotoku-tags.iml 2006-05-31 16:07:56 UTC (rev 4525) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module version="4" relativePaths="true" type="JAVA_MODULE"> + <component name="ModuleRootManager" /> + <component name="NewModuleRootManager"> + <output url="file://$MODULE_DIR$/target" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="shotoku-aop" /> + <orderEntry type="module" module-name="shotoku-base" /> + <orderEntry type="library" name="jboss" level="application" /> + <orderEntry type="library" name="commons" level="application" /> + <orderEntryProperties /> + </component> +</module> + Added: labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagService.java =================================================================== --- labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagService.java 2006-05-31 15:52:22 UTC (rev 4524) +++ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagService.java 2006-05-31 16:07:56 UTC (rev 4525) @@ -0,0 +1,10 @@ +package org.jboss.shotoku.tags; + +import org.jboss.shotoku.service.AdministratedService; + +/** + * @author Adam Warski (ad...@as...) + */ +public interface TagService extends AdministratedService { + +} Added: labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagTools.java =================================================================== --- labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagTools.java 2006-05-31 15:52:22 UTC (rev 4524) +++ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagTools.java 2006-05-31 16:07:56 UTC (rev 4525) @@ -0,0 +1,43 @@ +package org.jboss.shotoku.tags; + +import org.jboss.shotoku.ContentManager; +import org.jboss.shotoku.tags.service.TagServiceImpl; +import org.jboss.mx.util.MBeanProxyExt; +import org.jboss.mx.util.MBeanServerLocator; + +/** + * @author Adam Warski (ad...@as...) + */ +public class TagTools { + public static final String TAG_SERVICE_NAME = "shotoku:service=tag"; + + private static TagService instance; + + /** + * Gets an instance of Shotoku tag service - this should be always the same + * the object, so the dirty sets work properly. + * @return An instance of org.jboss.shotoku.svn.SvnService + */ + public static TagService getService() { + try { + if (instance == null) { + if (ContentManager.isEmbedded()) { + // Embedded mode - simply creating a new service instance. + instance = new TagServiceImpl(); + instance.create(); + instance.start(); + } else { + // Application server mode - creating a proxy to a mbean. + instance = (TagService) MBeanProxyExt.create( + TagService.class, + TAG_SERVICE_NAME, + MBeanServerLocator.locate()); + } + } + + return instance; + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} Added: labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java =================================================================== --- labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java 2006-05-31 15:52:22 UTC (rev 4524) +++ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java 2006-05-31 16:07:56 UTC (rev 4525) @@ -0,0 +1,141 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.shotoku.tags.service; + +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ConcurrentHashMap; +import java.util.Calendar; +import java.util.Set; + +import javax.ejb.Local; + +import org.apache.commons.configuration.Configuration; +import org.apache.log4j.Logger; +import org.jboss.annotation.ejb.Management; +import org.jboss.annotation.ejb.Service; +import org.jboss.annotation.ejb.Depends; +import org.jboss.shotoku.svn.SvnService; +import org.jboss.shotoku.svn.SvnTools; +import org.jboss.shotoku.svn.SvnContentManager; +import org.jboss.shotoku.svn.service.delayed.DelayedOperation; +import org.jboss.shotoku.tools.Constants; +import org.jboss.shotoku.tools.Tools; +import org.jboss.shotoku.service.AdministratedServiceImpl; +import org.jboss.shotoku.service.AdministratedServiceGetter; +import org.jboss.shotoku.service.AdministratedService; +import org.jboss.shotoku.ContentManager; +import org.jboss.shotoku.tags.service.TagServiceLocal; +import org.jboss.shotoku.tags.TagService; +import org.jboss.shotoku.tags.TagTools; +import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; +import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl; + +/** + * @author Adam Warski (ad...@as...) + * @author Damon Sicore (da...@si...) + */ +@Service(objectName=TagTools.TAG_SERVICE_NAME) +@Local(TagServiceLocal.class) +@Management(TagService.class) +@Depends(Constants.SHOTOKU_SERVICE_NAME) +public class TagServiceImpl extends AdministratedServiceImpl + implements TagService, TagServiceLocal { + private static final Logger log = Logger.getLogger(TagService.class); + + /* + * Service lifecycle management. + */ + + public void create() throws Exception { + super.create(); + + // Enabling administration for this service. + Tools.getService().addAdministratedService(new AdministratedServiceGetter() { + public AdministratedService getService() { + return TagTools.getService(); + } + }); + + log.info("Tag service created."); + } + + public void start() throws Exception { + super.start(); + + // Starting the updater thread. + new Thread() { + { + setDaemon(true); + } + + public void run() { + while (getServiceRunnable()) { + try { + sleep(getTimerInterval()); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + try { + update(); + } catch (Throwable t) { + // Making sure that an exception won't stop the thread. + } + + setLastUpdate(Calendar.getInstance().getTimeInMillis()); + } + + log.info("Tag service deaemon thread terminated."); + } + }.start(); + + log.info("Tag service started with update interval: "+ getTimerInterval()); + } + + public void stop() { + super.stop(); + log.info("Tag service signaled to stop."); + } + + public void destroy() { + } + + /* + * Timer-handling functions. + */ + + public void update() { + + } + + public String getServiceId() { + return "ShotokuTagService"; + } + + public String getServiceName() { + return "Tag service"; + } + + public String getServiceDescription() { + return "Shotoku tag service"; + } +} Added: labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceLocal.java =================================================================== --- labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceLocal.java 2006-05-31 15:52:22 UTC (rev 4524) +++ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceLocal.java 2006-05-31 16:07:56 UTC (rev 4525) @@ -0,0 +1,30 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.shotoku.tags.service; + +/** + * @author Adam Warski (ad...@as...) + * @author Damon Sicore (da...@si...) + */ +public interface TagServiceLocal { + +} |
|
From: <jbo...@li...> - 2006-05-31 15:52:27
|
Author: jfr...@jb...
Date: 2006-05-31 11:52:22 -0400 (Wed, 31 May 2006)
New Revision: 4524
Modified:
labs/jbossweb/trunk/src/share/native/build/buildphp.sh
Log:
Typos.
Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh
===================================================================
--- labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-31 15:21:16 UTC (rev 4523)
+++ labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-31 15:52:22 UTC (rev 4524)
@@ -38,6 +38,7 @@
CACHE=`uname -s`_`uname -p`_cache
# default value for variables.
+BUILDKRB5=true
BUILDGTTX=true
BUILDXML2=true
BUILDPSQL=true
@@ -227,7 +228,7 @@
ADDCONF="\
--with-freetype-dir \
--with-t1lib=no \
- --with-xpm-dir=no \
+ --with-xpm-dir \
--with-mysqli \
--with-mysql \
--with-pdo-mysql \
@@ -253,7 +254,6 @@
esac
esac
-KRB5URL=http://web.mit.edu/kerberos/dist/krb5/1.4/krb5-${KRB5VER}-signed.tar
#
# build kerberos if required.
if ${BUILDKRB5}
|
|
From: <jbo...@li...> - 2006-05-31 15:21:23
|
Author: adamw Date: 2006-05-31 11:21:16 -0400 (Wed, 31 May 2006) New Revision: 4523 Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/InformaBasedFeed.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/RomeBasedFeed.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java Log: http://jira.jboss.com/jira/browse/JBSHOTOKU-36 Improved date handling Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/InformaBasedFeed.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/InformaBasedFeed.java 2006-05-31 14:37:46 UTC (rev 4522) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/InformaBasedFeed.java 2006-05-31 15:21:16 UTC (rev 4523) @@ -3,10 +3,7 @@ import java.io.File; import java.io.IOException; import java.net.URL; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.List; +import java.util.*; import de.nava.informa.core.ChannelExporterIF; import de.nava.informa.core.ChannelIF; @@ -35,10 +32,11 @@ newChannel.setCreator(author); newChannel.setPublisher(author); newChannel.setLocation(new URL(link)); - newChannel.setPubDate(Calendar.getInstance().getTime()); List<ItemIF> newItems = new ArrayList<ItemIF>(); + long pubDate = 0; + for (Feed feed : feeds) { ChannelIF childChannel; try { @@ -51,9 +49,16 @@ ItemIF nextItem = (ItemIF) o; nextItem.setCreator(childChannel.getCreator()); newItems.add(nextItem); + + long itemDate = nextItem.getDate().getTime(); + if (itemDate > pubDate) { + pubDate = itemDate; + } } } + newChannel.setPubDate(new Date(pubDate)); + Collections.sort(newItems, new ItemComparator(true)); for (ItemIF newItem : newItems) { Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/RomeBasedFeed.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/RomeBasedFeed.java 2006-05-31 14:37:46 UTC (rev 4522) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/RomeBasedFeed.java 2006-05-31 15:21:16 UTC (rev 4523) @@ -62,6 +62,8 @@ List entries = new ArrayList(); syndFeed.setEntries(entries); + long pubDate = 0; + for (Feed feed : feeds) { SyndFeedInput input = new SyndFeedInput(); SyndFeed inFeed; @@ -78,10 +80,17 @@ SyndEntry entry = (SyndEntry) o; entry.setAuthor(inFeed.getAuthor()); entries.add(entry); + + long entryDate = entry.getPublishedDate().getTime(); + if (entryDate > pubDate) { + pubDate = entryDate; + } } } } + syndFeed.setPublishedDate(new Date(pubDate)); + Collections.sort(entries, new Comparator<SyndEntry>() { public int compare(SyndEntry o1, SyndEntry o2) { Date date1 = o1.getPublishedDate(); Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java 2006-05-31 14:37:46 UTC (rev 4522) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java 2006-05-31 15:21:16 UTC (rev 4523) @@ -158,6 +158,17 @@ vc.put(searchNameAttr, list); + // Calculating the age of the youngest node and putting it into the context. + long youngestNode = 0; + for (org.jboss.shotoku.Node n : list) { + long nodeCreated = n.getCreated(); + if (nodeCreated > youngestNode) { + youngestNode = nodeCreated; + } + } + + vc.put(searchNameAttr + "Youngest", new Date(youngestNode)); + break; } catch (Exception e) { log.error("Error generating shotoku feed " + getFeedName() + ".", e); |
Author: adamw Date: 2006-05-31 10:37:46 -0400 (Wed, 31 May 2006) New Revision: 4522 Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/TextEscaping.java labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/FileAccessServlet.java Log: http://jira.jboss.com/jira/browse/JBSHOTOKU-85 Some other fixes Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java 2006-05-31 14:37:30 UTC (rev 4521) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java 2006-05-31 14:37:46 UTC (rev 4522) @@ -30,8 +30,8 @@ } public void update(Pair<String, String> key, FeedsDescriptor currentObject) { - //put(key, getDesc(key.getFirst(), key.getSecond())); - //currentObject.release(); + put(key, getDesc(key.getFirst(), key.getSecond())); + currentObject.release(); } public FeedsDescriptor init(Pair<String, String> key) { Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/TextEscaping.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/TextEscaping.java 2006-05-31 14:37:30 UTC (rev 4521) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/TextEscaping.java 2006-05-31 14:37:46 UTC (rev 4522) @@ -52,7 +52,7 @@ * commonly seen in building query strings. (In JSTL, the c:url tag performs * this task automatically.) */ - public static String tags(String aTagFragment) { + public static String all(String aTagFragment) { if (aTagFragment == null) return null; @@ -103,7 +103,7 @@ * database. This occurs because the ampersand is the only escaped character * which appears in a character entity. */ - public static String all(String aText) { + public static String tags(String aText) { if (aText == null) return null; Modified: labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/FileAccessServlet.java =================================================================== --- labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/FileAccessServlet.java 2006-05-31 14:37:30 UTC (rev 4521) +++ labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/FileAccessServlet.java 2006-05-31 14:37:46 UTC (rev 4522) @@ -104,15 +104,12 @@ // Transferring the bytes try { Tools.transfer(ci.getIs(), os); - } catch (Exception e2) { - // Nothing that we can really do. Just send an incomplete - // file. } finally { os.close(); ci.getIs().close(); } } catch (Exception e) { - e.printStackTrace(); + log.info("Unable to send a file.", e); writeErrorMessage(response); } } |
|
From: <jbo...@li...> - 2006-05-31 14:37:37
|
Author: adamw
Date: 2006-05-31 10:37:30 -0400 (Wed, 31 May 2006)
New Revision: 4521
Modified:
labs/jbosslabs/trunk/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
Log:
Blog shortert urls
Modified: labs/jbosslabs/trunk/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 14:20:53 UTC (rev 4520)
+++ labs/jbosslabs/trunk/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 14:37:30 UTC (rev 4521)
@@ -82,7 +82,7 @@
}
private String getJsp(JBossRenderRequest request) {
- return request.getPreferences().getValue("jsp", "");
+ return request.getPreferences().getValue("jsp", "");
}
public void doView(JBossRenderRequest request, JBossRenderResponse response)
@@ -92,12 +92,12 @@
String portalName = ForgeHelper.getPortalName(request);
Properties config = configuration.get(portalName);
-
+
PortalContext portalCtx = request.getPortalContext();
String projectId = ProjectsHelper.getSelectedProjectId(request, false);
if (projectId == null)
- projectId = config.getProperty("default.feed");
+ projectId = config.getProperty("default.feed");
// Getting the number of headers and entries to display
int headersNormal = Integer.valueOf(
@@ -114,8 +114,8 @@
ProjectsHelper.getProjects(portalName).getProjectProperty(projectId, "feed-address");
if ((projectFeedAddress != null) && (!"".equals(projectFeedAddress))) {
- feedAddress = projectFeedAddress;
- remoteFeedAddress = projectFeedAddress;
+ feedAddress = projectFeedAddress;
+ remoteFeedAddress = projectFeedAddress;
}
feedAddress = replaceProperty(feedAddress, "${host.address}", request
@@ -125,9 +125,9 @@
feedAddress = replaceProperty(feedAddress, "${host.port}", Integer
.toString(request.getServerPort()));
if (projectId != null)
- feedAddress = replaceProperty(feedAddress, "${project.name}", projectId);
+ feedAddress = replaceProperty(feedAddress, "${project.name}", projectId);
else
- feedAddress = replaceProperty(feedAddress, "${project.name}", "default");
+ feedAddress = replaceProperty(feedAddress, "${project.name}", "default");
feedAddress = replaceProperty(feedAddress, "${portal.name}", portalName);
feedAddress = replaceProperty(feedAddress, "${feed.type}", config.getProperty("default.feed.type"));
@@ -217,7 +217,7 @@
* Name of the page to display.
*/
void writePage(JBossRenderRequest request, JBossRenderResponse response,
- String name) {
+ String name) {
try {
PortletRequestDispatcher rd = getPortletContext()
.getRequestDispatcher(name);
@@ -254,10 +254,10 @@
* @return True iff an entry was found matching <code>mainEntryLink</code>.
*/
private boolean setBlogContext(JBossRenderRequest request,
- JBossRenderResponse response, SyndFeed feed, int fromEntry,
- int toEntry, int showEntries, String mainEntryLink,
- String desiredWindowState, String currentWindowState,
- String projectId, String portalName, String feedTypeFreeAddress) {
+ JBossRenderResponse response, SyndFeed feed, int fromEntry,
+ int toEntry, int showEntries, String mainEntryLink,
+ String desiredWindowState, String currentWindowState,
+ String projectId, String portalName, String feedTypeFreeAddress) {
List entries = feed.getEntries();
DelegateContext root = new DelegateContext();
String defaultAuthor = feed.getAuthor();
@@ -279,6 +279,18 @@
if ((author == null) || (author.equals("")))
author = defaultAuthor;
+ String tag = entry.getTitle();
+ if (tag != null) {
+ tag = tag.replace(" ", "_");
+ try {
+ tag = URLEncoder.encode(tag, "UTF-8");
+ } catch (UnsupportedEncodingException e) {}
+ } else {
+ tag = "";
+ }
+
+ entryContext.put("tag", tag);
+
entryContext.put("date", DateFormat.getDateInstance(
DateFormat.FULL, request.getLocale()).format(
entry.getPublishedDate()));
|
|
From: <jbo...@li...> - 2006-05-31 14:20:59
|
Author: jfr...@jb... Date: 2006-05-31 10:20:53 -0400 (Wed, 31 May 2006) New Revision: 4520 Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh Log: Add kerberos and gettext. Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh =================================================================== --- labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-31 14:19:15 UTC (rev 4519) +++ labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-31 14:20:53 UTC (rev 4520) @@ -27,16 +27,23 @@ JPEGVER="6b" JPEGURL=http://www.ijg.org/files/jpegsrc.v${JPEGVER}.tar.gz +GTTXVER="0.14.5" +GTTXURL=ftp://ftp.gnu.org/gnu/gettext/gettext-${GTTXVER}.tar.gz + +KRB5VER="1.4.3" +KRB5URL=http://web.mit.edu/kerberos/dist/krb5/1.4/krb5-${KRB5VER}-signed.tar + # Platfrom directory and cache TOOLS=$HOME/`uname -s`_`uname -p`_tools CACHE=`uname -s`_`uname -p`_cache # default value for variables. -BUILDXML2=false -BUILDPSQL=false -BUILDOSSL=false -BUILDLPNG=false -BUILDJPEG=false +BUILDGTTX=true +BUILDXML2=true +BUILDPSQL=true +BUILDOSSL=true +BUILDLPNG=true +BUILDJPEG=true CC=gcc COMPILER="" @@ -58,7 +65,16 @@ fi if [ ! -d ${BASE}-${VER} ] then - gzip -dc ${FILE} | tar xvf - + case ${FILE} in + *.tar.gz) + gzip -dc ${FILE} | tar xvf - + ;; + *signed.tar) + # MIT stuff + tar xvf ${FILE} + gzip -dc ${BASE}-${VER}.tar.gz | tar xvf - + ;; + esac # Check if patches available. if [ -f patch/${BASE}-${VER}.patch ] then @@ -75,10 +91,17 @@ # $4 : Additional make command Build() { -SRCDIR=$1 +BASDIR=$1 INSDIR=$2 ADDCON=$3 ADDINS=$4 +SUBDIR=$5 +if [ -z ${SUBDIR} ] +then + SRCDIR=${BASDIR} +else + SRCDIR=${BASDIR}/${SUBDIR} +fi (cd ${SRCDIR} if [ ${CC} = "cc" ] then @@ -201,11 +224,6 @@ ADDFLAGS="-I $JAVA_HOME/include/solaris" ;; *) - BUILDXML2=true - BUILDPSQL=true - BUILDOSSL=true - BUILDLPNG=true - BUILDJPEG=true ADDCONF="\ --with-freetype-dir \ --with-t1lib=no \ @@ -235,7 +253,30 @@ esac esac +KRB5URL=http://web.mit.edu/kerberos/dist/krb5/1.4/krb5-${KRB5VER}-signed.tar # +# build kerberos if required. +if ${BUILDKRB5} +then + Extract krb5 ${KRB5URL} ${KRB5VER} + Build krb5-${KRB5VER} ${TOOLS}/KRB5 "--enable-shared --with-tcl=no" "" "src" + ADDCONF="$ADDCONF --with-kerberos=$TOOLS/KRB5" +else + ADDCONF="$ADDCONF --with-kerberos" +fi + +# +# build gettext if required. +if ${BUILDGTTX} +then + Extract gettext ${GTTXURL} ${GTTXVER} + Build gettext-${GTTXVER} ${TOOLS}/GTTX "--enable-shared" + ADDCONF="$ADDCONF --with-gettext=$TOOLS/GTTX" +else + ADDCONF="$ADDCONF --with-gettext" +fi + +# # build lib jpeg if required if ${BUILDJPEG} then |
|
From: <jbo...@li...> - 2006-05-31 14:19:18
|
Author: adamw
Date: 2006-05-31 10:19:15 -0400 (Wed, 31 May 2006)
New Revision: 4519
Modified:
labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
Log:
Debugging blog.
Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
===================================================================
--- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 14:08:34 UTC (rev 4518)
+++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 14:19:15 UTC (rev 4519)
@@ -301,10 +301,6 @@
entryContext.put("link", entry.getLink());
entryContext.put("tag", tag);
- System.out.println("REQ: " + mainEntryLink);
- System.out.println("TAG: " + tag);
- System.out.println("");
-
if ((showedEntries++ < showEntries)
|| (tag.equals(mainEntryLink)))
entryContext.next("show");
|
|
From: <jbo...@li...> - 2006-05-31 14:08:39
|
Author: adamw
Date: 2006-05-31 10:08:34 -0400 (Wed, 31 May 2006)
New Revision: 4518
Modified:
labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
Log:
Debugging blog.
Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
===================================================================
--- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 14:03:12 UTC (rev 4517)
+++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 14:08:34 UTC (rev 4518)
@@ -283,6 +283,9 @@
String tag = entry.getTitle();
if (tag != null) {
tag = tag.replace(" ", "_");
+ try {
+ tag = URLEncoder.encode(tag, "UTF-8");
+ } catch (UnsupportedEncodingException e) {}
} else {
tag = "";
}
|
|
From: <jbo...@li...> - 2006-05-31 14:03:17
|
Author: adamw
Date: 2006-05-31 10:03:12 -0400 (Wed, 31 May 2006)
New Revision: 4517
Modified:
labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
Log:
Debugging blog.
Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
===================================================================
--- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 13:53:52 UTC (rev 4516)
+++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 14:03:12 UTC (rev 4517)
@@ -297,6 +297,11 @@
entryContext.put("content", content.getValue());
entryContext.put("link", entry.getLink());
entryContext.put("tag", tag);
+
+ System.out.println("REQ: " + mainEntryLink);
+ System.out.println("TAG: " + tag);
+ System.out.println("");
+
if ((showedEntries++ < showEntries)
|| (tag.equals(mainEntryLink)))
entryContext.next("show");
|
|
From: <jbo...@li...> - 2006-05-31 13:53:54
|
Author: adamw
Date: 2006-05-31 09:53:52 -0400 (Wed, 31 May 2006)
New Revision: 4516
Modified:
labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
Log:
Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java
===================================================================
--- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 13:16:01 UTC (rev 4515)
+++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2006-05-31 13:53:52 UTC (rev 4516)
@@ -148,8 +148,9 @@
// Name of the entry to expand
String blogLink = ForgeHelper.getRequestParameter(request, "link");
- if (blogLink != null)
- blogLink = URLDecoder.decode(blogLink, "UTF-8");
+ if (blogLink != null) {
+ // blogLink = URLDecoder.decode(blogLink, "UTF-8");
+ }
// A string denoting the number of the first displayed entry
String fromEntryString = ForgeHelper.getRequestParameter(request,
@@ -279,7 +280,13 @@
if ((author == null) || (author.equals("")))
author = defaultAuthor;
- entryContext.put("date", DateFormat.getDateInstance(
+ String tag = entry.getTitle();
+ if (tag != null) {
+ tag = tag.replace(" ", "_");
+ } else {
+ tag = "";
+ }
+ entryContext.put("date", DateFormat.getDateInstance(
DateFormat.FULL, request.getLocale()).format(
entry.getPublishedDate()));
entryContext.put("time", DateFormat.getTimeInstance(
@@ -289,8 +296,9 @@
entryContext.put("title", entry.getTitle());
entryContext.put("content", content.getValue());
entryContext.put("link", entry.getLink());
+ entryContext.put("tag", tag);
if ((showedEntries++ < showEntries)
- || (entry.getLink().equals(mainEntryLink)))
+ || (tag.equals(mainEntryLink)))
entryContext.next("show");
else
entryContext.next("dontShow");
@@ -340,4 +348,4 @@
return found;
}
-}
\ No newline at end of file
+}
|
|
From: <jbo...@li...> - 2006-05-31 13:16:27
|
Author: adamw
Date: 2006-05-31 09:16:01 -0400 (Wed, 31 May 2006)
New Revision: 4515
Modified:
labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-feeds/src/java/org/jboss/forge/feeds/TextEscaping.java
Log:
Improved amp support
Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-feeds/src/java/org/jboss/forge/feeds/TextEscaping.java
===================================================================
--- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-feeds/src/java/org/jboss/forge/feeds/TextEscaping.java 2006-05-31 13:07:36 UTC (rev 4514)
+++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-feeds/src/java/org/jboss/forge/feeds/TextEscaping.java 2006-05-31 13:16:01 UTC (rev 4515)
@@ -52,7 +52,7 @@
* commonly seen in building query strings. (In JSTL, the c:url tag performs
* this task automatically.)
*/
- public static String tags(String aTagFragment) {
+ public static String all(String aTagFragment) {
if (aTagFragment == null)
return null;
@@ -103,7 +103,7 @@
* database. This occurs because the ampersand is the only escaped character
* which appears in a character entity.
*/
- public static String all(String aText) {
+ public static String tags(String aText) {
if (aText == null)
return null;
|
|
From: <jbo...@li...> - 2006-05-31 13:07:39
|
Author: adamw
Date: 2006-05-31 09:07:36 -0400 (Wed, 31 May 2006)
New Revision: 4514
Modified:
labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-file-access/src/java/org/jboss/forge/fileaccess/FileAccessFilter.java
Log:
Switching off printing of "ResourceDoesNotExist" exceptions
Modified: labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-file-access/src/java/org/jboss/forge/fileaccess/FileAccessFilter.java
===================================================================
--- labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-file-access/src/java/org/jboss/forge/fileaccess/FileAccessFilter.java 2006-05-31 12:11:15 UTC (rev 4513)
+++ labs/jbosslabs/branches/Labs-Portal-2.0-ComTheme/forge/portal-extensions/forge-file-access/src/java/org/jboss/forge/fileaccess/FileAccessFilter.java 2006-05-31 13:07:36 UTC (rev 4514)
@@ -220,7 +220,7 @@
is.close();
}
} catch (Exception e1) {
- e1.printStackTrace();
+ //e1.printStackTrace();
response.setContentType("text/html");
response.getWriter().println(ACCESS_DENIED);
}
|