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-01-20 10:39:25
|
Author: mic...@jb... Date: 2006-01-20 05:39:14 -0500 (Fri, 20 Jan 2006) New Revision: 2153 Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java Log: documentation improvements Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java 2006-01-20 09:35:25 UTC (rev 2152) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java 2006-01-20 10:39:14 UTC (rev 2153) @@ -42,6 +42,7 @@ RepositoryManager manager = (RepositoryManager) Proxy.newProxyInstance(RepositoryFactory.class.getClassLoader(), new Class[] {RepositoryManager.class}, handler); + return manager; } Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-20 09:35:25 UTC (rev 2152) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-20 10:39:14 UTC (rev 2153) @@ -155,7 +155,7 @@ * @param query HQL query. Can be of the format "from ClassName where propertyName = :variableInMap" * You can also do "select name from RuleSetDef where ..." and so on. It will then return a list * of strings. If you do "select name, Id from RuleDef .." it will return a list of Object[] "tuples". - * @param parameters A map of name => value (in appropriate type) to mix in with the query. + * @param parameters A map of {name => value} (in appropriate type) to mix in with the query. * */ public abstract List query(String query, Map parameters); |
Author: mic...@jb... Date: 2006-01-20 04:35:25 -0500 (Fri, 20 Jan 2006) New Revision: 2152 Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Asset.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/DDLGenerator.java trunk/labs/jbossrules/drools-repository/src/main/resources/drools-repository-db.cfg.xml Removed: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Asset.java Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/HibernateUtil.java trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml Log: refactor, added DDL generation Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -1,7 +1,6 @@ package org.drools.repository; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Asset; /** * Application data contains a definition of objects that may be provided to the Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Asset.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Asset.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Asset.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -0,0 +1,19 @@ +package org.drools.repository; + +import java.io.Serializable; + +/** The layer supertype for repository persistable classes. */ +public class Asset implements Serializable { + + private Long id; + + public Long getId(){ + return id; + } + + private void setId(Long id){ + this.id = id; + } + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Asset.java ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -1,7 +1,6 @@ package org.drools.repository; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Asset; /** * A FunctionDef contains the definition of a function that is used in one or more rules. Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -1,7 +1,6 @@ package org.drools.repository; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Asset; /** * This holds a type import for a ruleset. Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -1,6 +1,8 @@ package org.drools.repository; import java.lang.reflect.Proxy; +import java.security.Principal; +import java.security.acl.Permission; import org.drools.repository.db.RepoProxyHandler; @@ -17,7 +19,7 @@ /** * The default repository. This is stateless, meaning that a continuous connection is not required. */ - public static RepositoryManager getRepository() { + public static RepositoryManager getRepository() { RepoProxyHandler handler = new RepoProxyHandler(); RepositoryManager manager = getProxy( handler ); return manager; Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -4,7 +4,6 @@ import java.util.Map; import java.util.Properties; -import org.drools.repository.db.Asset; import org.drools.repository.db.ISaveHistory; /** @@ -19,6 +18,7 @@ * If it is a stateful Repository, then it will need to be created from the factory fresh. * * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + * @author <a href ="mailto:suj...@co..."> Sujit Pal</a> */ public interface RepositoryManager { Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -7,7 +7,6 @@ import java.util.Properties; -import org.drools.repository.db.Asset; import org.drools.repository.db.ISaveHistory; import org.hibernate.Query; import org.hibernate.Session; Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -7,7 +7,6 @@ import org.drools.repository.db.ISaveHistory; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Asset; public class RuleDef extends Asset implements Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -5,7 +5,6 @@ import org.drools.repository.db.ISaveHistory; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Asset; /** Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -7,7 +7,6 @@ import java.util.Set; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Asset; /** * The ruleset definition contains a grouping of rules for editing/release. The Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -2,7 +2,6 @@ import java.util.Date; -import org.drools.repository.db.Asset; /** * This records information about a particular version of a ruleset. Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -5,7 +5,6 @@ import java.util.Iterator; import java.util.Set; -import org.drools.repository.db.Asset; /** Deleted: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Asset.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Asset.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Asset.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -1,19 +0,0 @@ -package org.drools.repository.db; - -import java.io.Serializable; - -/** The layer supertype for repository persistable classes. */ -public class Asset implements Serializable { - - private Long id; - - public Long getId(){ - return id; - } - - private void setId(Long id){ - this.id = id; - } - - -} Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/DDLGenerator.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/DDLGenerator.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/DDLGenerator.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -0,0 +1,16 @@ +package org.drools.repository.db; + +import org.hibernate.tool.hbm2ddl.SchemaExport; + +public class DDLGenerator { + + /** + * This will generate DDL for the current config. + * No args are required, will spit it to standard out. + */ + public static void main(String[] args) { + SchemaExport exporter = new SchemaExport(HibernateUtil.getConfiguration()); + exporter.create(true, false); + } + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/DDLGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/HibernateUtil.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/HibernateUtil.java 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/HibernateUtil.java 2006-01-20 09:35:25 UTC (rev 2152) @@ -14,6 +14,8 @@ import org.hibernate.cfg.Configuration; /** + * This is the central config point for hibernate. + * * The usual infamous hibernate helper, with a few tweaks. * I have made the sessionFactory non final to allow reconfiguration if necessary. * @@ -23,7 +25,6 @@ public class HibernateUtil { public static final String DROOLS_REPOSITORY_CONFIG = "drools-repository-db.cfg.xml"; - private static SessionFactory sessionFactory; static { @@ -43,14 +44,19 @@ * May be called again to re-establish the factory if needed. */ public static void configureSessionFactory() { + Configuration cfg = getConfiguration(); + sessionFactory = cfg.buildSessionFactory(); + } + + /** Return the hibernate configuration as it stands */ + public static Configuration getConfiguration() { Configuration cfg = new Configuration(); cfg.setInterceptor( new StoreEventListener() ); registerPersistentClasses( cfg ); // cfg.setProperty("connection.username", "sa"); // cfg.setProperty("connection.password", ""); cfg.configure(DROOLS_REPOSITORY_CONFIG); - - sessionFactory = cfg.buildSessionFactory(); + return cfg; } /** Added: trunk/labs/jbossrules/drools-repository/src/main/resources/drools-repository-db.cfg.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/drools-repository-db.cfg.xml 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/drools-repository-db.cfg.xml 2006-01-20 09:35:25 UTC (rev 2152) @@ -0,0 +1,52 @@ +<?xml version='1.0' encoding='utf-8'?> +<!DOCTYPE hibernate-configuration PUBLIC + "-//Hibernate/Hibernate Configuration DTD 3.0//EN" + "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> + +<!-- + **** Drools Repository database configuration. **** + As you can see from the DTD, this makes use of Hibernate 3 for persistence and querying. + + This file is configured for HSQLDB in memory operation (not recommended for production). + + ****************************************************************************** + To provide your own configuration, place your own drools-repository-db.cfg.xml + in the front of the classpath (at the root). + ****************************************************************************** + --> + +<hibernate-configuration> + + <session-factory> + + <!-- Database connection settings --> + <property name="connection.driver_class">org.hsqldb.jdbcDriver</property> + <property name="connection.url">jdbc:hsqldb:mem:unittest</property> + + <property name="connection.username">sa</property> + <property name="connection.password"></property> + + <!-- JDBC connection pool (use the built-in) --> + <property name="connection.pool_size">1</property> + + <!-- SQL dialect --> + <property name="dialect">org.hibernate.dialect.HSQLDialect</property> + + <!-- Enable Hibernate's automatic session context management --> + <property name="current_session_context_class">thread</property> + + <!-- Disable the second-level cache --> + <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> + + <!-- Echo all executed SQL to stdout --> + <property name="show_sql">false</property> + + <!-- Drop and re-create the database schema on startup + <property name="hbm2ddl.auto">create</property> + --> + + </session-factory> + + + +</hibernate-configuration> \ No newline at end of file Property changes on: trunk/labs/jbossrules/drools-repository/src/main/resources/drools-repository-db.cfg.xml ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml 2006-01-20 09:35:25 UTC (rev 2152) @@ -32,7 +32,7 @@ <one-to-many class="org.drools.repository.Tag" /> </set> - <many-to-one name="owningRuleSet" /> + <many-to-one name="owningRuleSet" column="OWNING_RULESET_ID" /> <component name="metaData"> <property name="title" /> Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml 2006-01-20 08:21:38 UTC (rev 2151) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml 2006-01-20 09:35:25 UTC (rev 2152) @@ -44,7 +44,7 @@ <!-- now come the versioned assets --> <set name="rules" lazy="false" table="RULESET_RULES" cascade="all" optimistic-lock="false"> - <key column="RULESET_ID"/> + <key column="OWNING_RULESET_ID" /> <one-to-many class="org.drools.repository.RuleDef"/> <filter name="workingVersionFilter" condition=":filteredVersionNumber = VERSION_NUMBER" /> </set> |
From: <jbo...@li...> - 2006-01-20 08:21:44
|
Author: mic...@jb... Date: 2006-01-20 03:21:38 -0500 (Fri, 20 Jan 2006) New Revision: 2151 Added: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorInvoker.java Log: added in SMF - no return value invoker interface just yet Added: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorInvoker.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorInvoker.java 2006-01-20 08:15:21 UTC (rev 2150) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorInvoker.java 2006-01-20 08:21:38 UTC (rev 2151) @@ -0,0 +1,17 @@ +package org.drools.smf; + +import java.util.Map; + +import org.drools.rule.Declaration; +import org.drools.spi.Tuple; + +/** The interface which provides the glue to the predicate eval concrete implementation */ +public interface PredicateEvaluatorInvoker + extends + Invoker { + + public boolean invoke(Tuple tuple, + Declaration[] decls, + Map applicationData) throws Exception; + +} Property changes on: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorInvoker.java ___________________________________________________________________ Name: svn:eol-style + native |
From: <jbo...@li...> - 2006-01-20 08:15:27
|
Author: mic...@jb... Date: 2006-01-20 03:15:21 -0500 (Fri, 20 Jan 2006) New Revision: 2150 Modified: trunk/labs/jbossrules/pom.xml Log: added in SMF Modified: trunk/labs/jbossrules/pom.xml =================================================================== --- trunk/labs/jbossrules/pom.xml 2006-01-20 08:08:46 UTC (rev 2149) +++ trunk/labs/jbossrules/pom.xml 2006-01-20 08:15:21 UTC (rev 2150) @@ -176,6 +176,7 @@ <roles> <role>Developer</role> </roles> + <timezone>+10</timezone> <organization>JBoss Inc.</organization> </developer> </developers> @@ -217,10 +218,10 @@ </build> <modules> - <module>drools-core</module> - <module>drools-ide</module> - <!--module>drools-smf</module> - <module>drools-smftest</module> + <module>drools-core</module> + <module>drools-smf</module> + <!--module>drools-smftest</module> + <module>drools-ide</module> <module>drools-base</module> <module>drools-java</module> <module>drools-groovy</module> |
Author: mic...@jb... Date: 2006-01-20 03:08:46 -0500 (Fri, 20 Jan 2006) New Revision: 2149 Added: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorFactory.java trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ReturnValueEvaluatorFactory.java trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/SemanticsReaderTest.java trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/ trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockConsequenceFactory.java trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockFunctionsFactory.java trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockPredicateEvaluatorFactory.java trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockReturnValueEvaluatorFactory.java trunk/labs/jbossrules/drools-smf/src/test/resources/org/drools/smf/example.conf Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionFactory.java trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionInvoker.java trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SemanticModule.java trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SemanticsReader.java trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SimpleSemanticModule.java trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/SimpleSemanticModuleTest.java Log: more tests, new factory interfaces Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionFactory.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionFactory.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionFactory.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -46,9 +46,7 @@ import org.drools.spi.Condition; import org.drools.spi.RuleBaseContext; -/** - * @deprecated Not used in Drools 3.0 - */ + public interface ConditionFactory { Condition[] newCondition(Rule rule, Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionInvoker.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionInvoker.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionInvoker.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -5,10 +5,7 @@ import org.drools.rule.Declaration; import org.drools.spi.Tuple; -/** - * @deprecated Not used in Drools 3.0 - * - */ + public interface ConditionInvoker extends Invoker { public boolean invoke(Tuple tuple, Added: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorFactory.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorFactory.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorFactory.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -0,0 +1,19 @@ +package org.drools.smf; + +import org.drools.rule.Rule; +import org.drools.spi.PredicateEvaluator; +import org.drools.spi.RuleBaseContext; + +/** + * Implementors must provide a Predicate evalutor factory. + * PredicateEvaluators return true or false based on an expression. + * + * @author Michael Neale + */ +public interface PredicateEvaluatorFactory { + + PredicateEvaluator[] newPredicateEvaluator(Rule rule, + RuleBaseContext context, + Configuration config) throws FactoryException; + +} Property changes on: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/PredicateEvaluatorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ReturnValueEvaluatorFactory.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ReturnValueEvaluatorFactory.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ReturnValueEvaluatorFactory.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -0,0 +1,19 @@ +package org.drools.smf; + +import org.drools.rule.Rule; +import org.drools.spi.ReturnValueEvaluator; +import org.drools.spi.RuleBaseContext; + +/** + * Implementing modules must provide an return evaluator factory. + * Return evaluators return values from expressions. + * + * @author Michael Neale + */ +public interface ReturnValueEvaluatorFactory { + + ReturnValueEvaluator[] newReturnValueEvaluator(Rule rule, + RuleBaseContext context, + Configuration config) throws FactoryException; + +} Property changes on: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ReturnValueEvaluatorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SemanticModule.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SemanticModule.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SemanticModule.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -148,5 +148,16 @@ FunctionsFactory getFunctionsFactory(String name); Set getFunctionsFactoryNames(); + + + PredicateEvaluatorFactory getPredicateEvaluatorFactory(String name); + + Set getPredicateEvaluatorFactoryNames(); + + + ReturnValueEvaluatorFactory getReturnValueEvaluatorFactory(String name); + + Set getReturnValueEvaluatorFactoryNames(); + } \ No newline at end of file Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SemanticsReader.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SemanticsReader.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SemanticsReader.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -69,14 +69,26 @@ * * @version $Id: SemanticsReader.java,v 1.10 2005/04/07 17:42:14 mproctor Exp $ */ -public class SemanticsReader -{ +public class SemanticsReader { // ---------------------------------------------------------------------- // Class members // ---------------------------------------------------------------------- + // these constants represent the factory type names that you can include in + // your smf.conf file. + private static final String FUNCTIONS = "Functions"; + private static final String APPLICATION_DATA = "ApplicationData"; + private static final String IMPORT_ENTRY = "ImportEntry"; + private static final String DURATION = "Duration"; + private static final String CONSEQUENCE = "Consequence"; + private static final String CONDITION = "Condition"; + private static final String OBJECT_TYPE = "ObjectType"; + private static final String RULE = "Rule"; + private static final String PREDICATE = "Predicate"; + private static final String RETURN_VALUE = "ReturnValue"; + /** Singleton instance. */ - private static final SemanticsReader INSTANCE = new SemanticsReader( ); + private static final SemanticsReader INSTANCE = new SemanticsReader(); // ---------------------------------------------------------------------- // Class methods @@ -87,8 +99,7 @@ * * @return The singleton instance. */ - public static SemanticsReader getInstance() - { + public static SemanticsReader getInstance() { return INSTANCE; } @@ -99,8 +110,7 @@ /** * Construct. */ - public SemanticsReader() - { + public SemanticsReader() { // intentionally left blank } @@ -108,32 +118,33 @@ // Instance methods // ---------------------------------------------------------------------- - public SemanticModule read(URL url) throws IOException, SemanticsReaderException - { - return read(url, Thread.currentThread( ).getContextClassLoader( )); + public SemanticModule read(URL url) throws IOException, + SemanticsReaderException { + return read( url, + Thread.currentThread().getContextClassLoader() ); } - + /** * Read a semantic module descriptor from a <code>URL</code>. * - * @param url The descriptor URL. + * @param url + * The descriptor URL. * * @return The loaded semantic module. * @throws IOException * @throws SemanticsReaderException */ - public SemanticModule read(URL url, ClassLoader cl) throws IOException, - SemanticsReaderException - { - InputStream in = url.openStream( ); + public SemanticModule read(URL url, + ClassLoader cl) throws IOException, + SemanticsReaderException { + InputStream in = url.openStream(); - try - { - return read( in, cl ); + try { + return read( in, + cl ); } - finally - { - in.close( ); + finally { + in.close(); } } @@ -150,160 +161,169 @@ * @throws SemanticsReaderException * If an error occurs while loading the module. */ - public SemanticModule read(InputStream in, ClassLoader cl) throws IOException, SemanticsReaderException - { - Properties props = new Properties( ); + public SemanticModule read(InputStream in, + ClassLoader cl) throws IOException, + SemanticsReaderException { + Properties props = new Properties(); props.load( in ); String uri = props.getProperty( "module.uri" ); - if ( uri == null || uri.trim( ).equals( "" ) ) - { + if ( uri == null || uri.trim().equals( "" ) ) { throw new SemanticsReaderException( "module.uri must be specified" ); } - SimpleSemanticModule module = new SimpleSemanticModule( uri.trim( ) ); + SimpleSemanticModule module = new SimpleSemanticModule( uri.trim() ); - for ( Enumeration propNames = props.propertyNames( ); propNames.hasMoreElements( ); ) - { - String key = (String) propNames.nextElement( ); + for ( Enumeration propNames = props.propertyNames(); propNames.hasMoreElements(); ) { + String key = (String) propNames.nextElement(); - if ( key.equals( "module.uri" ) ) - { + if ( key.equals( "module.uri" ) ) { continue; } String className = props.getProperty( key ); Class factoryClass; - try - { + try { factoryClass = cl.loadClass( className ); } - catch ( ClassNotFoundException e ) - { + catch ( ClassNotFoundException e ) { throw new SemanticsReaderException( e ); } - if ( key.indexOf( "(" ) < 0 || key.indexOf( ")" ) < 0 ) - { + if ( key.indexOf( "(" ) < 0 || key.indexOf( ")" ) < 0 ) { throw new SemanticsReaderException( "invalid key: " + key ); } String type = parseType( key ); - if ( type == null || type.equals( "" ) ) - { + if ( type == null || type.equals( "" ) ) { throw new SemanticsReaderException( "no type specified" ); } String componentName = parseName( key ); - if ( componentName == null || componentName.equals( "" ) ) - { + if ( componentName == null || componentName.equals( "" ) ) { throw new SemanticsReaderException( "no component name specified" ); } - try - { - if ( "Rule".equals( type ) ) - { - RuleFactory factory = (RuleFactory) factoryClass.newInstance( ); + try { + + //now create the appropriate instance, and install it + addAppropriateFactoryToModule( module, + factoryClass, + type, + componentName ); + } + catch ( InstantiationException e ) { + throw new SemanticsReaderException( e ); + } + catch ( IllegalAccessException e ) { + throw new SemanticsReaderException( e ); + } + } - module.addRuleFactory( componentName, - factory ); - } - else if ( "ObjectType".equals( type ) ) - { - ObjectTypeFactory factory = (ObjectTypeFactory) factoryClass.newInstance( ); + return module; + } - module.addObjectTypeFactory( componentName, - factory ); - } - else if ( "Condition".equals( type ) ) - { - ConditionFactory factory = (ConditionFactory) factoryClass.newInstance( ); + /** + * This will instantiate the appropriate semantic factory, and install it appropriately + * into the semantic module. + */ + private void addAppropriateFactoryToModule(SimpleSemanticModule module, + Class factoryClass, + String type, + String componentName) throws InstantiationException, + IllegalAccessException, + SemanticsReaderException { + if ( RULE.equals( type ) ) { + RuleFactory factory = (RuleFactory) factoryClass.newInstance(); - module.addConditionFactory( componentName, - factory ); - } - else if ( "Consequence".equals( type ) ) - { - ConsequenceFactory factory = (ConsequenceFactory) factoryClass.newInstance( ); + module.addRuleFactory( componentName, + factory ); + } + else if ( OBJECT_TYPE.equals( type ) ) { + ObjectTypeFactory factory = (ObjectTypeFactory) factoryClass.newInstance(); - module.addConsequenceFactory( componentName, - factory ); - } - else if ( "Duration".equals( type ) ) - { - DurationFactory factory = (DurationFactory) factoryClass.newInstance( ); + module.addObjectTypeFactory( componentName, + factory ); + } + else if ( CONDITION.equals( type ) ) { + ConditionFactory factory = (ConditionFactory) factoryClass.newInstance(); - module.addDurationFactory( componentName, - factory ); - } - else if ( "ImportEntry".equals( type ) ) - { - ImportEntryFactory factory = (ImportEntryFactory) factoryClass.newInstance( ); + module.addConditionFactory( componentName, + factory ); + } + else if ( CONSEQUENCE.equals( type ) ) { + ConsequenceFactory factory = (ConsequenceFactory) factoryClass.newInstance(); - module.addImportEntryFactory( componentName, - factory ); - } - else if ( "ApplicationData".equals( type ) ) - { - ApplicationDataFactory factory = (ApplicationDataFactory) factoryClass.newInstance( ); + module.addConsequenceFactory( componentName, + factory ); + } + else if ( DURATION.equals( type ) ) { + DurationFactory factory = (DurationFactory) factoryClass.newInstance(); - module.addApplicationDataFactory( componentName, - factory ); - } - else if ( "Functions".equals( type ) ) - { - FunctionsFactory factory = (FunctionsFactory) factoryClass.newInstance( ); + module.addDurationFactory( componentName, + factory ); + } + else if ( IMPORT_ENTRY.equals( type ) ) { + ImportEntryFactory factory = (ImportEntryFactory) factoryClass.newInstance(); - module.addFunctionsFactory( componentName, - factory ); - } - else - { - throw new SemanticsReaderException( "unknown type '" + type + "'" ); - } - } - catch ( InstantiationException e ) - { - throw new SemanticsReaderException( e ); - } - catch ( IllegalAccessException e ) - { - throw new SemanticsReaderException( e ); - } + module.addImportEntryFactory( componentName, + factory ); } + else if ( APPLICATION_DATA.equals( type ) ) { + ApplicationDataFactory factory = (ApplicationDataFactory) factoryClass.newInstance(); - return module; + module.addApplicationDataFactory( componentName, + factory ); + } + else if ( FUNCTIONS.equals( type ) ) { + FunctionsFactory factory = (FunctionsFactory) factoryClass.newInstance(); + + module.addFunctionsFactory( componentName, + factory ); + } + else if ( PREDICATE.equals( type ) ) { + + PredicateEvaluatorFactory factory = (PredicateEvaluatorFactory) factoryClass.newInstance(); + + module.addPredicateEvaluatorFactory( componentName, + factory ); + } + else if ( RETURN_VALUE.equals( type ) ) { + ReturnValueEvaluatorFactory factory = (ReturnValueEvaluatorFactory) factoryClass.newInstance(); + + module.addReturnValueEvaluatorFactory( componentName, + factory ); + + } + else { + throw new SemanticsReaderException( "unknown type '" + type + "'" ); + } } - protected String parseType(String key) - { + protected String parseType(String key) { int leftParen = key.indexOf( "(" ); - if ( leftParen < 0 ) - { + if ( leftParen < 0 ) { return null; } return key.substring( 0, - leftParen ).trim( ); + leftParen ).trim(); } - protected String parseName(String key) - { + protected String parseName(String key) { int leftParen = key.indexOf( "(" ); int rightParen = key.indexOf( ")" ); - if ( leftParen < 0 || rightParen < 0 ) - { + if ( leftParen < 0 || rightParen < 0 ) { return null; } return key.substring( leftParen + 1, - rightParen ).trim( ); + rightParen ).trim(); } } Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SimpleSemanticModule.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SimpleSemanticModule.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/SimpleSemanticModule.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Set; +import org.drools.spi.ReturnValueEvaluator; + /** * Simple implementation of a Semantic Module. * @@ -83,6 +85,10 @@ /** functions factories */ private Map functionFactories; + private Map predicateEvaluatorFactories; + + private Map returnValueEvaluatorFactories; + private Map types; @@ -108,6 +114,8 @@ this.applicationDataFactories = new HashMap( ); this.functionFactories = new HashMap( ); this.types = new HashMap( ); + this.predicateEvaluatorFactories = new HashMap( ); + this.returnValueEvaluatorFactories = new HashMap( ); } // ------------------------------------------------------------ @@ -145,6 +153,36 @@ { return this.ruleFactories.keySet( ); } + + public void addPredicateEvaluatorFactory(String name, + PredicateEvaluatorFactory factory) { + this.predicateEvaluatorFactories.put( name, factory); + this.types.put(name, "PredicateEvaluator"); + } + + public PredicateEvaluatorFactory getPredicateEvaluatorFactory(String name) { + return (PredicateEvaluatorFactory) this.predicateEvaluatorFactories.get(name); + } + + public Set getPredicateEvaluatorFactoryNames() { + return this.predicateEvaluatorFactories.keySet(); + } + + + public void addReturnValueEvaluatorFactory(String name, + ReturnValueEvaluatorFactory factory) { + this.returnValueEvaluatorFactories.put( name, factory); + this.types.put(name, "ReturnValueEvaluator"); + } + + public ReturnValueEvaluatorFactory getReturnValueEvaluatorFactory(String name) { + return (ReturnValueEvaluatorFactory) this.returnValueEvaluatorFactories.get(name); + } + + public Set getReturnValueEvaluatorFactoryNames() { + return this.returnValueEvaluatorFactories.keySet(); + } + /** * Add a semantic <code>ObjectTypeFactory</code>. @@ -293,5 +331,7 @@ public Set getFunctionsFactoryNames() { return this.functionFactories.keySet(); - } + } + + } \ No newline at end of file Added: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/SemanticsReaderTest.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/SemanticsReaderTest.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/SemanticsReaderTest.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -0,0 +1,34 @@ +package org.drools.smf; + +import java.net.URL; + +import junit.framework.TestCase; + +/** + * Test out the semantics reader with some mocks. + * @author Michael Neale + */ +public class SemanticsReaderTest extends TestCase { + + public void testLoadMockSemanticConfig() throws Exception { + SemanticsReader reader = SemanticsReader.getInstance(); + + URL url = this.getClass().getResource("/org/drools/smf/example.conf"); + + SemanticModule module = reader.read(url); + assertNotNull(module); + + FunctionsFactory factory = (FunctionsFactory) module.getFunctionsFactory("functions"); + assertNotNull(factory); + + ReturnValueEvaluatorFactory retFactory = (ReturnValueEvaluatorFactory) module.getReturnValueEvaluatorFactory("retval"); + assertNotNull(retFactory); + + PredicateEvaluatorFactory predicateFactory = (PredicateEvaluatorFactory) module.getPredicateEvaluatorFactory("predicate"); + assertNotNull(predicateFactory); + + + } + + +} Property changes on: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/SemanticsReaderTest.java ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/SimpleSemanticModuleTest.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/SimpleSemanticModuleTest.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/SimpleSemanticModuleTest.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -48,6 +48,8 @@ import org.drools.spi.Consequence; import org.drools.spi.Duration; import org.drools.spi.ObjectType; +import org.drools.spi.PredicateEvaluator; +import org.drools.spi.ReturnValueEvaluator; import org.drools.spi.RuleBaseContext; public class SimpleSemanticModuleTest extends DroolsTestCase @@ -143,6 +145,37 @@ } + public void testAddGetPredicateEvalFactory() { + SimpleSemanticModule module = new SimpleSemanticModule( "http://cheese.org" ); + + PredicateEvaluatorFactory factory = new MockPredicateEvaluatorFactory(); + + module.addPredicateEvaluatorFactory("mockCheese", factory); + + assertSame( module.getPredicateEvaluatorFactory( "mockCheese" ), + factory ); + + assertEquals( module.getPredicateEvaluatorFactoryNames( ).size( ), + 1 ); + + } + + public void testAddGetReturnValueEvalFactory() { + SimpleSemanticModule module = new SimpleSemanticModule( "http://cheese.org" ); + + ReturnValueEvaluatorFactory factory = new MockReturnValueEvaluatorFactory(); + + module.addReturnValueEvaluatorFactory("mockCheese", factory); + + assertSame( module.getReturnValueEvaluatorFactory( "mockCheese" ), + factory ); + + assertEquals( module.getReturnValueEvaluatorFactoryNames( ).size( ), + 1 ); + + } + + private class MockRuleFactory implements RuleFactory @@ -222,5 +255,29 @@ } } + + private class MockPredicateEvaluatorFactory + implements + PredicateEvaluatorFactory { + public PredicateEvaluator[] newPredicateEvaluator(Rule rule, + RuleBaseContext context, + Configuration config) throws FactoryException { + return null; + } + + } + + private class MockReturnValueEvaluatorFactory + implements + ReturnValueEvaluatorFactory { + + public ReturnValueEvaluator[] newReturnValueEvaluator(Rule rule, + RuleBaseContext context, + Configuration config) throws FactoryException { + return null; + } + + } + } Added: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockConsequenceFactory.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockConsequenceFactory.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockConsequenceFactory.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -0,0 +1,21 @@ +package org.drools.smf.mock; + +import org.drools.rule.Rule; +import org.drools.smf.Configuration; +import org.drools.smf.ConsequenceFactory; +import org.drools.smf.FactoryException; +import org.drools.spi.Consequence; +import org.drools.spi.RuleBaseContext; + +public class MockConsequenceFactory + implements + ConsequenceFactory { + + public Consequence newConsequence(Rule rule, + RuleBaseContext context, + Configuration config) throws FactoryException { + + return null; + } + +} Property changes on: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockConsequenceFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockFunctionsFactory.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockFunctionsFactory.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockFunctionsFactory.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -0,0 +1,20 @@ +package org.drools.smf.mock; + +import org.drools.rule.RuleSet; +import org.drools.smf.Configuration; +import org.drools.smf.FactoryException; +import org.drools.smf.FunctionsFactory; +import org.drools.spi.Functions; +import org.drools.spi.RuleBaseContext; + +public class MockFunctionsFactory + implements + FunctionsFactory { + + public Functions newFunctions(RuleSet ruleSet, + RuleBaseContext context, + Configuration config) throws FactoryException { + return null; + } + +} Property changes on: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockFunctionsFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockPredicateEvaluatorFactory.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockPredicateEvaluatorFactory.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockPredicateEvaluatorFactory.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -0,0 +1,20 @@ +package org.drools.smf.mock; + +import org.drools.rule.Rule; +import org.drools.smf.Configuration; +import org.drools.smf.FactoryException; +import org.drools.smf.PredicateEvaluatorFactory; +import org.drools.spi.PredicateEvaluator; +import org.drools.spi.RuleBaseContext; + +public class MockPredicateEvaluatorFactory + implements + PredicateEvaluatorFactory { + + public PredicateEvaluator[] newPredicateEvaluator(Rule rule, + RuleBaseContext context, + Configuration config) throws FactoryException { + return null; + } + +} Property changes on: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockPredicateEvaluatorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockReturnValueEvaluatorFactory.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockReturnValueEvaluatorFactory.java 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockReturnValueEvaluatorFactory.java 2006-01-20 08:08:46 UTC (rev 2149) @@ -0,0 +1,20 @@ +package org.drools.smf.mock; + +import org.drools.rule.Rule; +import org.drools.smf.Configuration; +import org.drools.smf.FactoryException; +import org.drools.smf.ReturnValueEvaluatorFactory; +import org.drools.spi.ReturnValueEvaluator; +import org.drools.spi.RuleBaseContext; + +public class MockReturnValueEvaluatorFactory + implements + ReturnValueEvaluatorFactory { + + public ReturnValueEvaluator[] newReturnValueEvaluator(Rule rule, + RuleBaseContext context, + Configuration config) throws FactoryException { + return null; + } + +} Property changes on: trunk/labs/jbossrules/drools-smf/src/test/java/org/drools/smf/mock/MockReturnValueEvaluatorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-smf/src/test/resources/org/drools/smf/example.conf =================================================================== --- trunk/labs/jbossrules/drools-smf/src/test/resources/org/drools/smf/example.conf 2006-01-20 05:09:58 UTC (rev 2148) +++ trunk/labs/jbossrules/drools-smf/src/test/resources/org/drools/smf/example.conf 2006-01-20 08:08:46 UTC (rev 2149) @@ -0,0 +1,6 @@ +module.uri=http://drools.org/semantics/mock + +Consequence(consequence) : org.drools.smf.mock.MockConsequenceFactory +Functions(functions) : org.drools.smf.mock.MockFunctionsFactory +Predicate(predicate) : org.drools.smf.mock.MockPredicateEvaluatorFactory +ReturnValue(retval) : org.drools.smf.mock.MockReturnValueEvaluatorFactory Property changes on: trunk/labs/jbossrules/drools-smf/src/test/resources/org/drools/smf/example.conf ___________________________________________________________________ Name: svn:eol-style + native |
From: <jbo...@li...> - 2006-01-20 05:10:05
|
Author: mic...@jb... Date: 2006-01-20 00:09:58 -0500 (Fri, 20 Jan 2006) New Revision: 2148 Removed: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/RuleCompiler.java trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/RuleSetCompiler.java Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionFactory.java trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionInvoker.java Log: Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionFactory.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionFactory.java 2006-01-20 03:27:41 UTC (rev 2147) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionFactory.java 2006-01-20 05:09:58 UTC (rev 2148) @@ -41,10 +41,14 @@ * */ + import org.drools.rule.Rule; import org.drools.spi.Condition; import org.drools.spi.RuleBaseContext; +/** + * @deprecated Not used in Drools 3.0 + */ public interface ConditionFactory { Condition[] newCondition(Rule rule, Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionInvoker.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionInvoker.java 2006-01-20 03:27:41 UTC (rev 2147) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/ConditionInvoker.java 2006-01-20 05:09:58 UTC (rev 2148) @@ -5,6 +5,10 @@ import org.drools.rule.Declaration; import org.drools.spi.Tuple; +/** + * @deprecated Not used in Drools 3.0 + * + */ public interface ConditionInvoker extends Invoker { public boolean invoke(Tuple tuple, Deleted: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/RuleCompiler.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/RuleCompiler.java 2006-01-20 03:27:41 UTC (rev 2147) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/RuleCompiler.java 2006-01-20 05:09:58 UTC (rev 2148) @@ -1,242 +0,0 @@ -package org.drools.smf; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.jci.readers.ResourceReader; -import org.apache.commons.jci.stores.ResourceStore; -import org.drools.rule.Declaration; -import org.drools.rule.Rule; -import org.drools.spi.Consequence; -import org.drools.spi.RuleComponent; - -public class RuleCompiler -{ - - private static final RuleCompiler INSTANCE = new RuleCompiler(); - - public static RuleCompiler getInstance() - { - return RuleCompiler.INSTANCE; - } - - private RuleCompiler() - { - - } - - public void compile(Rule rule, - String packageName, - Map parents, - Map ruleNameMap, - String knowledgeHelper, - ResourceReader src, - ResourceStore dst, - ClassLoader classLoader) throws IOException - { - Map map = new HashMap(); - Map files = new HashMap(); - Map invokers = new HashMap(); - files.put( "invokers", - invokers ); - - // First gather up all the conditions for the different SMF compiler lists - List conditions = rule.getConditions(); - Iterator it = conditions.iterator(); - SemanticRule condition = null; - SemanticRuleCompiler compiler = null; - Object object = null; - while ( it.hasNext() ) - { - object = it.next(); - //only process this component if it implements the SemanticRule interface - if ( ! ( object instanceof SemanticRule ) ) - { - continue; - } - condition = (SemanticRule) object; - compiler = condition.getSemanticRuleCompiler(); - List list = (List) map.get( compiler ); - if ( list == null ) - { - list = new ArrayList(); - } - - list.add( condition ); - - map.put( compiler, - list ); - } - - List list = null; - // Add the consequence for to its smf compiler list - Consequence consequence = rule.getConsequence(); - //only process this component if it implements the SemanticRule interface - if ( consequence instanceof SemanticRule ) - { - compiler = ((SemanticRule) consequence).getSemanticRuleCompiler(); - list = (List) map.get( compiler ); - if ( list == null ) - { - list = new ArrayList(); - } - - list.add( consequence ); - map.put( compiler, - list ); - } - - it = map.keySet().iterator(); - - RuleComponent[] components = null; - String semanticPackageName = null; - String name = null; - String className = null; - List declarations = null; - while ( it.hasNext() ) - { - // Make a copy of the imports - // Cannot use the original as it will be updated by the compiler - Set imports = new HashSet(); - imports.addAll( rule.getImporter().getImports() ); - - compiler = (SemanticRuleCompiler) it.next(); - list = (List) map.get( compiler ); - components = (RuleComponent[]) list.toArray( new RuleComponent[list.size()] ); - - name = rule.getName(); - - className = (String) ruleNameMap.get( rule.getName() ); - - if ( className == null ) - { - semanticPackageName = packageName + "." + compiler.getSemanticType(); - - className = generateUniqueLegalName( semanticPackageName, - src, - name.toUpperCase().charAt( 0 ) + name.substring( 1 ), - "." + compiler.getSemanticType() ); - ruleNameMap.put( rule, - className ); - } - - declarations = rule.getParameterDeclarations(); - compiler.generate( components, - (Declaration[]) declarations.toArray( new Declaration[declarations.size()] ), - imports, - rule.getApplicationData(), - semanticPackageName, - className, - (String) parents.get( compiler.getSemanticType() ), - knowledgeHelper, - src, - files ); - } - - compile( files, src, dst, classLoader ); - compile( invokers, src, dst, classLoader ); - - -// it = files.keySet().iterator(); -// Object object = null; -// list = null; -// while ( it.hasNext() ) -// { -// object = it.next(); -// if ( object instanceof SemanticRuleCompiler ) { -// compiler = (SemanticRuleCompiler) object; -// list = ( List ) files.get( compiler ); -// compiler.compile( ( String[] ) list.toArray( new String[ list.size() ] ), -// src, -// dst ); -// } -// } -// -// -// -// it = invokers.keySet().iterator(); -// object = null; -// list = null; -// while ( it.hasNext() ) -// { -// object = it.next(); -// if ( object instanceof SemanticRuleCompiler ) { -// compiler = (SemanticRuleCompiler) object; -// list = ( List ) files.get( compiler ); -// compiler.compile( ( String[] ) list.toArray( new String[ list.size() ] ), -// src, -// dst ); -// } -// } - - - } - - private void compile( Map files, - ResourceReader src, - ResourceStore dst, - ClassLoader classLoader) - { - Iterator it = files.keySet().iterator(); - Object object = null; - List list = null; - SemanticRuleCompiler compiler = null; - while ( it.hasNext() ) - { - object = it.next(); - if ( object instanceof SemanticRuleCompiler ) { - compiler = (SemanticRuleCompiler) object; - list = ( List ) files.get( compiler ); - compiler.compile( ( String[] ) list.toArray( new String[ list.size() ] ), - src, - dst, - classLoader); - } - } - } - - /** - * Takes a given name and makes sure that its legal and doesn't already exist. If the file exists it increases counter appender untill it is unique. - * - * @param packageName - * @param name - * @param ext - * @return - */ - private String generateUniqueLegalName(String packageName, - ResourceReader src, - String name, - String ext) - { - // replaces the first char if its a number and after that all non - // alphanumeric or $ chars with _ - String newName = name.replaceAll( "(^[0-9]|[^\\w$])", - "_" ); - - // make sure the class name does not exist, if it does increase the counter - int counter = -1; - boolean exists = true; - while ( exists ) - { - counter++; - String fileName = packageName.replaceAll( "\\.", - "/" ) + newName + "_" + counter + ext; - - exists = src.isAvailable(fileName); - } - // we have duplicate file names so append counter - if ( counter >= 0 ) - { - newName = newName + "_" + counter; - } - - return newName; - } - -} Deleted: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/RuleSetCompiler.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/RuleSetCompiler.java 2006-01-20 03:27:41 UTC (rev 2147) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/RuleSetCompiler.java 2006-01-20 05:09:58 UTC (rev 2148) @@ -1,409 +0,0 @@ -package org.drools.smf; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.apache.commons.jci.readers.MemoryResourceReader; -import org.apache.commons.jci.readers.ResourceReader; -import org.apache.commons.jci.stores.MemoryResourceStore; -import org.apache.commons.jci.stores.ResourceStore; -import org.apache.commons.jci.stores.ResourceStoreClassLoader; -import org.drools.IntegrationException; -import org.drools.rule.Rule; -import org.drools.rule.RuleSet; -import org.drools.spi.Condition; -import org.drools.spi.Functions; - -public class RuleSetCompiler -{ - private final RuleSet ruleSet; - - private final String ruleSetValidFileName; - - private final String packageName; - - private final String knowledgeHelper; - - private final MemoryResourceReader src; - private final MemoryResourceStore dst; - - // private File srcJar; - // private File binJar; - - public RuleSetCompiler(RuleSet ruleSet, - String packageName, - String knowledgeHelper) throws IntegrationException, - IOException - { - - // srcJar = null; - // binJar = null; - - this.ruleSet = ruleSet; - this.ruleSetValidFileName = this.ruleSet.getName().replaceAll( "(^[0-9]|[^\\w$])", - "_" ).toLowerCase(); - - this.packageName = packageName; - this.knowledgeHelper = knowledgeHelper; - - this.src = new MemoryResourceReader(); - this.dst = new MemoryResourceStore(); - - compile(); - - // //srcJar may be null so check before we do toURL - // URL srcJarUrl = null; - // if ( ( this.srcJar != null ) ) - // { - // srcJarUrl = this.srcJar.toURL(); - // } - // - // - // return new RuleSetPackage( ruleSet, this.binJar.toURL(), srcJarUrl ); - } - - public RuleSet getRuleSet() - { - return ruleSet; - } - - public byte[] getSourceDeploymentJar() throws IOException - { - String[] files = this.src.list(); - - ByteArrayOutputStream output = new ByteArrayOutputStream(); - Jarer jarer = new Jarer( output ); - for ( int i = 0; i < files.length; i++ ) - { - jarer.addCharArray( this.src.getContent( files[i] ), - files[i] ); - } - jarer.close(); - return output.toByteArray(); - } - - public byte[] getBinaryDeploymentJar() throws IOException - { - String[] files = this.dst.list(); - - ByteArrayOutputStream output = new ByteArrayOutputStream(); - Jarer jarer = new Jarer( output ); - for ( int i = 0; i < files.length; i++ ) - { - jarer.addByteArray( this.dst.read( files[i] ), - files[i].replace('.', '/') + ".class" ); - } - - jarer.addObject( this.ruleSetValidFileName, - this.ruleSet ); - - Properties prop = new Properties(); - prop.setProperty( "name", - this.ruleSetValidFileName ); - ByteArrayOutputStream propStream = new ByteArrayOutputStream(); - prop.store(propStream, null); - jarer.addByteArray(propStream.toByteArray(), "rule-set.conf"); - - jarer.close(); - return output.toByteArray(); - } - - private void compile() throws IOException, - IntegrationException - { - - Map functionMap = this.ruleSet.getFunctions(); - Iterator it = functionMap.values().iterator(); - SemanticFunctions functions = null; - SemanticFunctionsCompiler compiler = null; - String functionClassName = null; - String name = null; - String semanticPackageName = null; - - ClassLoader parentClassLoader = Thread.currentThread().getContextClassLoader(); - if ( parentClassLoader == null ) - { - parentClassLoader = this.getClass().getClassLoader(); - } - - ResourceStoreClassLoader classLoader = new ResourceStoreClassLoader( parentClassLoader, - new ResourceStore[]{dst} ); - - Map parents = new HashMap(); - Map files = new HashMap(); - Object object = null; - while ( it.hasNext() ) - { - object = it.next(); - if ( !(object instanceof SemanticFunctions) ) - { - continue; - } - - functions = (SemanticFunctions) object; - name = functions.getName(); - - // Make a copy of the imports - // Cannot use the original as it will be updated by the compiler - Set imports = new HashSet(); - imports.addAll( this.ruleSet.getImporter().getImports() ); - - compiler = functions.getSemanticFunctionsCompiler(); - - //Use the regex ruleset name + timestamp to hopefully create a unique namespace - //This is further backed by the derived class name from the rulename - semanticPackageName = this.packageName + "." + this.ruleSetValidFileName + "_" + System.currentTimeMillis() + "." + compiler.getSemanticType(); - functionClassName = generateUniqueLegalName( semanticPackageName, - src, - name.toUpperCase().charAt( 0 ) + name.substring( 1 ), - "." + compiler.getSemanticType() ); - - compiler.generate( (Functions) functions, - imports, - semanticPackageName, - functionClassName, - null, - src, - files ); - - parents.put( compiler.getSemanticType(), - semanticPackageName + "." + functionClassName ); - - } - - it = files.keySet().iterator(); - object = null; - List list = null; - while ( it.hasNext() ) - { - object = it.next(); - if ( object instanceof SemanticFunctionsCompiler ) - { - compiler = (SemanticFunctionsCompiler) object; - list = (List) files.get( compiler ); - compiler.compile( (String[]) list.toArray( new String[list.size()] ), - src, - dst, - classLoader ); - } - } - - Rule[] rules = this.ruleSet.getRules(); - - //Use the regex ruleset name + timestamp to hopefully create a unique namespace - //This is further backed by the derived class name from the rulename - String rulePackageName = this.packageName + "." + this.ruleSetValidFileName + "_" + System.currentTimeMillis(); - // use a HashMap to map the rules to their new class names, used for wiring - Map ruleNameMap = new HashMap(); - for ( int i = 0; i < rules.length; i++ ) - { - compileRule( rules[i], - rulePackageName, - parents, - ruleNameMap, - this.knowledgeHelper, - src, - dst, - classLoader ); - - } - - // File conf = new File( this.temp, - // "rule-set.conf" ); - // - // Properties prop = new Properties(); - // prop.setProperty( "name", - // this.ruleSetName ); - // FileOutputStream fos = new FileOutputStream( conf ); - // prop.store( fos , - // null ); - // fos.close(); - - setInvokers( this.ruleSet, - rulePackageName, - ruleNameMap, - classLoader ); - - // createBinJar(); - // createSrcJar(); - // conf.delete(); - } - - private static void compileRule(Rule rule, - String packageName, - Map parents, - Map ruleMap, - String knowledgeHelper, - ResourceReader src, - ResourceStore dst, - ClassLoader classLoader) throws IOException - { - RuleCompiler compiler = RuleCompiler.getInstance(); - compiler.compile( rule, - packageName, - parents, - ruleMap, - knowledgeHelper, - src, - dst, - classLoader ); - } - - private void setInvokers(RuleSet ruleSet, - String packageName, - Map ruleMap, - ClassLoader classLoader) throws IntegrationException - { - Rule[] rules = ruleSet.getRules(); - Rule rule = null; - SemanticInvokeable component = null; - String name = null; - String semanticPackageName = null; - try - { - for ( int i = 0; i < rules.length; i++ ) - { - rule = rules[i]; - Condition[] conditions = (Condition[]) rule.getConditions().toArray( new Condition[rule.getConditions().size()] ); - for ( int j = 0; j < conditions.length; j++ ) - { - //only wire up this condition if it implements SemanticInvokeble - if ( !(conditions[j] instanceof SemanticInvokeable) ) - { - continue; - } - component = (SemanticInvokeable) conditions[j]; - name = component.getName(); - semanticPackageName = packageName + "." + component.getSemanticType(); - component.setInvoker( (Invoker) classLoader.loadClass( semanticPackageName + "." + ruleMap.get( rule ) + "Invoker$" + name.toUpperCase().charAt( 0 ) + name.substring( 1 ) + "Invoker" ).newInstance() ); - - } - - //only wire up this consequenceif it implements SemanticInvokeble - if ( rule.getConsequence() instanceof SemanticInvokeable ) - { - component = (SemanticInvokeable) rule.getConsequence(); - name = component.getName(); - semanticPackageName = packageName + "." + component.getSemanticType(); - component.setInvoker( (Invoker) classLoader.loadClass( semanticPackageName + "." + ruleMap.get( rule ) + "Invoker$" + name.toUpperCase().charAt( 0 ) + name.substring( 1 ) + "Invoker" ).newInstance() ); - } - } - } - catch ( InstantiationException e ) - { - throw new IntegrationException( "Unable to bind RuleSet '" + ruleSet.getName() + "' component to Class Method: " + e.getMessage(), - e ); - } - catch ( IllegalAccessException e ) - { - throw new IntegrationException( "Unable to bind RuleSet '" + ruleSet.getName() + "' component to Class Method: " + e.getMessage(), - e ); - } - catch ( ClassNotFoundException e ) - { - throw new IntegrationException( "Unable to bind RuleSet '" + ruleSet.getName() + "' component to Class Method: " + e.getMessage(), - e ); - } - } - - // private void createBinJar() throws FileNotFoundException, - // IOException - // { - // String jarName = this.ruleSetName + ".jar"; - // this.binJar = new File( this.temp, - // jarName ); - // Jarer jarer = new Jarer( this.binJar ); - // - // jarer.addDirectory( this.dst ); - // jarer.addObject( this.ruleSetName, - // this.ruleSet ); - // - // File conf = new File( this.temp, - // "rule-set.conf" ); - // - // jarer.addFile( conf, - // "rule-set.conf" ); - // - // jarer.close(); - // conf.delete(); - // this.binJar.deleteOnExit(); - // - // } - // - // /** - // * Only create a src jar is the src directory has entries - // * - // * @throws FileNotFoundException - // * @throws IOException - // */ - // private void createSrcJar() throws FileNotFoundException, - // IOException - // { - // // Only create a src jar if the src directory has entries - // if ( this.src.list().length != 0 ) - // { - // String jarName = this.ruleSet.getName().replaceAll( "(^[0-9]|[^\\w$])", - // "_" ) + "-src.jar"; - // this.srcJar = new File( this.temp, - // jarName ); - // Jarer jarer = new Jarer( this.srcJar ); - // jarer.addDirectory( this.src ); - // jarer.close(); - // this.srcJar.deleteOnExit(); - // } - // } - - /** - * Takes a given name and makes sure that its legal and doesn't already exist. If the file exists it increases counter appender untill it is unique. - * - * @param packageName - * @param name - * @param ext - * @return - */ - private String generateUniqueLegalName(String packageName, - ResourceReader src, - String name, - String ext) - { - // replaces the first char if its a number and after that all non - // alphanumeric or $ chars with _ - String newName = name.replaceAll( "(^[0-9]|[^\\w$])", - "_" ); - - // make sure the class name does not exist, if it does increase the counter - int counter = -1; - boolean exists = true; - while ( exists ) - { - counter++; - String fileName = packageName.replaceAll( "\\.", - "/" ) + newName + "_" + counter + ext; - - exists = src.isAvailable( fileName ); - } - // we have duplicate file names so append counter - if ( counter >= 0 ) - { - newName = newName + "_" + counter; - } - - return newName; - } - -} |
From: <jbo...@li...> - 2006-01-20 03:27:48
|
Author: mic...@jb... Date: 2006-01-19 22:27:41 -0500 (Thu, 19 Jan 2006) New Revision: 2147 Added: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/RuleComponent.java Log: required for SMF Added: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/RuleComponent.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/RuleComponent.java 2006-01-20 03:27:21 UTC (rev 2146) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/RuleComponent.java 2006-01-20 03:27:41 UTC (rev 2147) @@ -0,0 +1,59 @@ +package org.drools.spi; + +/* + * $Id$ + * + * Copyright 2001-2003 (C) The Werken Company. All Rights Reserved. + * + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided that the + * following conditions are met: + * + * 1. Redistributions of source code must retain copyright statements and + * notices. Redistributions must also contain a copy of this document. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name "drools" must not be used to endorse or promote products derived + * from this Software without prior written permission of The Werken Company. + * For written permission, please contact bo...@we.... + * + * 4. Products derived from this Software may not be called "drools" nor may + * "drools" appear in their names without prior written permission of The Werken + * Company. "drools" is a trademark of The Werken Company. + * + * 5. Due credit should be given to The Werken Company. (http://werken.com/) + * + * THIS SOFTWARE IS PROVIDED BY THE WERKEN COMPANY AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE WERKEN COMPANY OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +import java.io.Serializable; + +import org.drools.rule.Rule; + +/** + * Semantic component marker. + * + * @author <a href="mailto:bo...@we...">bob mcwhirter </a> + * + * @version $Id$ + */ +public interface RuleComponent + extends + Serializable +{ + +} Property changes on: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/RuleComponent.java ___________________________________________________________________ Name: svn:eol-style + native |
From: <jbo...@li...> - 2006-01-20 03:27:28
|
Author: mic...@jb... Date: 2006-01-19 22:27:21 -0500 (Thu, 19 Jan 2006) New Revision: 2146 Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/rule/RuleSet.java Log: exposes functions for SMF Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/rule/RuleSet.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/rule/RuleSet.java 2006-01-20 03:00:17 UTC (rev 2145) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/rule/RuleSet.java 2006-01-20 03:27:21 UTC (rev 2146) @@ -42,6 +42,7 @@ import java.io.Serializable; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -262,6 +263,11 @@ public Functions getFunctions(String semantic) { return (Functions) this.functions.get( semantic ); } + + public Map getFunctions() + { + return Collections.unmodifiableMap( this.functions ); + } public RuleBaseContext getRuleBaseContext() { return this.ruleBaseContext; |
From: <jbo...@li...> - 2006-01-20 03:00:25
|
Author: mic...@jb... Date: 2006-01-19 22:00:17 -0500 (Thu, 19 Jan 2006) New Revision: 2145 Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/Configuration.java Log: small correction Modified: trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/Configuration.java =================================================================== --- trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/Configuration.java 2006-01-20 02:48:56 UTC (rev 2144) +++ trunk/labs/jbossrules/drools-smf/src/main/java/org/drools/smf/Configuration.java 2006-01-20 03:00:17 UTC (rev 2145) @@ -96,7 +96,7 @@ * * @return The attribute names. */ - String[] getAttributeNames(); + String[] getAttributeNames(); /** * Retrieve a child node. |
From: <jbo...@li...> - 2006-01-20 02:49:01
|
Author: mic...@jb... Date: 2006-01-19 21:48:56 -0500 (Thu, 19 Jan 2006) New Revision: 2144 Modified: trunk/labs/jbossrules/drools-smf/pom.xml Log: depedency on drools-core Modified: trunk/labs/jbossrules/drools-smf/pom.xml =================================================================== --- trunk/labs/jbossrules/drools-smf/pom.xml 2006-01-20 02:40:30 UTC (rev 2143) +++ trunk/labs/jbossrules/drools-smf/pom.xml 2006-01-20 02:48:56 UTC (rev 2144) @@ -20,13 +20,19 @@ </repositories> - <!-- will keep JCI local for now. --> + <!-- will keep JCI local for now. Move to ibiblio when its updated --> <dependencies> <dependency> <groupId>jci</groupId> <artifactId>jci</artifactId> <version>SNAPSHOT-2005</version> - </dependency> + </dependency> + + <dependency> + <groupId>org.drools</groupId> + <artifactId>drools-core</artifactId> + <version>${project.version}</version> + </dependency> </dependencies> </project> \ No newline at end of file |
From: <jbo...@li...> - 2006-01-20 02:40:35
|
Author: mar...@jb... Date: 2006-01-19 21:40:30 -0500 (Thu, 19 Jan 2006) New Revision: 2143 Added: trunk/labs/jbossrules/drools-core/src/test/resources/manners8.dat Log: -Added manners8.dat Added: trunk/labs/jbossrules/drools-core/src/test/resources/manners8.dat =================================================================== --- trunk/labs/jbossrules/drools-core/src/test/resources/manners8.dat 2006-01-19 20:52:26 UTC (rev 2142) +++ trunk/labs/jbossrules/drools-core/src/test/resources/manners8.dat 2006-01-20 02:40:30 UTC (rev 2143) @@ -0,0 +1,22 @@ +(printout t "asserting all guests " crlf ) +(guest (name n1) (sex m) (hobby h3) ) +(guest (name n1) (sex m) (hobby h2) ) +(guest (name n2) (sex m) (hobby h2) ) +(guest (name n2) (sex m) (hobby h3) ) +(guest (name n3) (sex m) (hobby h1) ) +(guest (name n3) (sex m) (hobby h2) ) +(guest (name n3) (sex m) (hobby h3) ) +(guest (name n4) (sex f) (hobby h3) ) +(guest (name n4) (sex f) (hobby h2) ) +(guest (name n5) (sex f) (hobby h1) ) +(guest (name n5) (sex f) (hobby h2) ) +(guest (name n5) (sex f) (hobby h3) ) +(guest (name n6) (sex f) (hobby h3) ) +(guest (name n6) (sex f) (hobby h1) ) +(guest (name n6) (sex f) (hobby h2) ) +(guest (name n7) (sex f) (hobby h3) ) +(guest (name n7) (sex f) (hobby h2) ) +(guest (name n8) (sex m) (hobby h3) ) +(guest (name n8) (sex m) (hobby h1) ) +(last_seat (seat 8) ) +(context (state start)) \ No newline at end of file |
Author: mic...@jb... Date: 2006-01-19 06:59:00 -0500 (Thu, 19 Jan 2006) New Revision: 2141 Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/FunctionDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java Log: added generic query API, and made functions optimistic lock Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java 2006-01-19 11:22:26 UTC (rev 2140) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java 2006-01-19 11:59:00 UTC (rev 2141) @@ -20,6 +20,7 @@ private String functionContent; private String description; private String semantic; + private int lockingVersion = 0; public String getSemantic(){ return semantic; @@ -79,5 +80,13 @@ public String getVersionComment(){ return this.versionComment; } + + private int getLockingVersion() { + return lockingVersion; + } + private void setLockingVersion(int lockingVersion) { + this.lockingVersion = lockingVersion; + } + } Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-19 11:22:26 UTC (rev 2140) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-19 11:59:00 UTC (rev 2141) @@ -1,6 +1,8 @@ package org.drools.repository; import java.util.List; +import java.util.Map; +import java.util.Properties; import org.drools.repository.db.Asset; import org.drools.repository.db.ISaveHistory; @@ -131,4 +133,30 @@ /** This is only required for stateful Repository session. It will be ignored for stateless ones. */ public abstract void close(); + + /** + * A very powerful generic query utility. + * This allows you to query the entire repository, and return lists of object, fields etc. + * Even individual objects. + * + * The Query language is HQL (hibernate query language). + * + * The properties should be (key, value) where value is the appropriate type of the field to query on. + * The key maps to a " :key" item in your query string. + * + * For instance, <code>query = "from RuleDef where versionNumber > :max and name = :name";</code> + * will have a map: + * <code> + * map.put("max", new Long(42)); + * map.put("name", "This is a String"); + * //note the appropriate type to match the properties you want to search ! + * </code> + * + * @param query HQL query. Can be of the format "from ClassName where propertyName = :variableInMap" + * You can also do "select name from RuleSetDef where ..." and so on. It will then return a list + * of strings. If you do "select name, Id from RuleDef .." it will return a list of Object[] "tuples". + * @param parameters A map of name => value (in appropriate type) to mix in with the query. + * + */ + public abstract List query(String query, Map parameters); } \ No newline at end of file Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-19 11:22:26 UTC (rev 2140) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-19 11:59:00 UTC (rev 2141) @@ -1,10 +1,15 @@ package org.drools.repository; +import java.util.Enumeration; +import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Properties; import org.drools.repository.db.Asset; import org.drools.repository.db.ISaveHistory; +import org.hibernate.Query; import org.hibernate.Session; /** @@ -227,6 +232,20 @@ } + + public List query(String query, + Map parameters) { + Query q = session.createQuery(query); + + for ( Iterator iter = parameters.keySet().iterator(); iter.hasNext(); ) { + String key = (String) iter.next(); + q.setParameter(key, parameters.get(key)); + } + + return q.list(); + } + + Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/FunctionDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/FunctionDef.hbm.xml 2006-01-19 11:22:26 UTC (rev 2140) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/FunctionDef.hbm.xml 2006-01-19 11:59:00 UTC (rev 2141) @@ -4,10 +4,13 @@ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> - <class name="org.drools.repository.FunctionDef" table="FUNCTION_DEFINITIONS" select-before-update="true"> + <class name="org.drools.repository.FunctionDef" table="FUNCTION_DEFINITIONS" + optimistic-lock="version" + select-before-update="true"> <id name="id" column="FUNCTION_ID"> <generator class="native"/> </id> + <version name="lockingVersion" column="LOCKING_VERSION" /> <property name="description" column="DESCRIPTION" length="256" /> <property name="functionContent" column="FUNCTION_CONTENT" type="text"/> <property name="semantic" column="SEMANTIC" length="32" /> Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java 2006-01-19 11:22:26 UTC (rev 2140) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java 2006-01-19 11:59:00 UTC (rev 2141) @@ -1,7 +1,9 @@ package org.drools.repository; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Random; import org.hibernate.StaleObjectStateException; @@ -309,8 +311,20 @@ //ooh look, the new one has 3, and they are all different rules ! assertEquals(3, repo.loadRuleSet("Integration ruleset 1", 2).getRules().size()); + runTestQueryAPI( repo ); + repo.close(); } + + + private void runTestQueryAPI(RepositoryManager repo) { + Map params = new HashMap(); + params.put("fragment", "%Integration%"); + params.put("version", new Long(1)); + List query = repo.query("from RuleDef where name like :fragment and versionNumber = :version", params); + assertNotNull(query); + assertTrue(query.size() > 0); + } /** |
Author: mic...@jb... Date: 2006-01-19 06:22:26 -0500 (Thu, 19 Jan 2006) New Revision: 2140 Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RulePersistenceTest.java trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RuleSetPersistenceTest.java Log: improved mappings for ruleset Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java 2006-01-19 07:24:31 UTC (rev 2139) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java 2006-01-19 11:22:26 UTC (rev 2140) @@ -29,15 +29,10 @@ private Date expiryDate; private Long historicalId; private boolean historicalRecord = false; - private int lockingVersion = 0; + private int lockingVersion = 0; + private RuleSetDef owningRuleSet = null; - private int getLockingVersion() { - return lockingVersion; - } - private void setLockingVersion(int lockingVersion) { - this.lockingVersion = lockingVersion; - } /** * Use tagging to aid with searching and sorting of large numbers of rules. @@ -171,7 +166,7 @@ return name; } - private void setName(String name) { + void setName(String name) { this.name = name; } @@ -243,9 +238,31 @@ } } + /** + * When a rule is allocated to a ruleset, it is "owned" by that ruleset. + * If it is added to another ruleset, a copy is added. + * + * This may be null, meaning that it is a free floating rule. + */ + public RuleSetDef getOwningRuleSet() { + return owningRuleSet; + } + + void setOwningRuleSet(RuleSetDef owningRuleSet) { + this.owningRuleSet = owningRuleSet; + } + /** return true if different */ private boolean diffStr(String left, String right) { return !left.equals(right); } + + private int getLockingVersion() { + return lockingVersion; + } + private void setLockingVersion(int lockingVersion) { + this.lockingVersion = lockingVersion; + } + } Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java 2006-01-19 07:24:31 UTC (rev 2139) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java 2006-01-19 11:22:26 UTC (rev 2140) @@ -81,9 +81,32 @@ this.versionHistory = versionHistory; } + /** + * Adds a rule to the ruleset. + * If the rule belongs to another ruleset already, it will be copied, and the name + * prepended with the ruleset name (to ensure it is unique). + * + * ie: rulesetName:originalRuleName + * + * (if you don't like that, then copy() the rule before adding it). + * + * If a rule is new, obviously there is no copying, and the name is "as is". + * The rule may have been stored previously, "unattached" which is also fine (won't be copied). + */ public RuleSetDef addRule(RuleDef rule) { - return addAssetToSet( rule, - this.rules ); + if (rule.getOwningRuleSet() == null) { + rule.setOwningRuleSet(this); + return addAssetToSet( rule, + this.rules ); + } else { + //we have to make a copy + RuleDef newRule = (RuleDef) rule.copy(); + newRule.setName(this.getName() + ":" + rule.getName()); + newRule.setOwningRuleSet(this); + return addAssetToSet( newRule, + this.rules ); + + } } public RuleSetDef addAttachment(RuleSetAttachment attachmentFile) { @@ -127,6 +150,7 @@ * */ public void removeRule(RuleDef rule) { + rule.setOwningRuleSet(null); rule.setVersionNumber(IVersionable.NO_VERSION); } @@ -175,22 +199,13 @@ */ RuleSetDef addAssetToSet(IVersionable asset, Set set) { + asset.setVersionNumber( this.workingVersionNumber ); if ( asset.getId() == null ) { - asset.setVersionNumber( this.workingVersionNumber ); - asset.setVersionComment( "New" ); + asset.setVersionComment( "new" ); set.add( asset ); } else { - asset.setVersionNumber( this.workingVersionNumber ); set.add( asset ); -// throw new RepositoryException("The repo does not support sharing of rules across rulesets at this time." + -// "Assets must be copied, and given a unique " + -// "name before being added to the RuleSet. This asset already has a name and identity."); -//// IVersionable copy = asset.copy(); -//// copy.setVersionNumber( this.workingVersionNumber ); -//// copy.setVersionComment( "Copied for this version from version: " -//// + asset.getVersionNumber() ); -//// set.add( copy ); } return this; } Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml 2006-01-19 07:24:31 UTC (rev 2139) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml 2006-01-19 11:22:26 UTC (rev 2140) @@ -32,6 +32,8 @@ <one-to-many class="org.drools.repository.Tag" /> </set> + <many-to-one name="owningRuleSet" /> + <component name="metaData"> <property name="title" /> <property name="creator" /> Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RulePersistenceTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RulePersistenceTest.java 2006-01-19 07:24:31 UTC (rev 2139) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RulePersistenceTest.java 2006-01-19 11:22:26 UTC (rev 2140) @@ -34,6 +34,7 @@ def.removeTag("tag1"); repo.save(def); def = repo.loadRule("myRule3", 1); + assertEquals(null, def.getOwningRuleSet()); assertEquals(2, def.getTags().size()); } Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RuleSetPersistenceTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RuleSetPersistenceTest.java 2006-01-19 07:24:31 UTC (rev 2139) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RuleSetPersistenceTest.java 2006-01-19 11:22:26 UTC (rev 2140) @@ -328,8 +328,45 @@ assertEquals(1, info.getVersionNumber()); } + public void testAddRemoveCopyRules() { + RuleSetDef ruleset = new RuleSetDef("another one", null); + RepositoryManager repo = getRepo(); + + RuleDef preExist = new RuleDef("preexist", "yeah"); + repo.save(preExist); + repo.save(ruleset); + + ruleset.addRule(preExist); + assertEquals(ruleset, preExist.getOwningRuleSet()); + + repo.save(ruleset); + + RuleSetDef newruleset = new RuleSetDef("yao", null); + repo.save(ruleset); + + newruleset.addRule(preExist); + RuleDef other = newruleset.findRuleByName("yao" + ":" + preExist.getName()); + assertEquals(null, other.getId()); //so we know it is a copy + assertEquals(newruleset, other.getOwningRuleSet()); + repo.save(newruleset); + + newruleset = repo.loadRuleSet("yao", 1); + assertEquals(1, newruleset.getRules().size()); + other = (RuleDef) newruleset.getRules().iterator().next(); + assertTrue(other.getName().startsWith("yao")); + + newruleset.removeRule(other); + repo.save(newruleset); + + newruleset = repo.loadRuleSet("yao", 1); + ruleset = repo.loadRuleSet("another one", 1); + assertEquals(1, ruleset.getRules().size()); + assertEquals(0, newruleset.getRules().size()); + + } +// // public void testLargeNumbers() { // RuleSetDef large = new RuleSetDef("Large1", null); // @@ -340,9 +377,11 @@ // def.addTag("HR" + i); // large.addRule(def); // } -// RepositoryImpl repo = getRepo(); +// RepositoryManager repo = RepositoryFactory.getStatefulRepository(); // repo.save(large); +// repo.close(); // +// repo = RepositoryFactory.getStatefulRepository(); // System.out.println("Saved " + System.currentTimeMillis()); // // large = repo.loadRuleSet("Large1", 1); @@ -356,8 +395,8 @@ // large.addTag("blah"); // repo.save(large); // System.out.println("Change saved " + System.currentTimeMillis()); +// repo.close(); // -// // } } \ No newline at end of file |
From: <jbo...@li...> - 2006-01-19 07:23:26
|
Author: mic...@jb... Date: 2006-01-19 02:23:21 -0500 (Thu, 19 Jan 2006) New Revision: 2138 Modified: trunk/labs/jbossrules/drools-repository/pom.xml Log: uses local repo for JTA dependency Modified: trunk/labs/jbossrules/drools-repository/pom.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/pom.xml 2006-01-19 07:15:22 UTC (rev 2137) +++ trunk/labs/jbossrules/drools-repository/pom.xml 2006-01-19 07:23:21 UTC (rev 2138) @@ -11,6 +11,13 @@ <version>3.0-M1-dev</version> <packaging>jar</packaging> + <repositories> + <repository> + <id>basedir</id> + <url>file://${basedir}/../repository</url> + </repository> + </repositories> + <dependencies> <dependency> <groupId>junit</groupId> |
Author: mic...@jb... Date: 2006-01-19 02:15:22 -0500 (Thu, 19 Jan 2006) New Revision: 2137 Added: trunk/labs/jbossrules/repository/javax/ trunk/labs/jbossrules/repository/javax/transaction/ trunk/labs/jbossrules/repository/javax/transaction/jta/ trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/ trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom.sha1 trunk/labs/jbossrules/repository/jci/ trunk/labs/jbossrules/repository/jci/jci/ trunk/labs/jbossrules/repository/jci/jci/SNAPSHOT-2005/ trunk/labs/jbossrules/repository/jci/jci/SNAPSHOT-2005/jci-SNAPSHOT-2005.jar trunk/labs/jbossrules/repository/jci/jci/SNAPSHOT-2005/jci-SNAPSHOT-2005.pom Log: required for SMF, and hibernate Added: trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom =================================================================== --- trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom 2006-01-19 01:49:16 UTC (rev 2136) +++ trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom 2006-01-19 07:15:22 UTC (rev 2137) @@ -0,0 +1,14 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>javax.transaction</groupId> + <artifactId>jta</artifactId> + <version>1.0.1B</version> + <name>Java Transaction API</name> + <description> + The javax.transaction package. It is appropriate for inclusion in a classpath, and may be added to a Java 2 installation. + </description> + <url>http://java.sun.com/products/jta</url> + <distributionManagement> + <downloadUrl>http://java.sun.com/products/jta</downloadUrl> + </distributionManagement> +</project> \ No newline at end of file Property changes on: trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom.sha1 =================================================================== --- trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom.sha1 2006-01-19 01:49:16 UTC (rev 2136) +++ trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom.sha1 2006-01-19 07:15:22 UTC (rev 2137) @@ -0,0 +1 @@ +9fbaf81aba46a55a46fcb8b666568aa0feaf2f32 /home/projects/maven/repository-staging/to-ibiblio/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom Property changes on: trunk/labs/jbossrules/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.pom.sha1 ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/repository/jci/jci/SNAPSHOT-2005/jci-SNAPSHOT-2005.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/repository/jci/jci/SNAPSHOT-2005/jci-SNAPSHOT-2005.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbossrules/repository/jci/jci/SNAPSHOT-2005/jci-SNAPSHOT-2005.pom =================================================================== --- trunk/labs/jbossrules/repository/jci/jci/SNAPSHOT-2005/jci-SNAPSHOT-2005.pom 2006-01-19 01:49:16 UTC (rev 2136) +++ trunk/labs/jbossrules/repository/jci/jci/SNAPSHOT-2005/jci-SNAPSHOT-2005.pom 2006-01-19 07:15:22 UTC (rev 2137) @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>jci</groupId> + <artifactId>jci</artifactId> + <version>SNAPSHOT-2005</version> + <dependencies/> +</project> \ No newline at end of file Property changes on: trunk/labs/jbossrules/repository/jci/jci/SNAPSHOT-2005/jci-SNAPSHOT-2005.pom ___________________________________________________________________ Name: svn:eol-style + native |
Author: mic...@jb... Date: 2006-01-18 20:49:16 -0500 (Wed, 18 Jan 2006) New Revision: 2136 Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/AttachmentPersistTest.java trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RulePersistenceTest.java trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RuleSetPersistenceTest.java trunk/labs/jbossrules/drools-repository/src/test/resources/drools-repository-db.cfg.xml Log: major tidy up. Attachments are now save history types, as well as lockable, optimistic locks etc. Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-19 01:15:54 UTC (rev 2135) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-19 01:49:16 UTC (rev 2136) @@ -3,6 +3,7 @@ import java.util.List; import org.drools.repository.db.Asset; +import org.drools.repository.db.ISaveHistory; /** * The repository manager takes care of storing and sychronising the repository @@ -32,13 +33,18 @@ public abstract List listRuleVersions(String ruleName); /** - * Find and return all the historical versions of a rule. - * Historcal versions are previous versions of the rules stored when - * a change to the rule was saved. + * Find and return all the historical versions of an asset. + * Historcal versions are previous versions of the asset stored when + * a change was saved. * * This is distinct from Versions which are related to RuleSet versioning. -= */ - public abstract List listRuleSaveHistory(RuleDef rule); + * Save history is provided for "unlimited undo" facilities. Normally the historical items are + * hidden away. + * + * @param The latest version of an asset (ie NOT a historical record !) + * @return A list of the historical items for your viewing pleasure. += */ + public abstract List listSaveHistory(ISaveHistory asset); public abstract List findRulesByTag(String tag); Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-19 01:15:54 UTC (rev 2135) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-19 01:49:16 UTC (rev 2136) @@ -4,6 +4,7 @@ import org.drools.repository.db.Asset; +import org.drools.repository.db.ISaveHistory; import org.hibernate.Session; /** @@ -54,15 +55,14 @@ return result; } - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#listRuleSaveHistory(org.drools.repository.RuleDef) - */ - public List listRuleSaveHistory(RuleDef rule) { + public List listSaveHistory(ISaveHistory asset) { disableHistoryFilter( session ); - List result = (List) session.createQuery( "from RuleDef where historicalId = :id" ).setLong( "id", - rule.getId().longValue() ).list(); - +// List result = (List) session.createQuery( "from RuleDef where historicalId = :id" ).setLong( "id", +// rule.getId().longValue() ).list(); + String query = "from " + asset.getClass().getName() + " where historicalId = :id"; + List result = (List) session.createQuery(query) + .setLong("id", asset.getId().longValue()).list(); enableHistoryFilter( session ); return result; } Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java 2006-01-19 01:15:54 UTC (rev 2135) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java 2006-01-19 01:49:16 UTC (rev 2136) @@ -3,6 +3,7 @@ import java.util.HashSet; import java.util.Set; +import org.drools.repository.db.ISaveHistory; import org.drools.repository.db.IVersionable; import org.drools.repository.db.Asset; @@ -20,7 +21,7 @@ * @author <a href="mailto:mic...@gm..."> Michael Neale</a> * */ -public class RuleSetAttachment extends Asset implements IVersionable { +public class RuleSetAttachment extends Asset implements ISaveHistory { private static final long serialVersionUID = 7474038734785975202L; @@ -37,6 +38,8 @@ private int lockingVersion = 0; private boolean checkedOut; private String checkedOutBy; + private Long historicalId; + private boolean historicalRecord = false; @@ -177,6 +180,26 @@ this.checkedOutBy = checkedOutBy; } + public Long getHistoricalId() { + return historicalId; + } + + public void setHistoricalId(Long historicalId) { + this.historicalId = historicalId; + } + + public boolean isHistoricalRecord() { + return historicalRecord; + } + + public void setHistoricalRecord(boolean historicalRecord) { + this.historicalRecord = historicalRecord; + } + + public boolean isStateChanged(ISaveHistory oldObject) { + return true; + } + } Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml 2006-01-19 01:15:54 UTC (rev 2135) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml 2006-01-19 01:49:16 UTC (rev 2136) @@ -21,12 +21,20 @@ <property name="versionComment" /> <property name="checkedOut" /> <property name="checkedOutBy" /> + <property name="historicalRecord" column="HISTORICAL_RECORD_FLAG" /> + <property name="historicalId" /> <set name="tags" table="RULESET_ATTACHMENT_TAGS" lazy="false" cascade="all" optimistic-lock="false"> <key column="RULESET_ATTACHMENT_ID"/> <one-to-many class="org.drools.repository.Tag"/> </set> + <filter name="historyFilter" condition=":viewHistory = HISTORICAL_RECORD_FLAG" /> + </class> + + <filter-def name="historyFilter"> + <filter-param name="viewHistory" type="boolean" /> + </filter-def> </hibernate-mapping> \ No newline at end of file Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/AttachmentPersistTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/AttachmentPersistTest.java 2006-01-19 01:15:54 UTC (rev 2135) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/AttachmentPersistTest.java 2006-01-19 01:49:16 UTC (rev 2136) @@ -1,17 +1,37 @@ package org.drools.repository; +import java.util.List; + import org.drools.repository.db.PersistentCase; public class AttachmentPersistTest extends PersistentCase { public void testLoadSave() { - RuleSetAttachment at = new RuleSetAttachment("test","test", "test".getBytes(), "blah.xml" ); + byte[] data = "test".getBytes(); + RuleSetAttachment at = new RuleSetAttachment("test","test", data, "blah.xml" ); RepositoryManager repo = getRepo(); at.addTag("RULESETAT"); repo.save(at); RuleSetAttachment at2 = repo.loadAttachment("test", 1); assertEquals("test", at2.getTypeOfAttachment()); assertEquals("RULESETAT", ((Tag)at2.getTags().iterator().next()).getTag()); + assertTrue((new String(data)).equals(new String(at2.getContent())) ); } + public void testHistory() { + RuleSetAttachment at = new RuleSetAttachment("historical one", "histo", "test".getBytes(), "nothing.txt"); + RepositoryManager repo = getRepo(); + repo.save(at); + + assertEquals(0, repo.listSaveHistory(at).size()); + + at.setContent("test2".getBytes()); + repo.save(at); + + List history = repo.listSaveHistory(at); + assertEquals(1, history.size()); + + + } + } Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java 2006-01-19 01:15:54 UTC (rev 2135) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java 2006-01-19 01:49:16 UTC (rev 2136) @@ -273,7 +273,7 @@ //just to prove the save history, lets check the history of a rule rule = ruleSet.findRuleByName("Integration rule 2"); - List history = repo.listRuleSaveHistory(rule); + List history = repo.listSaveHistory(rule); assertEquals(1, history.size()); RuleDef historicalRule = (RuleDef) history.get(0); String oldContent = historicalRule.getContent(); Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RulePersistenceTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RulePersistenceTest.java 2006-01-19 01:15:54 UTC (rev 2135) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RulePersistenceTest.java 2006-01-19 01:49:16 UTC (rev 2136) @@ -111,7 +111,7 @@ list = repo.listRuleVersions("rh1"); assertEquals(2, list.size()); - list = repo.listRuleSaveHistory(rule); + list = repo.listSaveHistory(rule); assertEquals(2, list.size()); } Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RuleSetPersistenceTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RuleSetPersistenceTest.java 2006-01-19 01:15:54 UTC (rev 2135) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RuleSetPersistenceTest.java 2006-01-19 01:49:16 UTC (rev 2136) @@ -271,13 +271,13 @@ repo.save(old); - assertEquals(0, repo.listRuleSaveHistory(newRule).size()); + assertEquals(0, repo.listSaveHistory(newRule).size()); old.addTag("yeah"); repo.save(old); - assertEquals(0, repo.listRuleSaveHistory(newRule).size()); + assertEquals(0, repo.listSaveHistory(newRule).size()); newRule.setContent("CHANGED CONTENT"); repo.save(old); - assertEquals(1, repo.listRuleSaveHistory(newRule).size()); + assertEquals(1, repo.listSaveHistory(newRule).size()); } Modified: trunk/labs/jbossrules/drools-repository/src/test/resources/drools-repository-db.cfg.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/resources/drools-repository-db.cfg.xml 2006-01-19 01:15:54 UTC (rev 2135) +++ trunk/labs/jbossrules/drools-repository/src/test/resources/drools-repository-db.cfg.xml 2006-01-19 01:49:16 UTC (rev 2136) @@ -43,8 +43,9 @@ <!-- Drop and re-create the database schema on startup --> <property name="hbm2ddl.auto">create</property> - - + </session-factory> + + </hibernate-configuration> \ No newline at end of file |
Author: mic...@jb... Date: 2006-01-18 20:15:54 -0500 (Wed, 18 Jan 2006) New Revision: 2135 Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Asset.java Removed: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Persistent.java Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/ApplicationDataDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/FunctionDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/ImportDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java trunk/labs/jbossrules/drools-repository/src/test/resources/drools-repository-db.cfg.xml Log: major refactoring, adding in column names Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -1,7 +1,7 @@ package org.drools.repository; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Persistent; +import org.drools.repository.db.Asset; /** * Application data contains a definition of objects that may be provided to the @@ -10,7 +10,7 @@ * * @author <a href="mailto:mic...@gm..."> Michael Neale</a> */ -public class ApplicationDataDef extends Persistent +public class ApplicationDataDef extends Asset implements IVersionable { Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -1,7 +1,7 @@ package org.drools.repository; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Persistent; +import org.drools.repository.db.Asset; /** * A FunctionDef contains the definition of a function that is used in one or more rules. @@ -9,7 +9,7 @@ * * @author <a href="mailto:mic...@gm..."> Michael Neale</a> */ -public class FunctionDef extends Persistent +public class FunctionDef extends Asset implements IVersionable { Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -1,7 +1,7 @@ package org.drools.repository; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Persistent; +import org.drools.repository.db.Asset; /** * This holds a type import for a ruleset. @@ -10,7 +10,7 @@ * (same argument for ApplicationDataDef). * @author <a href="mailto:mic...@gm..."> Michael Neale</a> */ -public class ImportDef extends Persistent +public class ImportDef extends Asset implements IVersionable { Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -2,6 +2,8 @@ import java.util.List; +import org.drools.repository.db.Asset; + /** * The repository manager takes care of storing and sychronising the repository * data with the repository database. @@ -17,12 +19,6 @@ */ public interface RepositoryManager { - /** - * This will simply save the current version of the rule. - * If there is a previous saved version of the rule, it will be stored as a historical record. - */ - public abstract void save(RuleDef newRule); - /** * Load a rule based on a workingVersionNumber. */ @@ -46,8 +42,6 @@ public abstract List findRulesByTag(String tag); - /** Save the ruleset. The Ruleset will not be reloaded. */ - public abstract void save(RuleSetDef ruleSet); /** * This loads a RuleSet with the appropriate workingVersionNumber applied to @@ -66,12 +60,18 @@ */ public abstract RuleSetAttachment loadAttachment(String name, long workingVersionNumber); - public abstract void save(RuleSetAttachment attachment); + /** + * Saves an asset. Most assets are saved automatically when you save the parent, so + * for instance when you save a ruleset, you should not need to save any of its assets as well. + * + * Some assets, such as rules and ruleset attachments have history items created on each save. + */ + public abstract void save(Asset asset); /** Returns List<String> of Rule set names */ public abstract List listRuleSets(); - public abstract void delete(RuleDef rule); + public abstract void delete(Asset rule); /** * Searches the ruleset for a rule with a certain tag. This will search ALL @@ -100,6 +100,28 @@ */ public abstract void checkInRule(RuleDef rule, String userId); + + /** + * This will check out an for the given user id. + * This can be used to enforce "locking" of rule edits. + * + * This will save the attachment as it stands, including any changes. + */ + public abstract void checkOutAttachment(RuleSetAttachment attachment, String userId); + + /** + * This removes the check out flag. + * + * The userId must be supplied to confirm that the correct user + * is checking it in, an exception will be thrown if this is not correct. + * + * This can effectively be "overridden" by either just saving the rule, or passing + * in the correct username. It is up to client applications to enforce this behaviour. + */ + public abstract void checkInAttachment(RuleSetAttachment attachment, String userId); + + + /** This is only required for stateful Repository session. It will be ignored for stateless ones. */ public abstract void close(); Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -3,6 +3,7 @@ import java.util.List; +import org.drools.repository.db.Asset; import org.hibernate.Session; /** @@ -29,13 +30,8 @@ this.session = session; } - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#save(org.drools.repository.RuleDef) - */ - public void save(RuleDef newRule) { - session.saveOrUpdate( newRule ); - } + /* (non-Javadoc) * @see org.drools.repository.db.RepositoryManager#loadRule(java.lang.String, long) */ @@ -81,11 +77,8 @@ return result; } - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#save(org.drools.repository.RuleSetDef) - */ - public void save(RuleSetDef ruleSet) { - session.saveOrUpdate( ruleSet ); + public void save(Asset asset) { + session.saveOrUpdate( asset ); } /* (non-Javadoc) @@ -136,13 +129,8 @@ return at; } - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#save(org.drools.repository.RuleSetAttachment) - */ - public void save(RuleSetAttachment attachment) { - session.saveOrUpdate( attachment ); - } + /* (non-Javadoc) * @see org.drools.repository.db.RepositoryManager#listRuleSets() */ @@ -154,7 +142,7 @@ /* (non-Javadoc) * @see org.drools.repository.db.RepositoryManager#delete(org.drools.repository.RuleDef) */ - public void delete(RuleDef rule) { + public void delete(Asset rule) { session.delete( rule ); } @@ -174,6 +162,9 @@ public void checkOutRule(RuleDef rule, String userId) { + if (rule.isCheckedOut()) { + throw new RepositoryException("Rule is already checked out to " + userId); + } rule.setCheckedOut(true); rule.setCheckedOutBy(userId); session.update(rule); @@ -188,6 +179,28 @@ session.update(rule); } + public void checkOutAttachment(RuleSetAttachment attachment, + String userId) { + if (attachment.isCheckedOut()) { + throw new RepositoryException("Rule is already checked out to " + userId); + } + attachment.setCheckedOut(true); + attachment.setCheckedOutBy(userId); + session.update(attachment); + + } + + public void checkInAttachment(RuleSetAttachment attachment, + String userId) { + if (!userId.equals(attachment.getCheckedOutBy())) { + throw new RepositoryException("Unable to check in the attachment, as it is currently checked out by " + attachment.getCheckedOutBy()); + } + attachment.setCheckedOut(false); + attachment.setCheckedOutBy(null); + session.update(attachment); + } + + public void close() { /*implemented by the proxy */} @@ -213,6 +226,7 @@ session.disableFilter( "workingVersionFilter" ); } + Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -7,9 +7,9 @@ import org.drools.repository.db.ISaveHistory; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Persistent; +import org.drools.repository.db.Asset; -public class RuleDef extends Persistent +public class RuleDef extends Asset implements ISaveHistory { Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -4,7 +4,7 @@ import java.util.Set; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Persistent; +import org.drools.repository.db.Asset; /** @@ -20,7 +20,7 @@ * @author <a href="mailto:mic...@gm..."> Michael Neale</a> * */ -public class RuleSetAttachment extends Persistent implements IVersionable { +public class RuleSetAttachment extends Asset implements IVersionable { private static final long serialVersionUID = 7474038734785975202L; @@ -34,7 +34,12 @@ private long versionNumber; private String versionComment; private Set tags; + private int lockingVersion = 0; + private boolean checkedOut; + private String checkedOutBy; + + /** * * @param typeOfAttachment The type of the content, eg XLS, CSV, HTML. @@ -55,6 +60,7 @@ this.versionNumber = 1; this.versionComment = "new"; this.tags = new HashSet(); + this.checkedOut = false; } RuleSetAttachment() { @@ -147,6 +153,30 @@ this.tags = tags; } + private int getLockingVersion() { + return lockingVersion; + } + + private void setLockingVersion(int lockingVersion) { + this.lockingVersion = lockingVersion; + } + + public boolean isCheckedOut() { + return checkedOut; + } + + void setCheckedOut(boolean checkedOut) { + this.checkedOut = checkedOut; + } + + public String getCheckedOutBy() { + return checkedOutBy; + } + + void setCheckedOutBy(String checkedOutBy) { + this.checkedOutBy = checkedOutBy; + } + } Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -7,7 +7,7 @@ import java.util.Set; import org.drools.repository.db.IVersionable; -import org.drools.repository.db.Persistent; +import org.drools.repository.db.Asset; /** * The ruleset definition contains a grouping of rules for editing/release. The @@ -30,7 +30,7 @@ * * @author <a href="mailto:mic...@gm..."> Michael Neale</a> */ -public class RuleSetDef extends Persistent +public class RuleSetDef extends Asset implements Comparable { private static final long serialVersionUID = 608068118653708104L; Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -2,7 +2,7 @@ import java.util.Date; -import org.drools.repository.db.Persistent; +import org.drools.repository.db.Asset; /** * This records information about a particular version of a ruleset. @@ -15,7 +15,7 @@ * @author <a href="mailto:mic...@gm..."> Michael Neale</a> * */ -public class RuleSetVersionInfo extends Persistent implements Comparable { +public class RuleSetVersionInfo extends Asset implements Comparable { private static final long serialVersionUID = 53728327711138178L; Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -5,7 +5,7 @@ import java.util.Iterator; import java.util.Set; -import org.drools.repository.db.Persistent; +import org.drools.repository.db.Asset; /** @@ -17,7 +17,7 @@ * @author <a href="mailto:mic...@gm..."> Michael Neale</a> * */ -public class Tag extends Persistent { +public class Tag extends Asset { private String tag; Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Asset.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Asset.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Asset.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -0,0 +1,19 @@ +package org.drools.repository.db; + +import java.io.Serializable; + +/** The layer supertype for repository persistable classes. */ +public class Asset implements Serializable { + + private Long id; + + public Long getId(){ + return id; + } + + private void setId(Long id){ + this.id = id; + } + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Asset.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Persistent.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Persistent.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Persistent.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -1,19 +0,0 @@ -package org.drools.repository.db; - -import java.io.Serializable; - -/** The layer supertype for repository persistable classes. */ -public class Persistent implements Serializable { - - private Long id; - - public Long getId(){ - return id; - } - - private void setId(Long id){ - this.id = id; - } - - -} Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/ApplicationDataDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/ApplicationDataDef.hbm.xml 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/ApplicationDataDef.hbm.xml 2006-01-19 01:15:54 UTC (rev 2135) @@ -8,9 +8,9 @@ <id name="id" column="APP_DATA_ID"> <generator class="native" /> </id> - <property name="type" /> - <property name="identifier" /> - <property name="versionComment" /> - <property name="versionNumber" /> + <property name="type" column="CLASS_TYPE" length="64" /> + <property name="identifier" column="DATA_IDENTIFIER" length="32" /> + <property name="versionComment" column="VERSION_COMMENT" length="64" /> + <property name="versionNumber" column="VERSION_NUMBER" /> </class> </hibernate-mapping> \ No newline at end of file Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/FunctionDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/FunctionDef.hbm.xml 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/FunctionDef.hbm.xml 2006-01-19 01:15:54 UTC (rev 2135) @@ -8,10 +8,10 @@ <id name="id" column="FUNCTION_ID"> <generator class="native"/> </id> - <property name="description" /> - <property name="functionContent" /> - <property name="semantic" /> - <property name="versionComment" /> - <property name="versionNumber" /> + <property name="description" column="DESCRIPTION" length="256" /> + <property name="functionContent" column="FUNCTION_CONTENT" type="text"/> + <property name="semantic" column="SEMANTIC" length="32" /> + <property name="versionComment" column="VERSION_COMMENT" length="128" /> + <property name="versionNumber" column="VERSION_NUMBER" /> </class> </hibernate-mapping> \ No newline at end of file Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/ImportDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/ImportDef.hbm.xml 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/ImportDef.hbm.xml 2006-01-19 01:15:54 UTC (rev 2135) @@ -8,8 +8,8 @@ <id name="id" column="IMPORT_ID"> <generator class="native"/> </id> - <property name="type" /> - <property name="versionComment" /> - <property name="versionNumber" /> + <property name="type" column="CLASS_TYPE" length="64" /> + <property name="versionComment" column="VERSION_COMMMENT" length="128" /> + <property name="versionNumber" column="VERSION_NUMBER" /> </class> </hibernate-mapping> \ No newline at end of file Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml 2006-01-19 01:15:54 UTC (rev 2135) @@ -13,19 +13,19 @@ <generator class="native"/> </id> - <version name="lockingVersion" /> - <property name="name" /> - <property name="versionNumber" /> - <property name="content" type="text" /> - <property name="status" /> - <property name="checkedOut" /> - <property name="checkedOutBy" /> - <property name="versionComment" /> - <property name="documentation" /> - <property name="effectiveDate" /> - <property name="expiryDate" /> - <property name="historicalId" /> - <property name="historicalRecord" /> + <version name="lockingVersion" column="LOCKING_VERSION" /> + <property name="name" column="RULE_NAME" length="64" /> + <property name="versionNumber" column="VERSION_NUMBER" /> + <property name="content" type="text" column="RULE_CONTENT" /> + <property name="status" column="STATUS" length="32" /> + <property name="checkedOut" column="CHECKED_OUT" /> + <property name="checkedOutBy" column="CHECKED_OUT_BY" length="64"/> + <property name="versionComment" column="VERSION_COMMENT" length="128"/> + <property name="documentation" column="DOCUMENTATION" type="text"/> + <property name="effectiveDate" column="EFFECTIVE_DATE" /> + <property name="expiryDate" column="EXPIRY_DATE"/> + <property name="historicalId" column="HISTORICAL_ID"/> + <property name="historicalRecord" column="HISTORICAL_RECORD_FLAG"/> <set name="tags" table="RULE_TAGS" lazy="false" cascade="all" optimistic-lock="false"> <key column="RULE_ID"/> @@ -48,7 +48,7 @@ <property name="rights" /> </component> - <filter name="historyFilter" condition=":viewHistory = historicalRecord" /> + <filter name="historyFilter" condition=":viewHistory = HISTORICAL_RECORD_FLAG" /> </class> <filter-def name="historyFilter"> Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml 2006-01-19 01:15:54 UTC (rev 2135) @@ -6,17 +6,21 @@ <hibernate-mapping> - <class name="org.drools.repository.RuleSetAttachment" table="DROOLS_ATTACHMENTS"> + <class name="org.drools.repository.RuleSetAttachment" table="DROOLS_ATTACHMENTS" + select-before-update="true" optimistic-lock="version"> <id name="id" column="RULESET_ATTACHMENT_ID"> <generator class="native"/> </id> + <version name="lockingVersion" column="LOCKING_VERSION" /> <property name="name" not-null="true" /> <property name="typeOfAttachment" /> <property name="content" /> <property name="originalFileName" /> <property name="versionNumber" /> <property name="versionComment" /> + <property name="checkedOut" /> + <property name="checkedOutBy" /> <set name="tags" table="RULESET_ATTACHMENT_TAGS" lazy="false" cascade="all" optimistic-lock="false"> <key column="RULESET_ATTACHMENT_ID"/> Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml 2006-01-19 01:15:54 UTC (rev 2135) @@ -46,7 +46,7 @@ <set name="rules" lazy="false" table="RULESET_RULES" cascade="all" optimistic-lock="false"> <key column="RULESET_ID"/> <one-to-many class="org.drools.repository.RuleDef"/> - <filter name="workingVersionFilter" condition=":filteredVersionNumber = versionNumber" /> + <filter name="workingVersionFilter" condition=":filteredVersionNumber = VERSION_NUMBER" /> </set> <set name="attachments" lazy="false" table="RULESET_ATTACHMENTS" cascade="all" optimistic-lock="false"> @@ -58,19 +58,19 @@ <set name="imports" lazy="false" table="RULESET_IMPORTS" cascade="all" optimistic-lock="false"> <key column="RULESET_ID"/> <one-to-many class="org.drools.repository.ImportDef"/> - <filter name="workingVersionFilter" condition=":filteredVersionNumber = versionNumber" /> + <filter name="workingVersionFilter" condition=":filteredVersionNumber = VERSION_NUMBER" /> </set> <set name="functions" lazy="false" table="RULESET_FUNCTIONS" cascade="all" optimistic-lock="false"> <key column="RULESET_ID"/> <one-to-many class="org.drools.repository.FunctionDef"/> - <filter name="workingVersionFilter" condition=":filteredVersionNumber = versionNumber" /> + <filter name="workingVersionFilter" condition=":filteredVersionNumber = VERSION_NUMBER" /> </set> - <set name="applicationData" lazy="false" cascade="all" optimistic-lock="false"> + <set name="applicationData" table="RULESET_APP_DATA" lazy="false" cascade="all" optimistic-lock="false"> <key column="RULESET_ID"/> <one-to-many class="org.drools.repository.ApplicationDataDef"/> - <filter name="workingVersionFilter" condition=":filteredVersionNumber = versionNumber" /> + <filter name="workingVersionFilter" condition=":filteredVersionNumber = VERSION_NUMBER" /> </set> </class> Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java 2006-01-19 01:15:54 UTC (rev 2135) @@ -22,7 +22,8 @@ * @author <a href="mailto:mic...@gm..."> Michael Neale</a> */ public class IntegrationTest extends TestCase { - + + /** * This will all execute as one JUnit test. * Any failure will cause the test to stop, but this is not a unit test, @@ -92,7 +93,7 @@ ruleSetA.addRule(ruleA); ruleSetB.addRule(new RuleDef("Concurrent 4", "content")); - //should have no problems. + //should have no problems, as we are not touching the same rules. repoA.save(ruleSetA); repoB.save(ruleSetB); @@ -180,6 +181,12 @@ ruleSet = repo.loadRuleSet("Integration attachments 1", 2); assertEquals(3, ruleSet.getAttachments().size()); + RuleSetAttachment att = (RuleSetAttachment) ruleSet.getAttachments().iterator().next(); + repo.checkOutAttachment(att, "Michael"); + assertEquals(true, att.isCheckedOut()); + repo.checkInAttachment(att, "Michael"); + assertEquals(false, att.isCheckedOut()); + repo.close(); } Modified: trunk/labs/jbossrules/drools-repository/src/test/resources/drools-repository-db.cfg.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/resources/drools-repository-db.cfg.xml 2006-01-18 13:10:22 UTC (rev 2134) +++ trunk/labs/jbossrules/drools-repository/src/test/resources/drools-repository-db.cfg.xml 2006-01-19 01:15:54 UTC (rev 2135) @@ -39,7 +39,7 @@ <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout --> - <property name="show_sql">true</property> + <property name="show_sql">false</property> <!-- Drop and re-create the database schema on startup --> <property name="hbm2ddl.auto">create</property> |
From: <jbo...@li...> - 2006-01-18 13:10:27
|
Author: mla...@jb... Date: 2006-01-18 08:10:22 -0500 (Wed, 18 Jan 2006) New Revision: 2134 Modified: trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/Makefile trunk/labs/jbosswebnp/src/windows/native/JPI/core/Makefile trunk/labs/jbosswebnp/src/windows/native/JPI/mscorlib/Makefile Log: Rename JAVA_RT to JNI_RT. Modified: trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/Makefile =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/Makefile 2006-01-18 12:49:34 UTC (rev 2133) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/Makefile 2006-01-18 13:10:22 UTC (rev 2134) @@ -16,7 +16,7 @@ PPREFIX = JNI EXTRA_LFLAGS = /BASE:@../../build/baseaddr.ref,$(PPREFIX).$(PROJECT) JNI_CORE_LIB = JNI.core.lib -JAVA_RT_LIB = JNI.rt.lib +JNI_RT_LIB = JNI.rt.lib !IF !DEFINED(SRCDIR) || "$(SRCDIR)" == "" SRCDIR = . @@ -30,14 +30,14 @@ !IFNDEF WITH_JNI_CORE WITH_JNI_CORE = ../core !ENDIF -!IFNDEF WITH_JAVA_RT -WITH_JAVA_RT = ../rt +!IFNDEF WITH_JNI_RT +WITH_JNI_RT = ../rt !ENDIF -INCLUDES = $(INCLUDES) /I "$(WITH_JNI_CORE)/include" /I "$(WITH_JAVA_RT)" -LDIRS = /libpath:"$(WITH_JNI_CORE)/$(BUILDIR)" /libpath:"$(WITH_JAVA_RT)/$(BUILDIR)" +INCLUDES = $(INCLUDES) /I "$(WITH_JNI_CORE)/include" /I "$(WITH_JNI_RT)" +LDIRS = /libpath:"$(WITH_JNI_CORE)/$(BUILDIR)" /libpath:"$(WITH_JNI_RT)/$(BUILDIR)" -LFLAGS = $(LFLAGS) $(JNI_CORE_LIB) $(JAVA_RT_LIB) +LFLAGS = $(LFLAGS) $(JNI_CORE_LIB) $(JNI_RT_LIB) !include <javax.servlet.inc> Modified: trunk/labs/jbosswebnp/src/windows/native/JPI/core/Makefile =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JPI/core/Makefile 2006-01-18 12:49:34 UTC (rev 2133) +++ trunk/labs/jbosswebnp/src/windows/native/JPI/core/Makefile 2006-01-18 13:10:22 UTC (rev 2134) @@ -18,7 +18,7 @@ EXTRA_LIBS = mscoree.lib EXTRA_LFLAGS = /BASE:@../../build/baseaddr.ref,$(PPREFIX).$(PROJECT) JNI_CORE_LIB = JNI.core.lib -JAVA_RT_LIB = JNI.rt.lib +JNI_RT_LIB = JNI.rt.lib !IF !DEFINED(SRCDIR) || "$(SRCDIR)" == "" SRCDIR = . @@ -32,14 +32,14 @@ !IFNDEF WITH_JNI_CORE WITH_JNI_CORE = ../../JNI/core !ENDIF -!IFNDEF WITH_JAVA_RT -WITH_JAVA_RT = ../../JNI/rt +!IFNDEF WITH_JNI_RT +WITH_JNI_RT = ../../JNI/rt !ENDIF -INCLUDES = $(INCLUDES) /I "$(WITH_JNI_CORE)/include" /I "$(WITH_JAVA_RT)" -LDIRS = /libpath:"$(WITH_JNI_CORE)/$(BUILDIR)" /libpath:"$(WITH_JAVA_RT)/$(BUILDIR)" +INCLUDES = $(INCLUDES) /I "$(WITH_JNI_CORE)/include" /I "$(WITH_JNI_RT)" +LDIRS = /libpath:"$(WITH_JNI_CORE)/$(BUILDIR)" /libpath:"$(WITH_JNI_RT)/$(BUILDIR)" -LFLAGS = $(LFLAGS) $(JNI_CORE_LIB) $(JAVA_RT_LIB) +LFLAGS = $(LFLAGS) $(JNI_CORE_LIB) $(JNI_RT_LIB) OBJECTS = \ $(BUILDIR)\AssemblyInfo.obj \ Modified: trunk/labs/jbosswebnp/src/windows/native/JPI/mscorlib/Makefile =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JPI/mscorlib/Makefile 2006-01-18 12:49:34 UTC (rev 2133) +++ trunk/labs/jbosswebnp/src/windows/native/JPI/mscorlib/Makefile 2006-01-18 13:10:22 UTC (rev 2134) @@ -18,8 +18,9 @@ EXTRA_LIBS = mscoree.lib EXTRA_LFLAGS = /BASE:@../../build/baseaddr.ref,$(PPREFIX).$(PROJECT) JNI_CORE_LIB = JNI.core.lib +JNI_RT_LIB = JNI.rt.lib +JNI_MSCORLIB_LIB = JNI.mscorlib.lib JPI_CORE_LIB = JPI.core.lib -JNI_MSCORLIB_LIB = JNI.mscorlib.lib !IF !DEFINED(SRCDIR) || "$(SRCDIR)" == "" SRCDIR = . @@ -33,6 +34,9 @@ !IFNDEF WITH_JNI_CORE WITH_JNI_CORE = ../../JNI/core !ENDIF +!IFNDEF WITH_JNI_RT +WITH_JNI_RT = ../../JNI/rt +!ENDIF !IFNDEF WITH_JPI_CORE WITH_JPI_CORE = ../core !ENDIF @@ -40,10 +44,10 @@ WITH_JNI_MSCORLIB = ../../JNI/mscorlib !ENDIF -INCLUDES = $(INCLUDES) /I "$(WITH_JNI_CORE)/include" /I "$(WITH_JNI_MSCORLIB)" /I "$(WITH_JPI_CORE)" -LDIRS = /libpath:"$(WITH_JNI_CORE)/$(BUILDIR)" /libpath:"$(WITH_JNI_MSCORLIB)/$(BUILDIR)" /libpath:"$(WITH_JPI_CORE)/$(BUILDIR)" +INCLUDES = $(INCLUDES) /I "$(WITH_JNI_CORE)/include" /I "$(WITH_JNI_RT)" /I "$(WITH_JNI_MSCORLIB)" /I "$(WITH_JPI_CORE)" +LDIRS = /libpath:"$(WITH_JNI_CORE)/$(BUILDIR)" /libpath:"$(WITH_JNI_RT)/$(BUILDIR)" /libpath:"$(WITH_JNI_MSCORLIB)/$(BUILDIR)" /libpath:"$(WITH_JPI_CORE)/$(BUILDIR)" -LFLAGS = $(LFLAGS) $(JNI_CORE_LIB) $(JNI_MSCORLIB_LIB) $(JPI_CORE_LIB) +LFLAGS = $(LFLAGS) $(JNI_CORE_LIB) $(JNI_RT_LIB) $(JNI_MSCORLIB_LIB) $(JPI_CORE_LIB) OBJECTS = \ $(BUILDIR)\AssemblyInfo.obj \ |
From: <jbo...@li...> - 2006-01-18 12:49:39
|
Author: mla...@jb... Date: 2006-01-18 07:49:34 -0500 (Wed, 18 Jan 2006) New Revision: 2133 Added: trunk/labs/jbosswebnp/src/windows/generators/bin/LICENSE Log: Added: trunk/labs/jbosswebnp/src/windows/generators/bin/LICENSE =================================================================== --- trunk/labs/jbosswebnp/src/windows/generators/bin/LICENSE 2006-01-18 12:48:28 UTC (rev 2132) +++ trunk/labs/jbosswebnp/src/windows/generators/bin/LICENSE 2006-01-18 12:49:34 UTC (rev 2133) @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library 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 library 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 library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + |
Author: mla...@jb... Date: 2006-01-18 07:48:28 -0500 (Wed, 18 Jan 2006) New Revision: 2132 Added: trunk/labs/jbosswebnp/src/windows/generators/generators.sln trunk/labs/jbosswebnp/src/windows/generators/j2m/ trunk/labs/jbosswebnp/src/windows/generators/j2m/Properties/ trunk/labs/jbosswebnp/src/windows/generators/j2m/Properties/AssemblyInfo.cs trunk/labs/jbosswebnp/src/windows/generators/j2m/jboss.ico trunk/labs/jbosswebnp/src/windows/generators/j2n/ trunk/labs/jbosswebnp/src/windows/generators/j2n/Properties/ trunk/labs/jbosswebnp/src/windows/generators/j2n/Properties/AssemblyInfo.cs trunk/labs/jbosswebnp/src/windows/generators/j2n/jboss.ico trunk/labs/jbosswebnp/src/windows/generators/m2m/ trunk/labs/jbosswebnp/src/windows/generators/m2m/Properties/ trunk/labs/jbosswebnp/src/windows/generators/m2m/Properties/AssemblyInfo.cs trunk/labs/jbosswebnp/src/windows/generators/m2m/jboss.ico trunk/labs/jbosswebnp/src/windows/generators/m2n/ trunk/labs/jbosswebnp/src/windows/generators/m2n/Properties/ trunk/labs/jbosswebnp/src/windows/generators/m2n/Properties/AssemblyInfo.cs trunk/labs/jbosswebnp/src/windows/generators/m2n/jboss.ico trunk/labs/jbosswebnp/src/windows/native/JMI/ trunk/labs/jbosswebnp/src/windows/native/JMI/README trunk/labs/jbosswebnp/src/windows/native/JNI/ trunk/labs/jbosswebnp/src/windows/native/JNI/README trunk/labs/jbosswebnp/src/windows/native/JNI/core/ trunk/labs/jbosswebnp/src/windows/native/JNI/core/Makefile trunk/labs/jbosswebnp/src/windows/native/JNI/core/README trunk/labs/jbosswebnp/src/windows/native/JNI/core/core.rc trunk/labs/jbosswebnp/src/windows/native/JNI/core/include/ trunk/labs/jbosswebnp/src/windows/native/JNI/core/include/jbcorapi.h trunk/labs/jbosswebnp/src/windows/native/JNI/core/private.h trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/ trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/Makefile trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/README trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/include/ trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/include/private.h trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/mscorlib.rc trunk/labs/jbosswebnp/src/windows/native/JNI/rt/ trunk/labs/jbosswebnp/src/windows/native/JNI/rt/Makefile trunk/labs/jbosswebnp/src/windows/native/JNI/rt/README trunk/labs/jbosswebnp/src/windows/native/JNI/rt/include/ trunk/labs/jbosswebnp/src/windows/native/JNI/rt/include/private.h trunk/labs/jbosswebnp/src/windows/native/JNI/rt/rt.rc trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/ trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/Makefile trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/README trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/include/ trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/include/private.h trunk/labs/jbosswebnp/src/windows/native/JNI/servlet/servlet.rc trunk/labs/jbosswebnp/src/windows/native/JPI/ trunk/labs/jbosswebnp/src/windows/native/JPI/README trunk/labs/jbosswebnp/src/windows/native/JPI/core/ trunk/labs/jbosswebnp/src/windows/native/JPI/core/Makefile trunk/labs/jbosswebnp/src/windows/native/JPI/core/core.rc trunk/labs/jbosswebnp/src/windows/native/JPI/core/include/ trunk/labs/jbosswebnp/src/windows/native/JPI/core/include/private.h trunk/labs/jbosswebnp/src/windows/native/JPI/mscorlib/ trunk/labs/jbosswebnp/src/windows/native/JPI/mscorlib/Makefile trunk/labs/jbosswebnp/src/windows/native/JPI/mscorlib/include/ trunk/labs/jbosswebnp/src/windows/native/JPI/mscorlib/include/private.h trunk/labs/jbosswebnp/src/windows/native/JPI/mscorlib/mscorlib.rc Modified: trunk/labs/jbosswebnp/src/windows/native/build/baseaddr.ref Log: Added: trunk/labs/jbosswebnp/src/windows/generators/generators.sln =================================================================== --- trunk/labs/jbosswebnp/src/windows/generators/generators.sln 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/generators/generators.sln 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "J2N", "j2n\J2N.csproj", "{64B47C30-115C-4CC7-B2C0-93D46BFFDB92}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2J", "m2j\M2J.csproj", "{EA58D39B-D2CF-4362-B1E3-60E7F16AA8DE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2N", "m2n\M2N.csproj", "{8DDC4A93-B907-45BE-BDB7-840A0819DA8A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2M", "m2m\M2M.csproj", "{3D9FB9FE-3814-4BE2-A852-08D9A4B901FD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "J2M", "j2m\J2M.csproj", "{B7CC5ECB-8382-4A6F-9951-F088B1DB96EE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {64B47C30-115C-4CC7-B2C0-93D46BFFDB92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64B47C30-115C-4CC7-B2C0-93D46BFFDB92}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64B47C30-115C-4CC7-B2C0-93D46BFFDB92}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64B47C30-115C-4CC7-B2C0-93D46BFFDB92}.Release|Any CPU.Build.0 = Release|Any CPU + {EA58D39B-D2CF-4362-B1E3-60E7F16AA8DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA58D39B-D2CF-4362-B1E3-60E7F16AA8DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA58D39B-D2CF-4362-B1E3-60E7F16AA8DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA58D39B-D2CF-4362-B1E3-60E7F16AA8DE}.Release|Any CPU.Build.0 = Release|Any CPU + {8DDC4A93-B907-45BE-BDB7-840A0819DA8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8DDC4A93-B907-45BE-BDB7-840A0819DA8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8DDC4A93-B907-45BE-BDB7-840A0819DA8A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8DDC4A93-B907-45BE-BDB7-840A0819DA8A}.Release|Any CPU.Build.0 = Release|Any CPU + {3D9FB9FE-3814-4BE2-A852-08D9A4B901FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3D9FB9FE-3814-4BE2-A852-08D9A4B901FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3D9FB9FE-3814-4BE2-A852-08D9A4B901FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3D9FB9FE-3814-4BE2-A852-08D9A4B901FD}.Release|Any CPU.Build.0 = Release|Any CPU + {B7CC5ECB-8382-4A6F-9951-F088B1DB96EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7CC5ECB-8382-4A6F-9951-F088B1DB96EE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7CC5ECB-8382-4A6F-9951-F088B1DB96EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7CC5ECB-8382-4A6F-9951-F088B1DB96EE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/labs/jbosswebnp/src/windows/generators/j2m/Properties/AssemblyInfo.cs =================================================================== --- trunk/labs/jbosswebnp/src/windows/generators/j2m/Properties/AssemblyInfo.cs 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/generators/j2m/Properties/AssemblyInfo.cs 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Java2Managed")] +[assembly: AssemblyDescription("Java To Managed Generator")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("JBoss Inc.")] +[assembly: AssemblyProduct("Java2Managed")] +[assembly: AssemblyCopyright("Copyright © JBoss Inc. 2006")] +[assembly: AssemblyTrademark("TM JBoss Inc.")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9bfa5166-0f6e-417e-82c5-ec33d6eb514a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/labs/jbosswebnp/src/windows/generators/j2m/jboss.ico =================================================================== (Binary files differ) Property changes on: trunk/labs/jbosswebnp/src/windows/generators/j2m/jboss.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbosswebnp/src/windows/generators/j2n/Properties/AssemblyInfo.cs =================================================================== --- trunk/labs/jbosswebnp/src/windows/generators/j2n/Properties/AssemblyInfo.cs 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/generators/j2n/Properties/AssemblyInfo.cs 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Java2Native")] +[assembly: AssemblyDescription("Java To Native Generator")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("JBoss Inc.")] +[assembly: AssemblyProduct("Java2Native")] +[assembly: AssemblyCopyright("Copyright © JBoss Inc. 2006")] +[assembly: AssemblyTrademark("TM JBoss Inc.")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2d87da10-227c-48c6-bc1a-1b1d5b0c4f50")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/labs/jbosswebnp/src/windows/generators/j2n/jboss.ico =================================================================== (Binary files differ) Property changes on: trunk/labs/jbosswebnp/src/windows/generators/j2n/jboss.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbosswebnp/src/windows/generators/m2m/Properties/AssemblyInfo.cs =================================================================== --- trunk/labs/jbosswebnp/src/windows/generators/m2m/Properties/AssemblyInfo.cs 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/generators/m2m/Properties/AssemblyInfo.cs 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Managed2Managed")] +[assembly: AssemblyDescription("Managed To Managed Generator")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("JBoss Inc.")] +[assembly: AssemblyProduct("Managed2Managed")] +[assembly: AssemblyCopyright("Copyright © JBoss Inc. 2006")] +[assembly: AssemblyTrademark("TM JBoss Inc.")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bc8c3f5d-9dd6-4f84-802b-a0ab11b42e2b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/labs/jbosswebnp/src/windows/generators/m2m/jboss.ico =================================================================== (Binary files differ) Property changes on: trunk/labs/jbosswebnp/src/windows/generators/m2m/jboss.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbosswebnp/src/windows/generators/m2n/Properties/AssemblyInfo.cs =================================================================== --- trunk/labs/jbosswebnp/src/windows/generators/m2n/Properties/AssemblyInfo.cs 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/generators/m2n/Properties/AssemblyInfo.cs 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("M2N")] +[assembly: AssemblyDescription("Managed To Native Code Generator")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("JBoss Inc.")] +[assembly: AssemblyProduct("M2N")] +[assembly: AssemblyCopyright("Copyright © JBoss Inc. 2006")] +[assembly: AssemblyTrademark("TM JBoss Inc.")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("077fd499-d50e-4f70-b84e-5c35bf8f2158")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/labs/jbosswebnp/src/windows/generators/m2n/jboss.ico =================================================================== (Binary files differ) Property changes on: trunk/labs/jbosswebnp/src/windows/generators/m2n/jboss.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/jbosswebnp/src/windows/native/JMI/README =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JMI/README 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JMI/README 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1 @@ +JBoss Managed Implementation (JMI) classes. Added: trunk/labs/jbosswebnp/src/windows/native/JNI/README =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/README 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/README 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1 @@ +JBoss Native Interface (JNI) classes. Added: trunk/labs/jbosswebnp/src/windows/native/JNI/core/Makefile =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/core/Makefile 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/core/Makefile 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,66 @@ +# JBoss, the OpenSource J2EE webOS +# +# Distributable under LGPL license. +# See terms of license at gnu.org. +# +# ==================================================================== +# +# NMAKEmakefile JBoss .NET Proxy Core Library makefile. +# +# ==================================================================== +# + +CFLAGS = /DJBOSS_CORE_EXPORTS $(CFLAGS) /EHsc +TARGET = DLL +PROJECT = core +PPREFIX = JNI +EXTRA_LIBS = mscoree.lib +EXTRA_LFLAGS = /BASE:0x50000000,0x00020000 +!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == "" +SRCDIR = . +!ENDIF + +!include <../../build/NMAKEcommon.inc> + +INCLUDES = /I $(SRCDIR)/include +PDBFLAGS = /Fd$(BUILDIR)\$(PPREFIX).$(PROJECT)-src + +OBJECTS = \ + $(BUILDIR)\Debug.obj \ + $(BUILDIR)\Init.obj \ + $(BUILDIR)\Utils.obj \ + $(BUILDIR)\jni.Object.obj \ + $(BUILDIR)\proxy.Object.obj \ + $(BUILDIR)\jni.Vm.obj + +DEPENDS = \ + $(SRCDIR)\include\*.h \ + $(SRCDIR)\*.h + + +BUILDLIB = $(BUILDIR)\$(PPREFIX).$(PROJECT).dll +BUILDPDB = $(BUILDIR)\$(PPREFIX).$(PROJECT).pdb +BUILDRES = $(BUILDIR)\$(PPREFIX).$(PROJECT).res +BUILDMAN = $(BUILDLIB).manifest + +all : $(BUILDIR) $(BUILDLIB) + +$(BUILDIR): + $(MAKETARGET) + +{$(SRCDIR)}.cpp{$(BUILDIR)}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +$(OBJECTS): $(DEPENDS) + +$(BUILDRES): $(PROJECT).rc + $(RC) $(RCFLAGS) /i "$(SRCDIR)/include" /fo $(BUILDRES) $(PROJECT).rc + +$(BUILDLIB): $(BUILDIR) $(OBJECTS) $(BUILDRES) + $(LINK) $(LFLAGS) /pdb:$(BUILDPDB) /out:$(BUILDLIB) @<< + $(OBJECTS) $(BUILDRES) $(LIBS) +<< + $(MT) -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDLIB);2 + +clean: + @$(CLEANTARGET) Added: trunk/labs/jbosswebnp/src/windows/native/JNI/core/README =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/core/README 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/core/README 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1 @@ +Java Core Proxy classes. Added: trunk/labs/jbosswebnp/src/windows/native/JNI/core/core.rc =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/core/core.rc 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/core/core.rc 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,46 @@ +/* + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + +#include <windows.h> +#include "../../build/resource.h" + +1000 ICON "../../build/jboss.ico" + +1 VERSIONINFO + FILEVERSION CSV_VERISON + PRODUCTVERSION CSV_VERISON + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS DLL_FILEFLAGS + FILEOS VOS_NT + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", STR_LICENSE "\0" + VALUE "CompanyName", STR_COMPANY "\0" + VALUE "FileDescription", "JBoss .NET Proxy Core Library\0" + VALUE "FileVersion", STR_VERISON "\0" + VALUE "InternalName", "JNI.core" + VALUE "LegalCopyright", STR_COPYRIGHT "\0" + VALUE "LegalTrademarks", STR_TRADEMARK "\0" + VALUE "OriginalFilename", "JNI.core.dll" + VALUE "ProductName", STR_PRODUCT "\0" + VALUE "ProductVersion", STR_VERISON "\0" +#if PRIVATE_BUILD + VALUE "PrivateBuild", STR_PRIVATE "\0" + VALUE "SpecialBuild", STR_SPECIAL "\0" +#endif + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END Added: trunk/labs/jbosswebnp/src/windows/native/JNI/core/include/jbcorapi.h =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/core/include/jbcorapi.h 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/core/include/jbcorapi.h 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,181 @@ +/* + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + +#ifndef JBCORAPI_H +#define JBCORAPI_H + +#ifdef __cplusplus_cli +#pragma unmanaged +#endif + +#ifdef __cplusplus +#define JBEXTERN_C extern "C" +#else +#define JBEXTERN_C extern +#endif + + +#ifdef JBOSS_CORE_EXPORTS +#define JBCORE_CLASS __declspec(dllexport) +#define JBCORE_API JBEXTERN_C __declspec(dllexport) +#else +#define JBCORE_CLASS __declspec(dllimport) +#define JBCORE_API JBEXTERN_C __declspec(dllimport) +#endif + +#ifdef JBOSS_MODULE_EXPORTS +#define JBCORM_DATA(type) JBEXTERN_C type __declspec(dllexport) +#else +#define JBCORM_DATA(type) JBEXTERN_C type __declspec(dllexport) +#endif + +#define JBCORCALL __stdcall + + +#if defined(WIN32) + +#ifndef _WINDOWS_ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINNT +/* Restrict the server to a subset of Windows 2000 header files by default + */ +#define _WIN32_WINNT 0x0500 +#endif +#endif +#include <windows.h> +#include <strsafe.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <limits.h> +#else +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#endif + +#include <jni.h> + +// Add missing JNI stuff +struct _jfieldID {}; +typedef struct _jfieldID *jfieldID; + +struct _jmethodID {}; +typedef struct _jmethodID *jmethodID; + +// Undefine min and max C macros. +#undef min +#undef max + +typedef struct JAVA_P_ID { + jclass c; + jmethodID i; + const char *n; + const char *s; +} JAVA_P_ID; + +typedef struct JJ_MODULE { + const char *name; + void (*I)(JNIEnv *); + void (*D)(JNIEnv *); +} JJ_MODULE; + +#define JNICALLARGS JNIEnv *JENV, jobject JOBJ +#define JJ_MODULE_SYM "jniRuntimeModule" + +JBCORE_API void JBCORCALL LinkToCore(const char *, const wchar_t *); +JBCORE_API int JBCORCALL AddClassToGlobalRefCache(jclass); +JBCORE_API int JBCORCALL ProxyMutexLock(void); +JBCORE_API int JBCORCALL ProxyMutexUnlock(void); +JBCORE_API void JBCORCALL ProxyThreadLock(void); +JBCORE_API void JBCORCALL ProxyThreadUnlock(void); +JBCORE_API void JBCORCALL DebugPrintf(const char *, int, const char *, + const char *, ...); + +#ifdef _DEBUG +#define DBTRACEN NULL,NULL,NULL +#define DBTRACEF __FILE__,__LINE__,__FUNCTION__ +#define DBPRINTF0(v1) DebugPrintf(DBTRACEN, v1) +#define DBPRINTF1(v1, v2) DebugPrintf(DBTRACEN, v1, v2) +#define DBPRINTF2(v1, v2, v3) DebugPrintf(DBTRACEN, v1, v2, v3) +#define DBPRINTF3(v1, v2, v3, v4) DebugPrintf(DBTRACEN, v1, v2, v3, v4) + +#define DBTRACE0(v1) DebugPrintf(DBTRACEF, v1) +#define DBTRACE1(v1, v2) DebugPrintf(DBTRACEF, v1, v2) +#define DBTRACE2(v1, v2, v3) DebugPrintf(DBTRACEF, v1, v2, v3) +#define DBTRACE3(v1, v2, v3, v4) DebugPrintf(DBTRACEF, v1, v2, v3, v4) +#else +#define DBPRINTF0(v1) (void(0)) +#define DBPRINTF1(v1, v2) (void(0)) +#define DBPRINTF2(v1, v2, v3) (void(0)) +#define DBPRINTF3(v1, v2, v3, v4) (void(0)) +#define DBTRACE0(v1) (void(0)) +#define DBTRACE1(v1, v2) (void(0)) +#define DBTRACE2(v1, v2, v3) (void(0)) +#define DBTRACE3(v1, v2, v3, v4) (void(0)) +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef void *(__stdcall *CLRObjectFinalizeCallback)(JNIEnv *, jlong, jshort); + +#ifdef __cplusplus +} +#endif + +/* + * Object flags + */ +#define JBO_UNKNOWN 0 +#define JBO_DEFAULT 0x0001 +#define JBO_REFGLOB 0x0010 +#define JBO_REFWEAK 0x0020 +#define JBO_DELETED 0xdead +/* 64 bit (jlong) invalid Object HANDLE */ +#define JBH_INVALID (-1i64) +#define JBH_UNKNOWN 0i64 + +#define IS_JBO_INVALID(F) ((F) == JBO_UNKNOWN || (F) == JBO_DELETED) +#define IS_JBO_VALID(F) ((F) != JBO_UNKNOWN && (F) != JBO_DELETED) +#define IS_JBH_INVALID(H) ((H) == JBH_UNKNOWN || (H) == JBH_INVALID) +#define IS_JBH_VALID(H) ((H) != JBH_UNKNOWN && (H) != JBH_INVALID) + +/* + * Helper macros + */ +#define T4W(V) LPCWSTR(cw##V) +#define T4C(V) cc##V +#define J2B(V) ((V) ? true : false) +#define B2J(V) ((V) ? JNI_TRUE : JNI_FALSE) + + +#define J_ALLOC_WSTRING(V) \ + const jchar *cw##V = V ? JENV->GetStringChars(V, 0) : NULL +#define J_ALLOC_CSTRING(V) \ + const char *cc##V = V ? JENV->GetStringUTFChars(V, 0) : NULL + +#define J_WCSLEN(V) wcslen((LPCWSTR)cw##V) +#define J_STRLEN(V) strlen(cc##V) +#define J_WCSIZE(V) ((wcslen((LPCWSTR)cw##V) + 1) * 2) +#define J_STRSIZ(V) (strlen(cc##V) + 1) + +#define NZ_T4W(V) (cw##V != NULL && *cw##V != L'\0') +#define NZ_T4C(V) (cc##V != NULL && *cc##V != '\0') +#define NN_T4W(V) cw##V != NULL +#define NN_T4C(V) cc##V != NULL + +#define J_FREE_WSTRING(V) \ + if (cw##V) JENV->ReleaseStringChars(V, cw##V) + +#define J_FREE_CSTRING(V) \ + if (cc##V) JENV->ReleaseStringUTFChars(V, cc##V) + +#endif // JBCORAPI_H Added: trunk/labs/jbosswebnp/src/windows/native/JNI/core/private.h =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/core/private.h 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/core/private.h 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,170 @@ +/* + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + +#ifndef PRIVATE_H +#define PRIVATE_H + +typedef struct JAVA_C_ID { + jclass i; + const char *n; +} JAVA_C_ID; + +typedef struct JAVA_M_ID { + jmethodID i; + const char *n; + const char *s; +} JAVA_M_ID; + +typedef struct JAVA_F_ID { + jfieldID i; + const char *n; + const char *s; +} JAVA_F_ID; + +#define J_CHECK_JENV() \ + if (JENV == NULL) { \ + JENV = Vm::GetJNIEnv(); \ + if (JENV == NULL) { \ + DBTRACE0("Error getting JNIEnv"); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_CHECK_IENV() \ + if (_JENV == NULL) { \ + _JENV = Vm::GetJNIEnv(); \ + if (_JENV == NULL) { \ + DBTRACE0("Error getting JNIEnv"); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_LOAD_CTOR(I) \ + do { \ + _c##I##.i = JENV->GetMethodID(_clazz.i, _c##I##.n, _c##I##.s); \ + if (JENV->ExceptionCheck() || _c##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading ctor %s", _c##I##.n); \ + } \ + } while (0) + +#define J_LOAD_IMETHOD(I) \ + if (_m##I##.i == NULL) { \ + _m##I##.i = JENV->GetMethodID(_clazz.i, _m##I##.n, _m##I##.s); \ + if (JENV->ExceptionCheck() || _m##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading method %s", _m##I##.n); \ + } \ + } else (void)(0) + +#define J_LOAD_SMETHOD(I) \ + if (_m##I##.i == NULL) { \ + _m##I##.i = JENV->GetStaticMethodID(_clazz.i, _m##I##.n, _m##I##.s); \ + if (JENV->ExceptionCheck() || _m##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading static method %s", _m##I##.n); \ + } \ + } else (void)(0) + +#define J_LOAD_IFIELD(I) \ + if (_f##I##.i == NULL) { \ + _f##I##.i = JENV->GetFieldID(_clazz.i, _f##I##.n, _f##I##.s); \ + if (JENV->ExceptionCheck() || _f##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading field %s", _f##I##.n); \ + } \ + } else (void)(0) + +#define J_LOAD_SFIELD(I) \ + if (_f##I##.i == NULL) { \ + _f##I##.i = JENV->GetStaticFieldID(_clazz.i, _f##I##.n, _f##I##.s); \ + if (JENV->ExceptionCheck() || _f##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading static field %s", _f##I##.n); \ + } \ + } else (void)(0) + +#define J_CHECK_IMETHOD(I) \ + if (_m##I##.i == NULL) { \ + _m##I##.i = _JENV->GetMethodID(_clazz.i, _m##I##.n, _m##I##.s); \ + if (_JENV->ExceptionCheck() || _m##I##.i == NULL) { \ + _JENV->ExceptionClear(); \ + DBTRACE1("Error loading method %s", _m##I##.n); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_CHECK_SMETHOD(I) \ + if (_m##I##.i == NULL) { \ + _m##I##.i = JENV->GetStaticMethodID(_clazz.i, _m##I##.n, _m##I##.s); \ + if (JENV->ExceptionCheck() || _m##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading static method %s", _m##I##.n); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_CHECK_IFIELD(I) \ + if (_f##I##.i == NULL) { \ + _f##I##.i = _JENV->GetFieldID(_clazz.i, _f##I##.n, _f##I##.s); \ + if (_JENV->ExceptionCheck() || _f##I##.i == NULL) { \ + _JENV->ExceptionClear(); \ + DBTRACE1("Error loading field %s", _f##I##.n); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_CHECK_SFIELD(I) \ + if (_f##I##.i == NULL) { \ + _f##I##.i = _JENV->GetStaticFieldID(_clazz.i, _f##I##.n, _f##I##.s); \ + if (_JENV->ExceptionCheck() || _f##I##.i == NULL) { \ + _JENV->ExceptionClear(); \ + DBTRACE1("Error loading static field %s", _f##I##.n); \ + goto failed; \ + } \ + } else (void)(0) + +#if 0 +#define J_LOAD_CLASS() \ + if (JENV->EnsureLocalCapacity(3) < 0) { \ + if (_clazz.c == NULL) { \ + dll_lock(); \ + if (_clazz.c == NULL) { \ + jobject c = reinterpret_cast<jobject>(JENV->FindClass(_clazz.n)); \ + if (JENV->ExceptionCheck() || c == NULL) { \ + DBTRACE1("Error loading class %s", _clazz.n); \ + goto failed; \ + } \ + _clazz.c = reinterpret_cast<jclass>(JENV->NewGlobalRef(c)); \ + if (JENV->ExceptionCheck()) { \ + DBTRACE1("Error referencing class %s", _clazz.n); \ + goto failed; \ + } \ + JENV->DeleteLocalRef(c); \ + _clazz.i = JENV->GetMethodID(_clazz.c, "<init>", "(JJ)V"); \ + if (JENV->ExceptionCheck()) { \ + DBTRACE1("Error loading ctor for %s", _clazz.n); \ + JENV->DeleteGlobalRef(_clazz.c); \ + _clazz.c = NULL; \ + goto failed; \ + } \ + ::AddClassToCache(_clazz.n, _clazz.c); \ + } \ + failed: \ + dll_unlock(); \ + } \ + } else (void)(0) + +#endif + +#define JPROXY_NAME L"JNI.core.dll" +#define JPROXY_MUTEX L"JBOSSCOREMUTEX" + +/* Private Thread locking/unlocking helper functions */ +void DestroyGlobalRefCache(JNIEnv *); + +#endif // PRIVATE_H Added: trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/Makefile =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/Makefile 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/Makefile 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,268 @@ +# JBoss, the OpenSource J2EE webOS +# +# Distributable under LGPL license. +# See terms of license at gnu.org. +# +# ==================================================================== +# +# NMAKEmakefile JBoss .NET Core Proxy Library makefile. +# +# ==================================================================== +# + +CFLAGS = /DMSCORLIB_EXPORTS /DJBOSS_MODULE_EXPORTS $(CFLAGS) +TARGET = DLL +PROJECT = mscorlib +PPREFIX = JNI +EXTRA_LFLAGS = /BASE:@../../build/baseaddr.ref,$(PPREFIX).$(PROJECT) +JNI_CORE_LIB = JNI.core.lib + +!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == "" +SRCDIR = . +!ENDIF + +!include <../../build/NMAKEcommon.inc> + +INCLUDES = /I $(SRCDIR) /I $(SRCDIR)/include /I $(SRCDIR)/proxy +PDBFLAGS = /Fd$(BUILDIR)\$(PPREFIX).$(PROJECT)-src + +!IFNDEF WITH_JNI_CORE +WITH_JNI_CORE = ../core +!ENDIF + +INCLUDES = $(INCLUDES) /I "$(WITH_JNI_CORE)/include" +LDIRS = /libpath:"$(WITH_JNI_CORE)/$(BUILDIR)" + +LFLAGS = $(LFLAGS) $(JNI_CORE_LIB) + +!include <mscorlib.inc> + +OBJECTS = \ + $(BUILDIR)\Init.obj \ + $(BUILDIR)\Utils.obj \ + $(MSCORLIB_OBJECTS) + +DEPENDS = \ + $(SRCDIR)\include\*.h \ + $(SRCDIR)\*.h + + +BUILDLIB = $(BUILDIR)\$(PPREFIX).$(PROJECT).dll +BUILDPDB = $(BUILDIR)\$(PPREFIX).$(PROJECT).pdb +BUILDRES = $(BUILDIR)\$(PPREFIX).$(PROJECT).res +BUILDMAN = $(BUILDLIB).manifest + +all : $(BUILDIR) $(BUILDLIB) $(BUILDMAN) + +$(BUILDIR) : + @$(MAKETARGET) + @$(MKDIR) $(BUILDIR)\proxy + @$(MKDIR) $(BUILDIR)\proxy\System + @$(MKDIR) $(BUILDIR)\proxy\System\Collections + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Serialization + @$(MKDIR) $(BUILDIR)\proxy\System\Text + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\InteropServices + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Hosting + @$(MKDIR) $(BUILDIR)\proxy\System\Security + @$(MKDIR) $(BUILDIR)\proxy\System\Deployment + @$(MKDIR) $(BUILDIR)\proxy\System\Deployment\Internal + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\ConstrainedExecution + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\CompilerServices + @$(MKDIR) $(BUILDIR)\proxy\System\Reflection + @$(MKDIR) $(BUILDIR)\proxy\System\Threading + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting + @$(MKDIR) $(BUILDIR)\proxy\System\Collections\Generic + @$(MKDIR) $(BUILDIR)\proxy\System\Diagnostics + @$(MKDIR) $(BUILDIR)\proxy\System\Diagnostics\CodeAnalysis + @$(MKDIR) $(BUILDIR)\proxy\System\Diagnostics\SymbolStore + @$(MKDIR) $(BUILDIR)\proxy\System\Globalization + @$(MKDIR) $(BUILDIR)\proxy\System\Resources + @$(MKDIR) $(BUILDIR)\proxy\Microsoft + @$(MKDIR) $(BUILDIR)\proxy\Microsoft\Win32 + @$(MKDIR) $(BUILDIR)\proxy\Microsoft\Win32\SafeHandles + @$(MKDIR) $(BUILDIR)\proxy\System\Security\Policy + @$(MKDIR) $(BUILDIR)\proxy\System\Security\Principal + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\InteropServices\ComTypes + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\InteropServices\Expando + @$(MKDIR) $(BUILDIR)\proxy\System\IO + @$(MKDIR) $(BUILDIR)\proxy\System\Security\Permissions + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting\Contexts + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting\Activation + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting\Messaging + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting\Channels + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting\Lifetime + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting\Services + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Serialization\Formatters + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting\Proxies + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting\Metadata + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Remoting\Metadata\W3cXsd2001 + @$(MKDIR) $(BUILDIR)\proxy\System\IO\IsolatedStorage + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Serialization\Formatters\Binary + @$(MKDIR) $(BUILDIR)\proxy\System\Reflection\Emit + @$(MKDIR) $(BUILDIR)\proxy\System\Security\Cryptography + @$(MKDIR) $(BUILDIR)\proxy\System\Security\Cryptography\X509Certificates + @$(MKDIR) $(BUILDIR)\proxy\System\Security\AccessControl + @$(MKDIR) $(BUILDIR)\proxy\System\Runtime\Versioning + +{$(SRCDIR)}.cpp{$(BUILDIR)}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy}.cpp{$(BUILDIR)\proxy}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System}.cpp{$(BUILDIR)\proxy\System}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Collections}.cpp{$(BUILDIR)\proxy\System\Collections}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime}.cpp{$(BUILDIR)\proxy\System\Runtime}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Serialization}.cpp{$(BUILDIR)\proxy\System\Runtime\Serialization}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Text}.cpp{$(BUILDIR)\proxy\System\Text}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\InteropServices}.cpp{$(BUILDIR)\proxy\System\Runtime\InteropServices}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Hosting}.cpp{$(BUILDIR)\proxy\System\Runtime\Hosting}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Security}.cpp{$(BUILDIR)\proxy\System\Security}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Deployment}.cpp{$(BUILDIR)\proxy\System\Deployment}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Deployment\Internal}.cpp{$(BUILDIR)\proxy\System\Deployment\Internal}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\ConstrainedExecution}.cpp{$(BUILDIR)\proxy\System\Runtime\ConstrainedExecution}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\CompilerServices}.cpp{$(BUILDIR)\proxy\System\Runtime\CompilerServices}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Reflection}.cpp{$(BUILDIR)\proxy\System\Reflection}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Threading}.cpp{$(BUILDIR)\proxy\System\Threading}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Collections\Generic}.cpp{$(BUILDIR)\proxy\System\Collections\Generic}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Diagnostics}.cpp{$(BUILDIR)\proxy\System\Diagnostics}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Diagnostics\CodeAnalysis}.cpp{$(BUILDIR)\proxy\System\Diagnostics\CodeAnalysis}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Diagnostics\SymbolStore}.cpp{$(BUILDIR)\proxy\System\Diagnostics\SymbolStore}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Globalization}.cpp{$(BUILDIR)\proxy\System\Globalization}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Resources}.cpp{$(BUILDIR)\proxy\System\Resources}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\Microsoft}.cpp{$(BUILDIR)\proxy\Microsoft}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\Microsoft\Win32}.cpp{$(BUILDIR)\proxy\Microsoft\Win32}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\Microsoft\Win32\SafeHandles}.cpp{$(BUILDIR)\proxy\Microsoft\Win32\SafeHandles}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Security\Policy}.cpp{$(BUILDIR)\proxy\System\Security\Policy}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Security\Principal}.cpp{$(BUILDIR)\proxy\System\Security\Principal}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\InteropServices\ComTypes}.cpp{$(BUILDIR)\proxy\System\Runtime\InteropServices\ComTypes}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\InteropServices\Expando}.cpp{$(BUILDIR)\proxy\System\Runtime\InteropServices\Expando}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\IO}.cpp{$(BUILDIR)\proxy\System\IO}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Security\Permissions}.cpp{$(BUILDIR)\proxy\System\Security\Permissions}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting\Contexts}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting\Contexts}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting\Activation}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting\Activation}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting\Messaging}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting\Messaging}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting\Channels}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting\Channels}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting\Lifetime}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting\Lifetime}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting\Services}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting\Services}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Serialization\Formatters}.cpp{$(BUILDIR)\proxy\System\Runtime\Serialization\Formatters}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting\Proxies}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting\Proxies}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting\Metadata}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting\Metadata}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Remoting\Metadata\W3cXsd2001}.cpp{$(BUILDIR)\proxy\System\Runtime\Remoting\Metadata\W3cXsd2001}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\IO\IsolatedStorage}.cpp{$(BUILDIR)\proxy\System\IO\IsolatedStorage}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Serialization\Formatters\Binary}.cpp{$(BUILDIR)\proxy\System\Runtime\Serialization\Formatters\Binary}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Reflection\Emit}.cpp{$(BUILDIR)\proxy\System\Reflection\Emit}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Security\Cryptography}.cpp{$(BUILDIR)\proxy\System\Security\Cryptography}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Security\Cryptography\X509Certificates}.cpp{$(BUILDIR)\proxy\System\Security\Cryptography\X509Certificates}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Security\AccessControl}.cpp{$(BUILDIR)\proxy\System\Security\AccessControl}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +{$(SRCDIR)\proxy\System\Runtime\Versioning}.cpp{$(BUILDIR)\proxy\System\Runtime\Versioning}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + + +$(OBJECTS): $(DEPENDS) + +$(BUILDRES): $(PROJECT).rc + $(RC) $(RCFLAGS) /i "$(SRCDIR)/include" /fo $(BUILDRES) $(PROJECT).rc + +$(BUILDLIB): $(BUILDIR) $(OBJECTS) $(BUILDRES) + $(LINK) $(LFLAGS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDLIB) @<< + $(OBJECTS) $(BUILDRES) $(LIBS) +<< + $(MT) -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDLIB);2 + +clean: + @$(CLEANTARGET) Added: trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/README =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/README 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/README 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1 @@ +.NET Core Proxy classes. Added: trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/include/private.h =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/include/private.h 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/include/private.h 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,103 @@ +/* + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + +#ifndef PRIVATE_H +#define PRIVATE_H + +typedef struct JAVA_C_ID { + jclass i; + const char *n; +} JAVA_C_ID; + +typedef struct JAVA_M_ID { + jmethodID i; + const char *n; + const char *s; +} JAVA_M_ID; + +typedef struct JAVA_F_ID { + jfieldID i; + const char *n; + const char *s; +} JAVA_F_ID; + +#define J_LOAD_IFIELD(I) \ + if (_f##I##.i == NULL) { \ + _f##I##.i = JENV->GetFieldID(_clazz.i, _f##I##.n, _f##I##.s); \ + if (JENV->ExceptionCheck() || _f##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading field %s", _f##I##.n); \ + } \ + } else (void)(0) + +#define J_CHECK_IFIELD(I) \ + if (_f##I##.i == NULL) { \ + _f##I##.i = _JENV->GetFieldID(_clazz.i, _f##I##.n, _f##I##.s); \ + if (_JENV->ExceptionCheck() || _f##I##.i == NULL) { \ + _JENV->ExceptionClear(); \ + DBTRACE1("Error loading field %s", _f##I##.n); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_CHECK_JENV() \ + if (JENV == NULL) { \ + JENV = jni::Vm::GetJNIEnv(); \ + if (JENV == NULL) { \ + DBTRACE0("Error getting JNIEnv"); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_CHECK_IENV() \ + if (_JENV == NULL) { \ + _JENV = jni::Vm::GetJNIEnv(); \ + if (_JENV == NULL) { \ + DBTRACE0("Error getting JNIEnv"); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_LOAD_CLASS(N) \ + if (JENV->EnsureLocalCapacity(3) < 0) { \ + if (_clazz##N##.c == NULL) { \ + DllThreadLock(); \ + if (_clazz##N##.c == NULL) { \ + jobject c = reinterpret_cast<jobject>(JENV->FindClass(_clazz##N##.n)); \ + if (JENV->ExceptionCheck() || c == NULL) { \ + DBTRACE1("Error loading class %s", _clazz##N##.n); \ + goto load_failed; \ + } \ + _clazz##N##.c = reinterpret_cast<jclass>(JENV->NewGlobalRef(c)); \ + if (JENV->ExceptionCheck()) { \ + DBTRACE1("Error referencing class %s", _clazz##N##.n); \ + goto load_failed; \ + } \ + JENV->DeleteLocalRef(c); \ + _clazz##N##.i = JENV->GetMethodID(_clazz##N##.c, "<init>", _clazz##N##.s); \ + if (JENV->ExceptionCheck()) { \ + DBTRACE1("Error loading ctor for %s", _clazz##N##.n); \ + JENV->DeleteGlobalRef(_clazz##N##.c); \ + _clazz##N##.c = NULL; \ + goto load_failed; \ + } \ + AddClassToRefCache(_clazz##N##.c); \ + } \ + load_failed: \ + DllThreadUnlock(); \ + } \ + } else (void)(0) + +#define JPROXY_NAME L"JNI.mscorlib.dll" + +/* Private Thread locking/unlocking helper functions */ +void DestroyRefCache(JNIEnv *); +void AddClassToRefCache(jclass); +void DllThreadLock(void); +void DllThreadUnlock(void); + +#endif // PRIVATE_H Added: trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/mscorlib.rc =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/mscorlib.rc 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/mscorlib/mscorlib.rc 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,46 @@ +/* + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + +#include <windows.h> +#include "../../build/resource.h" + +1000 ICON "../../build/jboss.ico" + +1 VERSIONINFO + FILEVERSION CSV_VERISON + PRODUCTVERSION CSV_VERISON + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS DLL_FILEFLAGS + FILEOS VOS_NT + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", STR_LICENSE "\0" + VALUE "CompanyName", STR_COMPANY "\0" + VALUE "FileDescription", "JBoss .NET Core Proxy Library\0" + VALUE "FileVersion", STR_VERISON "\0" + VALUE "InternalName", "JNI.mscorlib" + VALUE "LegalCopyright", STR_COPYRIGHT "\0" + VALUE "LegalTrademarks", STR_TRADEMARK "\0" + VALUE "OriginalFilename", "JNI.mscorlib.dll" + VALUE "ProductName", STR_PRODUCT "\0" + VALUE "ProductVersion", STR_VERISON "\0" +#if PRIVATE_BUILD + VALUE "PrivateBuild", STR_PRIVATE "\0" + VALUE "SpecialBuild", STR_SPECIAL "\0" +#endif + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END Added: trunk/labs/jbosswebnp/src/windows/native/JNI/rt/Makefile =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/rt/Makefile 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/rt/Makefile 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,74 @@ +# JBoss, the OpenSource J2EE webOS +# +# Distributable under LGPL license. +# See terms of license at gnu.org. +# +# ==================================================================== +# +# NMAKEmakefile JBoss Java Servlet Library makefile. +# +# ==================================================================== +# + +CFLAGS = /DJAVA_RT_EXPORTS /DJBOSS_MODULE_EXPORTS $(CFLAGS) +TARGET = DLL +PROJECT = rt +PPREFIX = JNI +EXTRA_LFLAGS = /BASE:@../../build/baseaddr.ref,$(PPREFIX).$(PROJECT) +JNI_CORE_LIB = JNI.core.lib + +!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == "" +SRCDIR = . +!ENDIF + +!include <../../build/NMAKEcommon.inc> + +INCLUDES = /I $(SRCDIR)/include +PDBFLAGS = /Fd$(BUILDIR)\$(PPREFIX).$(PROJECT)-src + +!IFNDEF WITH_JNI_CORE +WITH_JNI_CORE = ../core +!ENDIF + +INCLUDES = $(INCLUDES) /I "$(WITH_JNI_CORE)/include" +LDIRS = /libpath:"$(WITH_JNI_CORE)/$(BUILDIR)" + +LFLAGS = $(LFLAGS) $(JNI_CORE_LIB) + +!include <java.rt.inc> + +OBJECTS = $(BUILDIR)\java.$(PROJECT).obj $(JAVA_RT_OBJECTS) + +DEPENDS = \ + $(SRCDIR)\include\*.h \ + $(SRCDIR)\*.h + + +BUILDLIB = $(BUILDIR)\$(PPREFIX).$(PROJECT).dll +BUILDPDB = $(BUILDIR)\$(PPREFIX).$(PROJECT).pdb +BUILDRES = $(BUILDIR)\$(PPREFIX).$(PROJECT).res +BUILDMAN = $(BUILDLIB).manifest + +all : $(BUILDIR) $(BUILDLIB) $(BUILDMAN) + + + +$(BUILDIR) : + $(MAKETARGET) + +{$(SRCDIR)}.cpp{$(BUILDIR)}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(JAVA_INCLUDES) /Fo$(@D)\ $(PDBFLAGS) $< + +$(OBJECTS): $(DEPENDS) + +$(BUILDRES): $(PROJECT).rc + $(RC) $(RCFLAGS) /i "$(SRCDIR)/include" /fo $(BUILDRES) $(PROJECT).rc + +$(BUILDLIB): $(BUILDIR) $(OBJECTS) $(BUILDRES) + $(LINK) $(LFLAGS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDLIB) @<< + $(OBJECTS) $(BUILDRES) $(LIBS) +<< + $(MT) -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDLIB);2 + +clean: + @$(CLEANTARGET) Added: trunk/labs/jbosswebnp/src/windows/native/JNI/rt/README =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/rt/README 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/rt/README 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1 @@ +Java Runtime Library Proxy classes. Added: trunk/labs/jbosswebnp/src/windows/native/JNI/rt/include/private.h =================================================================== --- trunk/labs/jbosswebnp/src/windows/native/JNI/rt/include/private.h 2006-01-18 11:33:40 UTC (rev 2131) +++ trunk/labs/jbosswebnp/src/windows/native/JNI/rt/include/private.h 2006-01-18 12:48:28 UTC (rev 2132) @@ -0,0 +1,152 @@ +/* + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + +#ifndef PRIVATE_H +#define PRIVATE_H + +typedef struct JAVA_C_ID { + jclass i; + const char *n; +} JAVA_C_ID; + +typedef struct JAVA_M_ID { + jmethodID i; + const char *n; + const char *s; +} JAVA_M_ID; + +typedef struct JAVA_F_ID { + jfieldID i; + const char *n; + const char *s; +} JAVA_F_ID; + +#define J_CHECK_JENV() \ + if (JENV == NULL) { \ + JENV = Vm::GetJNIEnv(); \ + if (JENV == NULL) { \ + DBTRACE0("Error getting JNIEnv"); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_CHECK_IENV() \ + if (_JENV == NULL) { \ + _JENV = Vm::GetJNIEnv(); \ + if (_JENV == NULL) { \ + DBTRACE0("Error getting JNIEnv"); \ + goto failed; \ + } \ + } else (void)(0) + +#define J_LOAD_CTOR(I) \ + do { \ + _c##I##.i = JENV->GetMethodID(_clazz.i, _c##I##.n, _c##I##.s); \ + if (JENV->ExceptionCheck() || _c##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading ctor %s", _c##I##.n); \ + } \ + } while (0) + +#define J_LOAD_IMETHOD(I) \ + if (_m##I##.i == NULL) { \ + _m##I##.i = JENV->GetMethodID(_clazz.i, _m##I##.n, _m##I##.s); \ + if (JENV->ExceptionCheck() || _m##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading method %s", _m##I##.n); \ + } \ + } else (void)(0) + +#define J_LOAD_SMETHOD(I) \ + if (_m##I##.i == NULL) { \ + _m##I##.i = JENV->GetStaticMethodID(_clazz.i, _m##I##.n, _m##I##.s); \ + if (JENV->ExceptionCheck() || _m##I##.i == NULL) { \ + JENV->ExceptionClear(); \ + DBTRACE1("Error loading static method %s", _m##I##.n); \ + } \ + } else (void)(0) + +#define J_LOAD_IFIELD(I) \ + if (_f##I##.i == NULL) { \ + ... [truncated message content] |
Author: mic...@jb... Date: 2006-01-18 06:33:40 -0500 (Wed, 18 Jan 2006) New Revision: 2131 Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/ISaveHistory.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/IVersionable.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Persistent.java Removed: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ISaveHistory.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/IVersionable.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Persistent.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/RepositoryImpl.java Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryException.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/HibernateUtil.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/RepoProxyHandler.java trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/StoreEventListener.java trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/AttachmentPersistTest.java trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RulePersistenceTest.java trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/RuleSetPersistenceTest.java trunk/labs/jbossrules/drools-repository/src/test/resources/drools-repository-db.cfg.xml Log: lots of improvements around versioning, major refactoring Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ApplicationDataDef.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,5 +1,8 @@ package org.drools.repository; +import org.drools.repository.db.IVersionable; +import org.drools.repository.db.Persistent; + /** * Application data contains a definition of objects that may be provided to the * rule engine to support the execution of rules. Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/FunctionDef.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,5 +1,8 @@ package org.drools.repository; +import org.drools.repository.db.IVersionable; +import org.drools.repository.db.Persistent; + /** * A FunctionDef contains the definition of a function that is used in one or more rules. * Functions can be written in any language that is supported by the semantic framework. Deleted: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ISaveHistory.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ISaveHistory.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ISaveHistory.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,29 +0,0 @@ -package org.drools.repository; - -/** - * Assets that implement this will have their history saved. - * Is partly a marker interface for persistence. - */ -public interface ISaveHistory extends IVersionable { - - /** - * This indicates the ID the the original asset was saved with. Allows - * a history list to be queried. - */ - Long getHistoricalId(); - void setHistoricalId(Long id); - - /** - * @return True is the object is actually a save history record. - */ - boolean isHistoricalRecord(); - void setHistoricalRecord(boolean b); - - /** - * - * @param oldObject Previous version of the object of this type. - * @return - */ - boolean isStateChanged(ISaveHistory oldObject); - -} Deleted: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/IVersionable.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/IVersionable.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/IVersionable.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,39 +0,0 @@ -package org.drools.repository; - -/** - * All assets that support versioning must implement this. - * Versioning in this sense is "major" versioning, at the ruleset level. - * - * This is different to Save History versioning, which is implicit on save. - * - */ -public interface IVersionable { - - /** - * This is used to indicate that the asset is un-attached to - * any ruleset. Basically deleted. - * TODO: enhance this to delete if no longer needed. - */ - public static final long NO_VERSION = -1; - - /** of course they have to have an id ! - * Ids are always assigned by the database. - */ - Long getId(); - - /** Must create a fresh copy OF THE SAME TYPE, with a null Id */ - IVersionable copy(); - - /** - * The version number is used to group assets together in a RuleSet for instance - * The version number should ONLY be set by the repository, NOT by users. - */ - void setVersionNumber(long versionNumber); - - /** The version comment is used when major versions are created */ - void setVersionComment(String comment); - - String getVersionComment(); - - long getVersionNumber(); -} Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/ImportDef.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,5 +1,8 @@ package org.drools.repository; +import org.drools.repository.db.IVersionable; +import org.drools.repository.db.Persistent; + /** * This holds a type import for a ruleset. * TODO: This probably does not need to be versioned this granular. Deleted: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Persistent.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Persistent.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Persistent.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,18 +0,0 @@ -package org.drools.repository; - -import java.io.Serializable; - -public class Persistent implements Serializable { - - private Long id; - - public Long getId(){ - return id; - } - - private void setId(Long id){ - this.id = id; - } - - -} Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryException.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryException.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryException.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,11 +1,22 @@ package org.drools.repository; /** + * This may be thrown by the repository if certain rules of access are broken. + * Generally this will roll back any transactions in progress. * + * Mostly it will contain a validation message which may be displayed. + * + * The repository instance should remain valid, however. + * + * If any other exceptions are thrown, however, the repository manager instance will be + * invalid. + * * @author <a href="mailto:mic...@gm..."> Michael Neale</a> */ public class RepositoryException extends RuntimeException { + private static final long serialVersionUID = 6720400703993720887L; + public RepositoryException(String message) { super(message); } Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryFactory.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -4,6 +4,7 @@ import org.drools.repository.db.RepoProxyHandler; + /** * This factory class provides instances of the repository in various flavours. * Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManager.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -9,6 +9,10 @@ * This interface defines all the operations that cane be performed on the repository. * A client using this must be able to have a connection to the repository. * + * If RepositoryException is thrown, this usually means a validation error, a repository + * rule violation etc. For other exceptions, the repository manager instance may become invalid. + * If it is a stateful Repository, then it will need to be created from the factory fresh. + * * @author <a href="mailto:mic...@gm..."> Michael Neale</a> */ public interface RepositoryManager { @@ -19,8 +23,11 @@ */ public abstract void save(RuleDef newRule); + /** + * Load a rule based on a workingVersionNumber. + */ public abstract RuleDef loadRule(String ruleName, - long versionNumber); + long workingVersionNumber); /** * This will return a list of rules of "major versions" - these are rules that have been @@ -28,6 +35,13 @@ */ public abstract List listRuleVersions(String ruleName); + /** + * Find and return all the historical versions of a rule. + * Historcal versions are previous versions of the rules stored when + * a change to the rule was saved. + * + * This is distinct from Versions which are related to RuleSet versioning. += */ public abstract List listRuleSaveHistory(RuleDef rule); public abstract List findRulesByTag(String tag); @@ -47,7 +61,10 @@ public abstract RuleSetDef loadRuleSet(String ruleSetName, long workingVersionNumber); - public abstract RuleSetAttachment loadAttachment(String name); + /** + * Load an attachment with the appropriate version number. + */ + public abstract RuleSetAttachment loadAttachment(String name, long workingVersionNumber); public abstract void save(RuleSetAttachment attachment); @@ -64,7 +81,26 @@ String tag); - /** This is only required for stateful Repository session. It will be ignored for stateless ones */ + /** + * This will check out a rule for the given user id. + * This can be used to enforce "locking" of rule edits. + * + * This will save the rule as it stands, including any changes. + */ + public abstract void checkOutRule(RuleDef rule, String userId); + + /** + * This removes the check out flag. + * + * The userId must be supplied to confirm that the correct user + * is checking it in, an exception will be thrown if this is not correct. + * + * This can effectively be "overridden" by either just saving the rule, or passing + * in the correct username. It is up to client applications to enforce this behaviour. + */ + public abstract void checkInRule(RuleDef rule, String userId); + + /** This is only required for stateful Repository session. It will be ignored for stateless ones. */ public abstract void close(); } \ No newline at end of file Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -0,0 +1,221 @@ +package org.drools.repository; + +import java.util.List; + + +import org.hibernate.Session; + +/** + * The repository manager takes care of storing and sychronising the repository + * data with the repository database, using hibernate. + * + * This should not be access directly, but via a proxy to configure the session correctly. + * + * Use RepositoryFactory to get an instance of a repository manager. + * + * @author <a href ="mailto:suj...@co..."> Sujit Pal</a> + * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + */ +public class RepositoryManagerImpl + implements + RepositoryManager { + + private Session session; + + /** + * Session is injected by the proxy. + */ + public void injectSession(Session session) { + this.session = session; + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#save(org.drools.repository.RuleDef) + */ + public void save(RuleDef newRule) { + session.saveOrUpdate( newRule ); + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#loadRule(java.lang.String, long) + */ + public RuleDef loadRule(String ruleName, + long versionNumber) { + RuleDef result = (RuleDef) session.createQuery( "from RuleDef where name = :name and versionNumber = :version" ) + .setString( "name", ruleName ) + .setLong( "version", versionNumber ) + .uniqueResult(); + + return result; + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#listRuleVersions(java.lang.String) + */ + public List listRuleVersions(String ruleName) { + List result = (List) session.createQuery( "from RuleDef where name = :name order by versionNumber" ) + .setString( "name", ruleName ).list(); + return result; + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#listRuleSaveHistory(org.drools.repository.RuleDef) + */ + public List listRuleSaveHistory(RuleDef rule) { + disableHistoryFilter( session ); + + List result = (List) session.createQuery( "from RuleDef where historicalId = :id" ).setLong( "id", + rule.getId().longValue() ).list(); + + enableHistoryFilter( session ); + return result; + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#findRulesByTag(java.lang.String) + */ + public List findRulesByTag(String tag) { + List result = session.createQuery( "select rule from RuleDef as rule " + + "join rule.tags as tags " + + "where tags.tag = :tag" ).setString( "tag", tag ).list(); + return result; + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#save(org.drools.repository.RuleSetDef) + */ + public void save(RuleSetDef ruleSet) { + session.saveOrUpdate( ruleSet ); + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#loadRuleSet(java.lang.String, long) + */ + public RuleSetDef loadRuleSet(String ruleSetName, + long workingVersionNumber) { + session.clear(); //to make sure latest is loaded up, not stale + RuleSetDef def = loadRuleSetFiltered( ruleSetName, + workingVersionNumber ); + return def; + } + + /** + * This is put here for internal re-use. Internally the public methods should + * not be called. + */ + private RuleSetDef loadRuleSetFiltered(String ruleSetName, + long workingVersionNumber) { + enableWorkingVersionFilter( workingVersionNumber, + session ); + RuleSetDef def = loadRuleSetByName( ruleSetName, + session ); + def.setWorkingVersionNumber( workingVersionNumber ); + + disableWorkingVersionFilter( session ); + return def; + } + + private RuleSetDef loadRuleSetByName(String ruleSetName, + Session session) { + RuleSetDef def = (RuleSetDef) session.createQuery( "from RuleSetDef where name = :name" ).setString( "name", + ruleSetName ).uniqueResult(); + if (def == null) { + throw new RepositoryException("Unable to find RuleSet with name: [" + ruleSetName + "]"); + } + return def; + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#loadAttachment(java.lang.String) + */ + public RuleSetAttachment loadAttachment(String name, long workingVersionNumber) { + RuleSetAttachment at = (RuleSetAttachment) session.createQuery( "from RuleSetAttachment where name = :name and versionNumber = :versionNumber" ) + .setString( "name", name ) + .setLong( "versionNumber", workingVersionNumber) + .uniqueResult(); + return at; + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#save(org.drools.repository.RuleSetAttachment) + */ + public void save(RuleSetAttachment attachment) { + session.saveOrUpdate( attachment ); + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#listRuleSets() + */ + public List listRuleSets() { + List list = session.createQuery( "select distinct name from RuleSetDef where name is not null" ).list(); + return list; + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#delete(org.drools.repository.RuleDef) + */ + public void delete(RuleDef rule) { + session.delete( rule ); + } + + /* (non-Javadoc) + * @see org.drools.repository.db.RepositoryManager#searchRulesByTag(java.lang.String, java.lang.String) + */ + public List searchRulesByTag(String ruleSetName, + String tag) { + RuleSetDef def = loadRuleSetByName( ruleSetName, + session ); + List list = session.createFilter( def.getRules(), + "where this.tags.tag = :tag" ).setString( "tag", + tag ).list(); + + return list; + } + + public void checkOutRule(RuleDef rule, + String userId) { + rule.setCheckedOut(true); + rule.setCheckedOutBy(userId); + session.update(rule); + } + + public void checkInRule(RuleDef rule, String userId) { + if (!userId.equals(rule.getCheckedOutBy())) { + throw new RepositoryException("Unable to check in the rule, as it is currently checked out by " + rule.getCheckedOutBy()); + } + rule.setCheckedOut(false); + rule.setCheckedOutBy(null); + session.update(rule); + } + + public void close() { /*implemented by the proxy */} + + + ////////////////////////// + // Filters follow + ////////////////////////// + public void enableHistoryFilter(Session session) { + session.enableFilter( "historyFilter" ).setParameter( "viewHistory", + Boolean.FALSE ); + } + + void disableHistoryFilter(Session session) { + session.disableFilter( "historyFilter" ); + } + + void enableWorkingVersionFilter(long workingVersionNumber, + Session session) { + session.enableFilter( "workingVersionFilter" ).setParameter( "filteredVersionNumber", + new Long( workingVersionNumber ) ); + } + + void disableWorkingVersionFilter(Session session) { + session.disableFilter( "workingVersionFilter" ); + } + + + + + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RepositoryManagerImpl.java ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleDef.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -5,6 +5,10 @@ import java.util.Iterator; import java.util.Set; +import org.drools.repository.db.ISaveHistory; +import org.drools.repository.db.IVersionable; +import org.drools.repository.db.Persistent; + public class RuleDef extends Persistent implements ISaveHistory { @@ -25,7 +29,16 @@ private Date expiryDate; private Long historicalId; private boolean historicalRecord = false; + private int lockingVersion = 0; + + private int getLockingVersion() { + return lockingVersion; + } + private void setLockingVersion(int lockingVersion) { + this.lockingVersion = lockingVersion; + } + /** * Use tagging to aid with searching and sorting of large numbers of rules. */ @@ -44,13 +57,7 @@ } public void removeTag(String tagVal) { - for ( Iterator iter = this.tags.iterator(); iter.hasNext(); ) { - Tag tag = (Tag) iter.next(); - if (tag.getTag().equals(tagVal)) { - iter.remove(); - return; - } - } + Tag.removeTagFromCollection(tagVal, this.tags); } RuleDef() { @@ -100,7 +107,7 @@ return checkedOut; } - public void setCheckedOut(boolean checkedOut) { + void setCheckedOut(boolean checkedOut) { this.checkedOut = checkedOut; } @@ -108,7 +115,7 @@ return checkedOutBy; } - public void setCheckedOutBy(String checkOutBy) { + void setCheckedOutBy(String checkOutBy) { this.checkedOutBy = checkOutBy; } @@ -183,17 +190,8 @@ return tagList; } - /** - * Copy the tags. It is allowable to reuse the same Tag identities. - */ private Set copyTags() { - Set newTags = new HashSet(); - for ( Iterator iter = this.getTags().iterator(); iter.hasNext(); ) { - Tag tag = (Tag) iter.next(); - newTags.add( new Tag( tag.getTag() ) ); - - } - return newTags; + return Tag.copyTags(this.tags); } /** Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetAttachment.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,6 +1,12 @@ package org.drools.repository; +import java.util.HashSet; +import java.util.Set; +import org.drools.repository.db.IVersionable; +import org.drools.repository.db.Persistent; + + /** * A RuleSetAttachment may contain a ruleset that is stored in a non-normalised format. * An attachment may be a spreadsheet for instance. Or it may be a HTML document and a properties file. @@ -25,10 +31,18 @@ private String typeOfAttachment; private String name; - private long versionNumber = 1; + private long versionNumber; private String versionComment; + private Set tags; - + /** + * + * @param typeOfAttachment The type of the content, eg XLS, CSV, HTML. + * @param name The unique name of this attachment. Incorporate ruleset name if you like. + * @param content The data in byte[] form. If it is text, use UTF-8 encoding. + * @param originalFileName The original filename, if applicable. In some cases, people like + * to think of things in terms of files. Feel free to include the pathname. + */ public RuleSetAttachment(String typeOfAttachment, String name, byte[] content, @@ -38,12 +52,35 @@ this.name = name; this.content = content; this.originalFileName = originalFileName; - + this.versionNumber = 1; + this.versionComment = "new"; + this.tags = new HashSet(); } RuleSetAttachment() { } + /** + * Use tagging to aid with searching and sorting of large numbers of rules. + */ + public RuleSetAttachment addTag(String tag) { + this.tags.add( new Tag( tag ) ); + return this; + } + + public RuleSetAttachment addTag(Tag tag) { + this.tags.add( tag ); + return this; + } + + public void removeTag(Tag tag) { + this.tags.remove(tag); + } + + public void removeTag(String tagVal) { + Tag.removeTagFromCollection(tagVal, this.tags); + } + public String getName(){ return name; } @@ -90,6 +127,7 @@ this.getName(), this.getContent(), this.getOriginalFileName()); + copy.setTags(Tag.copyTags(this.tags)); return copy; } @@ -100,6 +138,14 @@ public String getVersionComment() { return this.versionComment; } + + public Set getTags() { + return tags; + } + + private void setTags(Set tags) { + this.tags = tags; + } Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetDef.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,9 +1,14 @@ package org.drools.repository; +import java.util.List; +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.Set; +import org.drools.repository.db.IVersionable; +import org.drools.repository.db.Persistent; + /** * The ruleset definition contains a grouping of rules for editing/release. The * workingVersionNumber drives what version of rules will be included in this @@ -53,7 +58,7 @@ this.applicationData = new HashSet(); this.imports = new HashSet(); this.workingVersionNumber = 1; - addNewVersionHistory("new", "created"); + addNewVersionHistory("new"); } /** @@ -277,11 +282,10 @@ * Ideally once a new version is created, the RuleSet should be stored and * then loaded fresh, which will hide the non working versions of the rules. */ - public void createNewVersion(String comment, - String newStatus) { + public void createNewVersion(String comment) { this.workingVersionNumber++; - addNewVersionHistory( newStatus, comment ); + addNewVersionHistory( comment ); createAndAddNewVersions( this.rules, comment, @@ -305,10 +309,9 @@ } - - private void addNewVersionHistory(String newStatus, String comment) { + + private void addNewVersionHistory( String comment) { RuleSetVersionInfo newVersion = new RuleSetVersionInfo(); - newVersion.setStatus( newStatus ); newVersion.setVersionNumber( this.workingVersionNumber ); newVersion.setVersionComment( comment ); this.versionHistory.add( newVersion ); Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/RuleSetVersionInfo.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -2,6 +2,8 @@ import java.util.Date; +import org.drools.repository.db.Persistent; + /** * This records information about a particular version of a ruleset. * Rulesets themselves are just a collection of rules. Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/Tag.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,6 +1,13 @@ package org.drools.repository; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import org.drools.repository.db.Persistent; + + /** * This represents a users tag for a rule, ruleset. * This aids with classification of rules in an ad-hoc fashion. @@ -32,15 +39,32 @@ return tag; } - public boolean equals(Object arg0){ - return tag.equals( arg0 ); + /** + * Wrangles the tag out of the collection. + * TODO: move all tags to maps rather then sets. Probably better. + */ + static void removeTagFromCollection(String tagValue, Collection tags) { + for ( Iterator iter = tags.iterator(); iter.hasNext(); ) { + Tag tag = (Tag) iter.next(); + if (tag.getTag().equals(tagValue)) { + iter.remove(); + return; + } + } } - - public int hashCode(){ - return tag.hashCode(); + + /** + * Copy the tags as new instances. + */ + static Set copyTags(Set originalSet) { + Set newTags = new HashSet(); + for ( Iterator iter = originalSet.iterator(); iter.hasNext(); ) { + Tag tag = (Tag) iter.next(); + newTags.add( new Tag( tag.getTag() ) ); + } + return newTags; } - } Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/HibernateUtil.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/HibernateUtil.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/HibernateUtil.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -14,12 +14,16 @@ import org.hibernate.cfg.Configuration; /** - * The usual hibernate helper, with a few tweaks. + * The usual infamous hibernate helper, with a few tweaks. + * I have made the sessionFactory non final to allow reconfiguration if necessary. + * * @author <a href="mailto:mic...@gm..."> Michael Neale</a> * */ public class HibernateUtil { + public static final String DROOLS_REPOSITORY_CONFIG = "drools-repository-db.cfg.xml"; + private static SessionFactory sessionFactory; static { @@ -44,7 +48,7 @@ registerPersistentClasses( cfg ); // cfg.setProperty("connection.username", "sa"); // cfg.setProperty("connection.password", ""); - cfg.configure("drools-repository-db.cfg.xml"); + cfg.configure(DROOLS_REPOSITORY_CONFIG); sessionFactory = cfg.buildSessionFactory(); } Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/ISaveHistory.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/ISaveHistory.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/ISaveHistory.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -0,0 +1,29 @@ +package org.drools.repository.db; + +/** + * Assets that implement this will have their history saved. + * Is partly a marker interface for persistence. + */ +public interface ISaveHistory extends IVersionable { + + /** + * This indicates the ID the the original asset was saved with. Allows + * a history list to be queried. + */ + Long getHistoricalId(); + void setHistoricalId(Long id); + + /** + * @return True is the object is actually a save history record. + */ + boolean isHistoricalRecord(); + void setHistoricalRecord(boolean b); + + /** + * + * @param oldObject Previous version of the object of this type. + * @return + */ + boolean isStateChanged(ISaveHistory oldObject); + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/ISaveHistory.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/IVersionable.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/IVersionable.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/IVersionable.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -0,0 +1,39 @@ +package org.drools.repository.db; + +/** + * All assets that support versioning must implement this. + * Versioning in this sense is "major" versioning, at the ruleset level. + * + * This is different to Save History versioning, which is implicit on save. + * + */ +public interface IVersionable { + + /** + * This is used to indicate that the asset is un-attached to + * any ruleset. Basically deleted. + * TODO: enhance this to delete if no longer needed. + */ + public static final long NO_VERSION = -1; + + /** of course they have to have an id ! + * Ids are always assigned by the database. + */ + Long getId(); + + /** Must create a fresh copy OF THE SAME TYPE, with a null Id */ + IVersionable copy(); + + /** + * The version number is used to group assets together in a RuleSet for instance + * The version number should ONLY be set by the repository, NOT by users. + */ + void setVersionNumber(long versionNumber); + + /** The version comment is used when major versions are created */ + void setVersionComment(String comment); + + String getVersionComment(); + + long getVersionNumber(); +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/IVersionable.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Persistent.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Persistent.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Persistent.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -0,0 +1,19 @@ +package org.drools.repository.db; + +import java.io.Serializable; + +/** The layer supertype for repository persistable classes. */ +public class Persistent implements Serializable { + + private Long id; + + public Long getId(){ + return id; + } + + private void setId(Long id){ + this.id = id; + } + + +} Property changes on: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/Persistent.java ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/RepoProxyHandler.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/RepoProxyHandler.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/RepoProxyHandler.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -4,17 +4,25 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import org.drools.repository.RepositoryException; +import org.drools.repository.RepositoryManagerImpl; import org.hibernate.Session; +import org.hibernate.StaleObjectStateException; import org.hibernate.Transaction; /** * Dynamic proxy handler for all persistence operations. * Keeps the hibernate session and transaction handling away from the repository implementation. * + * It will enable the history filter before invoking any methods. + * * This is the glue between the actual implementation and the interface. - * Kind of like poor mans aspects. But I couldn't justify AOP for this little thing. * - * This provides the stateful and stateless behaviour. + * It also provides the stateful and stateless behaviour. + * Stateful simple means that a session instance is created the first time, and + * kept around (long running sessions). + * + * * It can also be extended to provide user context to the implementation class * (for auditing, access control and locking for instance). * @@ -25,7 +33,7 @@ InvocationHandler { - private RepositoryImpl repoImpl = new RepositoryImpl(); + private RepositoryManagerImpl repoImpl = new RepositoryManagerImpl(); private Session session = null; private boolean stateful = false; @@ -53,6 +61,13 @@ /** * This will initialise the session to the correct state. * Allows both stateless and stateful repository options. + * + * If an exception occurs in the Repo Impl, it will rollback + * the transaction. + * If the exception is of type RepositoryException, the session will be left + * alone. + * If the exception is of any other type then the session will be closed. + * */ public Object invoke(Object proxy, Method method, @@ -62,17 +77,14 @@ Session session = getCurrentSession(); if (this.stateful && method.getName().equals("close")) { - session.close(); - StoreEventListener.setCurrentConnection(null); - return null; + return handleCloseSession( session ); } Transaction tx = null; try { tx = session.beginTransaction(); configureSession( session ); - Object result = method.invoke(repoImpl, args); - session.flush(); + Object result = method.invoke(repoImpl, args); tx.commit(); if (!stateful) { @@ -82,16 +94,37 @@ } catch (InvocationTargetException e) { rollback( tx ); + checkForRepositoryException( session, e ); throw e.getTargetException(); } - catch (Exception e) { - rollback( tx ); - throw e; + + } + + /** + * If its an instance of RepositoryException, we don't want to close the session. + * It may just be a validation message being thrown. + */ + private void checkForRepositoryException(Session session, + InvocationTargetException e) { + if (! (e.getTargetException() instanceof RepositoryException)) { + try { + repoImpl.injectSession(null); + session.close(); + } catch (Exception e2) { /*ignore*/ } } } + /** + * Should really only be called for stateful repository instances. + */ + private Object handleCloseSession(Session session) { + session.close(); + StoreEventListener.setCurrentConnection(null); + return null; + } + private void rollback(Transaction tx) { - if (tx !=null) { + if (tx != null) { tx.rollback(); } } Deleted: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/RepositoryImpl.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/RepositoryImpl.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/RepositoryImpl.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -1,184 +0,0 @@ -package org.drools.repository.db; - -import java.util.List; - - -import org.drools.repository.RepositoryManager; -import org.drools.repository.RuleDef; -import org.drools.repository.RuleSetAttachment; -import org.drools.repository.RuleSetDef; -import org.hibernate.Session; - -/** - * The repository manager takes care of storing and sychronising the repository - * data with the repository database. - * - * @author <a href ="mailto:suj...@co..."> Sujit Pal </a> - * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - */ -public class RepositoryImpl - implements - RepositoryManager { - - private Session session; - - public void injectSession(Session session) { - this.session = session; - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#save(org.drools.repository.RuleDef) - */ - public void save(RuleDef newRule) { - session.saveOrUpdate( newRule ); - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#loadRule(java.lang.String, long) - */ - public RuleDef loadRule(String ruleName, - long versionNumber) { - RuleDef result = (RuleDef) session.createQuery( "from RuleDef where name = :name and versionNumber = :version" ) - .setString( "name", ruleName ) - .setLong( "version", versionNumber ) - .uniqueResult(); - - return result; - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#listRuleVersions(java.lang.String) - */ - public List listRuleVersions(String ruleName) { - List result = (List) session.createQuery( "from RuleDef where name = :name order by versionNumber" ) - .setString( "name", ruleName ).list(); - return result; - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#listRuleSaveHistory(org.drools.repository.RuleDef) - */ - public List listRuleSaveHistory(RuleDef rule) { - disableHistoryFilter( session ); - - List result = (List) session.createQuery( "from RuleDef where historicalId = :id" ).setLong( "id", - rule.getId().longValue() ).list(); - - enableHistoryFilter( session ); - return result; - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#findRulesByTag(java.lang.String) - */ - public List findRulesByTag(String tag) { - List result = session.createQuery( "select rule from RuleDef as rule " + - "join rule.tags as tags " + - "where tags.tag = :tag" ).setString( "tag", tag ).list(); - return result; - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#save(org.drools.repository.RuleSetDef) - */ - public void save(RuleSetDef ruleSet) { - session.saveOrUpdate( ruleSet ); - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#loadRuleSet(java.lang.String, long) - */ - public RuleSetDef loadRuleSet(String ruleSetName, - long workingVersionNumber) { - session.clear(); //to make sure latest is loaded up, not stale - enableWorkingVersionFilter( workingVersionNumber, - session ); - RuleSetDef def = loadRuleSetByName( ruleSetName, - session ); - def.setWorkingVersionNumber( workingVersionNumber ); - - disableWorkingVersionFilter( session ); - return def; - } - - private RuleSetDef loadRuleSetByName(String ruleSetName, - Session session) { - RuleSetDef def = (RuleSetDef) session.createQuery( "from RuleSetDef where name = :name" ).setString( "name", - ruleSetName ).uniqueResult(); - return def; - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#loadAttachment(java.lang.String) - */ - public RuleSetAttachment loadAttachment(String name) { - RuleSetAttachment at = (RuleSetAttachment) session.createQuery( "from RuleSetAttachment where name = :name" ) - .setString( "name",name ).uniqueResult(); - return at; - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#save(org.drools.repository.RuleSetAttachment) - */ - public void save(RuleSetAttachment attachment) { - session.saveOrUpdate( attachment ); - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#listRuleSets() - */ - public List listRuleSets() { - List list = session.createQuery( "select distinct name from RuleSetDef where name is not null" ).list(); - return list; - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#delete(org.drools.repository.RuleDef) - */ - public void delete(RuleDef rule) { - session.delete( rule ); - } - - /* (non-Javadoc) - * @see org.drools.repository.db.RepositoryManager#searchRulesByTag(java.lang.String, java.lang.String) - */ - public List searchRulesByTag(String ruleSetName, - String tag) { - RuleSetDef def = loadRuleSetByName( ruleSetName, - session ); - List list = session.createFilter( def.getRules(), - "where this.tags.tag = :tag" ).setString( "tag", - tag ).list(); - - return list; - } - - - ////////////////////////// - // Filters follow - ////////////////////////// - void enableHistoryFilter(Session session) { - session.enableFilter( "historyFilter" ).setParameter( "viewHistory", - Boolean.FALSE ); - } - - void disableHistoryFilter(Session session) { - session.disableFilter( "historyFilter" ); - } - - void enableWorkingVersionFilter(long workingVersionNumber, - Session session) { - session.enableFilter( "workingVersionFilter" ).setParameter( "filteredVersionNumber", - new Long( workingVersionNumber ) ); - } - - void disableWorkingVersionFilter(Session session) { - session.disableFilter( "workingVersionFilter" ); - } - - - public void close() { /*implemented by the proxy */} - - - -} Modified: trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/StoreEventListener.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/StoreEventListener.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/java/org/drools/repository/db/StoreEventListener.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -3,7 +3,6 @@ import java.io.Serializable; import java.sql.Connection; -import org.drools.repository.ISaveHistory; import org.hibernate.EmptyInterceptor; import org.hibernate.LockMode; import org.hibernate.Session; @@ -38,9 +37,13 @@ return false; } + /** + * This will load up the old copy, and save it as a history record + * (with a different identity). + * Filters stop the history records from popping up in unwanted places . + */ private void handleSaveHistory(Object entity) { ISaveHistory versionable = (ISaveHistory) entity; - Session session = getSessionFactory().openSession( (Connection) currentConnection.get() ); ISaveHistory prev = (ISaveHistory) session.load( entity.getClass(), @@ -52,15 +55,15 @@ copy.setHistoricalRecord( true ); session.save( copy ); session.flush(); - session.close(); - System.out.println( "SAVING HISTORY COPY" ); + session.close(); } } /** * Used to set the current session so the interceptor can access it. - * @param session + * The idea is to share the same connection that any current transactions + * are using. */ public static void setCurrentConnection(Connection conn) { currentConnection.set(conn); Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleDef.hbm.xml 2006-01-18 11:33:40 UTC (rev 2131) @@ -8,12 +8,13 @@ <class name="org.drools.repository.RuleDef" table="RULE_DEFINITIONS" - entity-name="org.drools.repository.RuleDef" select-before-update="true"> + select-before-update="true" optimistic-lock="version"> <id name="id" column="RULE_ID"> <generator class="native"/> </id> - <property name="name"/> + <version name="lockingVersion" /> + <property name="name" /> <property name="versionNumber" /> <property name="content" type="text" /> <property name="status" /> Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetAttachment.hbm.xml 2006-01-18 11:33:40 UTC (rev 2131) @@ -11,14 +11,18 @@ <generator class="native"/> </id> - <property name="name" /> + <property name="name" not-null="true" /> <property name="typeOfAttachment" /> <property name="content" /> <property name="originalFileName" /> <property name="versionNumber" /> <property name="versionComment" /> - + <set name="tags" table="RULESET_ATTACHMENT_TAGS" lazy="false" cascade="all" optimistic-lock="false"> + <key column="RULESET_ATTACHMENT_ID"/> + <one-to-many class="org.drools.repository.Tag"/> + </set> + </class> </hibernate-mapping> \ No newline at end of file Modified: trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml =================================================================== --- trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/main/resources/org/drools/repository/RuleSetDef.hbm.xml 2006-01-18 11:33:40 UTC (rev 2131) @@ -61,7 +61,7 @@ <filter name="workingVersionFilter" condition=":filteredVersionNumber = versionNumber" /> </set> - <set name="functions" lazy="false" cascade="all" optimistic-lock="false"> + <set name="functions" lazy="false" table="RULESET_FUNCTIONS" cascade="all" optimistic-lock="false"> <key column="RULESET_ID"/> <one-to-many class="org.drools.repository.FunctionDef"/> <filter name="workingVersionFilter" condition=":filteredVersionNumber = versionNumber" /> Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/AttachmentPersistTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/AttachmentPersistTest.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/AttachmentPersistTest.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -7,9 +7,11 @@ public void testLoadSave() { RuleSetAttachment at = new RuleSetAttachment("test","test", "test".getBytes(), "blah.xml" ); RepositoryManager repo = getRepo(); + at.addTag("RULESETAT"); repo.save(at); - RuleSetAttachment at2 = repo.loadAttachment("test"); + RuleSetAttachment at2 = repo.loadAttachment("test", 1); assertEquals("test", at2.getTypeOfAttachment()); + assertEquals("RULESETAT", ((Tag)at2.getTags().iterator().next()).getTag()); } } Modified: trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java =================================================================== --- trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java 2006-01-18 11:05:45 UTC (rev 2130) +++ trunk/labs/jbossrules/drools-repository/src/test/java/org/drools/repository/IntegrationTest.java 2006-01-18 11:33:40 UTC (rev 2131) @@ -2,11 +2,17 @@ import java.util.Iterator; import java.util.List; +import java.util.Random; +import org.hibernate.StaleObjectStateException; + import junit.framework.TestCase; /** * This integration test aims to do a full suite of scenarios. + * + * It also may take a lot longer to run then the other "unit" tests. + * * Including concurrent editing of rules, simulating multiple rules in parallel. * * Note that I am using stateful repository instances as it makes it easier to test. @@ -17,8 +23,6 @@ */ public class IntegrationTest extends TestCase { - - /** * This will all execute as one JUnit test. * Any failure will cause the test to stop, but this is not a unit test, @@ -26,15 +30,162 @@ */ public void testBootstrap() { runVersioningTests(); -// runAttachmentTests(); -// runConcurrentTests(); + runAttachmentTests(); + + runConcurrentTests(); // runLocalPersistTests(); } /** - * These tests show how it all hangs together. + * The purpose of this test is to simulate 2 different users editing rules + * in different session. Detached and all. + */ + private void runConcurrentTests() { + //2 repos, representing different users. + RepositoryManager repoA = RepositoryFactory.getStatefulRepository(); + RepositoryManager repoB = RepositoryFactory.getStatefulRepository(); + + + //Lets try a simple rule + RuleDef ruleA = new RuleDef("Concurrent 1", "content1"); + repoA.save(ruleA); + repoA.close(); + repoA = RepositoryFactory.getStatefulRepository(); + + //Bob loads it up, decides he wants to edit it. + RuleDef ruleB = repoB.loadRule("Concurrent 1", 1); + assertEquals("content1", ruleB.getContent()); + ruleB.setContent("bobs version"); + + //Michael also is editing his version. + ruleA.setContent("michaels version"); + + //oh dear, we can't both be write can we? + //but Bob is just a bit quicker ... + repoB.save(ruleB); + try { + repoA.save(ruleA); + fail(); + } catch (StaleObjectStateException e) { + assertNotNull(e.getMessage()); + } + + repoA = RepositoryFactory.getStatefulRepository(); + + + //now try some rulesets. + RuleSetDef ruleSet = new RuleSetDef("Integration concurrent 1", null); + ruleSet.addRule(new RuleDef("Concurrent 2", "abc").addTag("yeah")); + repoA.save(ruleSet); + repoA.close(); + + //we will add a rule to each one + repoA = RepositoryFactory.getStatefulRepository(); + repoB = RepositoryFactory.getStatefulRepository(); + +... [truncated message content] |
From: <jbo...@li...> - 2006-01-18 11:06:10
|
Author: mar...@jb... Date: 2006-01-18 06:05:45 -0500 (Wed, 18 Jan 2006) New Revision: 2130 Modified: trunk/labs/jbossrules/documentation/articles/Manners/make_path.svg trunk/labs/jbossrules/documentation/articles/Manners/manners_activity_diagram.svg Log: -Fixed spelling mistakes in images Modified: trunk/labs/jbossrules/documentation/articles/Manners/make_path.svg =================================================================== --- trunk/labs/jbossrules/documentation/articles/Manners/make_path.svg 2006-01-18 05:38:22 UTC (rev 2129) +++ trunk/labs/jbossrules/documentation/articles/Manners/make_path.svg 2006-01-18 11:05:45 UTC (rev 2130) @@ -2,8 +2,8 @@ <!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 make_path.svg Page-1 --> <svg xmlns="http://www.w3.org/2000/svg" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="8.26772in" - height="11.6929in" viewBox="0 0 595.276 841.89" xml:space="preserve" color-interpolation-filters="sRGB" class="st15"> - <v:documentProperties v:langID="1033" v:viewMarkup="false"/> + height="11.6929in" viewBox="0 0 595.276 841.889" xml:space="preserve" color-interpolation-filters="sRGB" class="st14"> + <v:documentProperties v:langID="1033" v:metric="true"/> <style type="text/css"> <![CDATA[ @@ -11,17 +11,16 @@ .st2 {fill:#ff0000;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} .st3 {fill:#00ff00;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} .st4 {marker-end:url(#mrkr4-20);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 {marker-end:url(#mrkr4-26);stroke:#4677bf;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} - .st7 {fill:#ffff00;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} - .st8 {fill:#000000;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} - .st9 {fill:none;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} - .st10 {fill:#000000;font-family:Arial;font-size:0.833336em} - .st11 {fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} - .st12 {fill:#ffcc00;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} - .st13 {font-size:1em} - .st14 {fill:#000000;font-family:Arial;font-size:1.16666em} - .st15 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3} + .st5 {fill:#4677bf;fill-opacity:1;stroke:#4677bf;stroke-opacity:1;stroke-width:0.086956408572192} + .st6 {fill:#ffff00;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st7 {fill:#000000;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st8 {fill:none;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.719999} + .st9 {fill:#000000;font-family:Arial;font-size:0.833336em} + .st10 {fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st11 {fill:#ffcc00;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st12 {font-size:1em} + .st13 {fill:#000000;font-family:Arial;font-size:1.16666em} + .st14 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3} ]]> </style> @@ -29,65 +28,56 @@ <g id="lend4"> <path d="M 2 1 L 0 0 L 2 -1 L 2 1 " style="stroke:none"/> </g> - <marker id="mrkr4-20" class="st5" v:arrowType="4" v:arrowSize="2" v:setback="21.5" refX="-21.5" orient="auto" + <marker id="mrkr4-20" class="st5" v:arrowType="4" v:arrowSize="2" v:setback="0" refX="-0" orient="auto" markerUnits="strokeWidth"> - <use xlink:href="#lend4" transform="scale(-11.5,-11.5) "/> + <use xlink:href="#lend4" transform="scale(-11.500014966347,-11.500014966347) "/> </marker> - <marker id="mrkr4-26" 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"> <v:userDefs> <v:ud v:nameU="SchemeName" v:val="VT4(Default)"/> </v:userDefs> <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:pageProperties v:drawingScale="0.0393701" v:pageScale="0.0393701" v:drawingUnits="24" v:shadowOffsetX="8.50393" + v:shadowOffsetY="-8.50393"/> <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="1;0" transform="translate(68.0315,-708.661)"> + <g id="shape1-1" v:mID="1" v:groupContext="shape" v:layerMember="1;0" transform="translate(68.0317,-708.655)"> <title>On-page reference</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st1"/> + <path d="M0 827.71 A14.175 14.175 0 0 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st1"/> </g> - <g id="shape2-3" v:mID="2" v:groupContext="shape" v:layerMember="1;0" transform="translate(187.087,-708.661)"> + <g id="shape2-3" v:mID="2" v:groupContext="shape" v:layerMember="1;0" transform="translate(187.087,-708.655)"> <title>On-page reference.2</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st1"/> + <path d="M0 827.71 A14.175 14.175 0 1 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st1"/> </g> - <g id="shape3-5" v:mID="3" v:groupContext="shape" v:layerMember="1;0" transform="translate(320.315,-708.661)"> + <g id="shape3-5" v:mID="3" v:groupContext="shape" v:layerMember="1;0" transform="translate(320.315,-708.655)"> <title>On-page reference.3</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st1"/> + <path d="M0 827.71 A14.175 14.175 0 1 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st1"/> </g> - <g id="shape4-7" v:mID="4" v:groupContext="shape" v:layerMember="1;0" transform="translate(68.0315,-637.795)"> + <g id="shape4-7" v:mID="4" v:groupContext="shape" v:layerMember="1;0" transform="translate(68.0317,-637.789)"> <title>On-page reference.4</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st2"/> + <path d="M0 827.71 A14.175 14.175 0 0 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st2"/> </g> - <g id="shape5-9" v:mID="5" v:groupContext="shape" v:layerMember="1;0" transform="translate(187.087,-637.795)"> + <g id="shape5-9" v:mID="5" v:groupContext="shape" v:layerMember="1;0" transform="translate(187.087,-637.789)"> <title>On-page reference.5</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st2"/> + <path d="M0 827.71 A14.175 14.175 0 1 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st2"/> </g> - <g id="shape14-11" v:mID="14" v:groupContext="shape" v:layerMember="0" transform="translate(248.031,1194.8) scale(1,-1)"> + <g id="shape6-11" v:mID="6" v:groupContext="shape" v:layerMember="0" transform="translate(248.031,1194.8) scale(1,-1)"> <title>Manual operation</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -98,10 +88,9 @@ <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> <path d="M14.17 841.89 L56.69 841.89 L70.87 799.37 L0 799.37 L14.17 841.89 Z" class="st3"/> </g> - <g id="shape6-13" v:mID="6" v:groupContext="shape" v:layerMember="0" transform="translate(113.386,1133.86) scale(1,-1)"> + <g id="shape7-13" v:mID="7" v:groupContext="shape" v:layerMember="0" transform="translate(113.386,1133.86) scale(1,-1)"> <title>Manual operation.6</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -112,70 +101,66 @@ <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> <path d="M14.17 841.89 L56.69 841.89 L70.87 799.37 L0 799.37 L14.17 841.89 Z" class="st3"/> </g> - <g id="shape11-15" v:mID="11" v:groupContext="shape" v:layerMember="1" - transform="translate(443.273,-454.229) rotate(20.4723)"> + <g id="shape8-15" v:mID="8" v:groupContext="shape" v:layerMember="1" + transform="translate(437.156,-437.843) rotate(20.4723)"> <title>Line-curve connector</title> <v:userDefs> <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> - <path d="M0 841.89 L1.86 843.33 L3.74 844.7 L5.64 846.01 L7.57 847.26 L9.51 848.45 L11.48 849.58 L13.48 850.65 L15.49 - 851.65 L17.53 852.6 L19.59 853.48 L21.67 854.3 L23.77 855.06 L25.89 855.76 L28.04 856.4 L30.21 856.97 L32.4 - 857.48 L34.62 857.94 L36.86 858.33 L39.11 858.66 L41.39 858.92 L43.7 859.13 L46.02 859.28 L48.37 859.36 - L50.74 859.38 L53.13 859.34 L55.55 859.24 L57.98 859.08 L60.44 858.85 L62.92 858.57 L65.43 858.22 L67.95 - 857.81 L70.5 857.34 L73.07 856.81 L75.66 856.22 L78.28 855.57 L80.92 854.85 L83.57 854.07 L86.26 853.24 - L88.96 852.34 L91.69 851.37 L94.43 850.35 L97.2 849.27 L100 848.12 L102.81 846.91 L105.65 845.65 L108.51 - 844.32 L108.83 844.16" class="st4"/> + <path d="M0 824.4 L1.86 825.84 L3.74 827.21 L5.64 828.52 L7.57 829.77 L9.51 830.96 L11.48 832.09 L13.48 833.16 L15.49 + 834.16 L17.53 835.11 L19.59 835.99 L21.67 836.81 L23.77 837.57 L25.89 838.27 L28.04 838.91 L30.21 839.48 + L32.4 839.99 L34.62 840.45 L36.86 840.84 L39.11 841.17 L41.39 841.43 L43.7 841.64 L46.02 841.79 L48.37 841.87 + L50.74 841.89 L53.13 841.85 L55.55 841.75 L57.98 841.59 L60.44 841.36 L62.92 841.08 L65.43 840.73 L67.95 + 840.32 L70.5 839.85 L73.07 839.32 L75.66 838.73 L78.28 838.08 L80.92 837.36 L83.57 836.58 L86.26 835.75 + L88.96 834.85 L91.69 833.88 L94.43 832.86 L97.2 831.78 L100 830.63 L102.81 829.42 L105.65 828.16 L108.51 + 826.83 L108.83 826.67 L113.45 824.36" class="st4"/> </g> - <g id="shape9-21" v:mID="9" v:groupContext="shape" v:layerMember="1" transform="translate(75.1181,-708.661)"> + <g id="shape9-21" v:mID="9" v:groupContext="shape" v:layerMember="1" transform="translate(82.2083,-666.14)"> <title>Dynamic connector.9</title> <v:userDefs> <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> </v:userDefs> - <path d="M7.09 841.89 L7.09 878.89" class="st6"/> + <path d="M0 799.37 L0 836.37 L0 841.89" class="st4"/> </g> - <g id="shape10-27" v:mID="10" v:groupContext="shape" v:layerMember="1" transform="translate(194.173,-708.661)"> + <g id="shape10-26" v:mID="10" v:groupContext="shape" v:layerMember="1" transform="translate(201.263,-666.14)"> <title>Dynamic connector.10</title> <v:userDefs> <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> </v:userDefs> - <path d="M7.09 841.89 L7.09 878.89" class="st6"/> + <path d="M0 799.37 L0 836.37 L0 841.89" class="st4"/> </g> - <g id="shape8-32" v:mID="8" v:groupContext="shape" v:layerMember="1" transform="translate(677.511,-320.345) rotate(45)"> + <g id="shape11-31" v:mID="11" v:groupContext="shape" v:layerMember="1" transform="translate(668.65,-311.485) rotate(45)"> <title>Line-curve connector.8</title> <v:userDefs> <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> - <path d="M0 841.89 L1.34 843.08 L2.67 844.2 L4.01 845.27 L5.34 846.28 L6.68 847.23 L8.01 848.12 L9.34 848.96 L10.67 849.73 - L12 850.44 L13.32 851.1 L14.65 851.7 L15.97 852.23 L17.29 852.71 L18.62 853.13 L19.94 853.49 L21.26 853.8 - L22.57 854.04 L23.89 854.22 L25.2 854.35 L26.52 854.41 L27.83 854.42 L29.14 854.37 L30.45 854.26 L31.76 - 854.09 L33.07 853.86 L34.38 853.57 L35.68 853.22 L36.98 852.82 L38.29 852.35 L39.59 851.83 L40.89 851.24 - L42.19 850.6 L43.48 849.9 L44.78 849.14 L46.08 848.32 L47.37 847.44 L48.66 846.51 L49.95 845.51 L50.23 845.28" - class="st4"/> + <path d="M0 829.36 L1.34 830.55 L2.67 831.67 L4.01 832.74 L5.34 833.75 L6.68 834.7 L8.01 835.59 L9.34 836.43 L10.67 837.2 + L12 837.91 L13.32 838.57 L14.65 839.17 L15.97 839.7 L17.29 840.18 L18.62 840.6 L19.94 840.96 L21.26 841.27 + L22.57 841.51 L23.89 841.69 L25.2 841.82 L26.52 841.88 L27.83 841.89 L29.14 841.84 L30.45 841.73 L31.76 + 841.56 L33.07 841.33 L34.38 841.04 L35.68 840.69 L36.98 840.29 L38.29 839.82 L39.59 839.3 L40.89 838.71 + L42.19 838.07 L43.48 837.37 L44.78 836.61 L46.08 835.79 L47.37 834.91 L48.66 833.98 L49.95 832.98 L50.23 + 832.75 L54.22 829.47" class="st4"/> </g> - <g id="shape12-37" v:mID="12" v:groupContext="shape" v:layerMember="1" - transform="translate(-503.697,54.3403) rotate(-84.6233) scale(-1,1)"> + <g id="shape12-36" v:mID="12" v:groupContext="shape" v:layerMember="1" + transform="translate(-491.271,55.5096) rotate(-84.6233) scale(-1,1)"> <title>Line-curve connector.12</title> <v:userDefs> <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> - <path d="M0 841.89 L6.36 842.97 L12.67 844 L18.93 844.98 L25.15 845.92 L31.33 846.8 L37.46 847.64 L43.54 848.42 L49.58 - 849.16 L55.57 849.85 L61.52 850.49 L67.42 851.08 L73.28 851.62 L79.09 852.12 L84.85 852.56 L90.57 852.96 - L96.25 853.31 L101.88 853.6 L107.46 853.85 L113 854.05 L118.49 854.21 L123.94 854.31 L129.34 854.36 L134.69 - 854.37 L140 854.33 L145.27 854.24 L150.49 854.09 L155.66 853.9 L160.79 853.67 L165.87 853.38 L170.91 853.04 - L175.9 852.66 L180.85 852.22 L185.75 851.74 L190.6 851.21 L195.41 850.63 L200.18 850 L204.89 849.32 L209.57 - 848.6 L214.2 847.82 L218.78 847 L223.31 846.12 L227.8 845.2 L232.25 844.23 L236.65 843.21 L237 843.13" - class="st4"/> + <path d="M0 829.41 L6.36 830.49 L12.67 831.52 L18.93 832.5 L25.15 833.44 L31.33 834.32 L37.46 835.16 L43.54 835.94 L49.58 + 836.68 L55.57 837.37 L61.52 838.01 L67.42 838.6 L73.28 839.14 L79.09 839.64 L84.85 840.08 L90.57 840.48 + L96.25 840.83 L101.88 841.12 L107.46 841.37 L113 841.57 L118.49 841.73 L123.94 841.83 L129.34 841.88 L134.69 + 841.89 L140 841.85 L145.27 841.76 L150.49 841.61 L155.66 841.42 L160.79 841.19 L165.87 840.9 L170.91 840.56 + L175.9 840.18 L180.85 839.74 L185.75 839.26 L190.6 838.73 L195.41 838.15 L200.18 837.52 L204.89 836.84 L209.57 + 836.12 L214.2 835.34 L218.78 834.52 L223.31 833.64 L227.8 832.72 L232.25 831.75 L236.65 830.73 L237 830.65 + L242.03 829.5" class="st4"/> </g> - <g id="shape13-42" v:mID="13" v:groupContext="shape" v:layerMember="0" transform="translate(340.157,1258.58) scale(1,-1)"> + <g id="shape13-41" v:mID="13" v:groupContext="shape" v:layerMember="0" transform="translate(340.157,1258.58) scale(1,-1)"> <title>Manual operation.13</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -186,51 +171,47 @@ <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> - <path d="M14.17 841.89 L56.69 841.89 L70.87 799.37 L0 799.37 L14.17 841.89 Z" class="st7"/> + <path d="M14.17 841.89 L56.69 841.89 L70.87 799.37 L0 799.37 L14.17 841.89 Z" class="st6"/> </g> - <g id="shape15-44" v:mID="15" v:groupContext="shape" v:layerMember="1" - transform="translate(750.461,-305.062) rotate(33.6901)"> + <g id="shape14-43" v:mID="14" v:groupContext="shape" v:layerMember="1" + transform="translate(742.833,-293.621) rotate(33.6901)"> <title>Line-curve connector.15</title> <v:userDefs> <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> - <path d="M0 841.89 L1.3 843.14 L2.61 844.32 L3.95 845.45 L5.32 846.52 L6.71 847.53 L8.11 848.48 L9.55 849.37 L11 850.2 - L12.48 850.97 L13.98 851.69 L15.5 852.34 L17.05 852.94 L18.62 853.47 L20.21 853.95 L21.82 854.37 L23.46 - 854.73 L25.12 855.03 L26.8 855.27 L28.51 855.45 L30.24 855.57 L31.99 855.64 L33.76 855.64 L35.56 855.59 - L37.38 855.48 L39.22 855.3 L41.09 855.07 L42.97 854.78 L44.88 854.43 L46.82 854.02 L48.77 853.56 L50.75 - 853.03 L52.76 852.44 L54.78 851.8 L56.83 851.09 L58.9 850.33 L60.99 849.51 L63.11 848.63 L65.24 847.69 L67.41 - 846.69 L69.59 845.63 L71.8 844.51 L72.11 844.34" class="st4"/> + <path d="M0 828.14 L1.3 829.39 L2.61 830.57 L3.95 831.7 L5.32 832.77 L6.71 833.78 L8.11 834.73 L9.55 835.62 L11 836.45 + L12.48 837.22 L13.98 837.94 L15.5 838.59 L17.05 839.19 L18.62 839.72 L20.21 840.2 L21.82 840.62 L23.46 840.98 + L25.12 841.28 L26.8 841.52 L28.51 841.7 L30.24 841.82 L31.99 841.89 L33.76 841.89 L35.56 841.84 L37.38 841.73 + L39.22 841.55 L41.09 841.32 L42.97 841.03 L44.88 840.68 L46.82 840.27 L48.77 839.81 L50.75 839.28 L52.76 + 838.69 L54.78 838.05 L56.83 837.34 L58.9 836.58 L60.99 835.76 L63.11 834.88 L65.24 833.94 L67.41 832.94 + L69.59 831.88 L71.8 830.76 L72.11 830.59 L76.63 828.11" class="st4"/> </g> - <g id="shape16-49" v:mID="16" v:groupContext="shape" v:layerMember="1;0" transform="translate(453.543,-708.661)"> + <g id="shape15-48" v:mID="15" v:groupContext="shape" v:layerMember="1;0" transform="translate(453.543,-708.655)"> <title>On-page reference.16</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st1"/> + <path d="M0 827.71 A14.175 14.175 0 1 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st1"/> </g> - <g id="shape17-51" v:mID="17" v:groupContext="shape" v:layerMember="1" - transform="translate(-356.317,-39.2438) rotate(-78.1785) scale(-1,1)"> + <g id="shape16-50" v:mID="16" v:groupContext="shape" v:layerMember="1" + transform="translate(-340.46,-35.925) rotate(-78.1785) scale(-1,1)"> <title>Line-curve connector.17</title> <v:userDefs> <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> - <path d="M0 841.89 L6.74 842.87 L13.42 843.83 L20.04 844.75 L26.6 845.64 L33.1 846.5 L39.54 847.33 L45.91 848.13 L52.23 - 848.9 L58.49 849.64 L64.68 850.35 L70.82 851.02 L76.89 851.67 L82.9 852.28 L88.85 852.87 L94.74 853.42 L100.57 - 853.94 L106.34 854.43 L112.05 854.89 L117.7 855.32 L123.29 855.72 L128.82 856.09 L134.28 856.42 L139.69 - 856.73 L145.03 857 L150.32 857.25 L155.54 857.46 L160.7 857.64 L165.8 857.79 L170.84 857.91 L175.82 858 - L180.74 858.06 L185.6 858.09 L190.4 858.09 L195.14 858.05 L199.81 857.99 L204.43 857.89 L208.98 857.77 L213.48 - 857.61 L217.91 857.42 L222.28 857.2 L226.6 856.95 L230.85 856.67 L235.04 856.36 L239.17 856.02 L243.24 855.64 - L247.25 855.24 L251.19 854.81 L255.08 854.34 L258.91 853.84 L262.67 853.32 L266.38 852.76 L270.02 852.17 - L273.6 851.55 L277.13 850.9 L280.59 850.21 L283.99 849.5 L287.33 848.76 L290.61 847.98 L293.83 847.18 L296.99 - 846.34 L300.08 845.48 L303.12 844.58 L306.1 843.65 L306.44 843.53" class="st4"/> + <path d="M0 825.69 L6.74 826.67 L13.42 827.63 L20.04 828.55 L26.6 829.44 L33.1 830.3 L39.54 831.13 L45.91 831.93 L52.23 + 832.7 L58.49 833.44 L64.68 834.15 L70.82 834.82 L76.89 835.47 L82.9 836.08 L88.85 836.67 L94.74 837.22 L100.57 + 837.74 L106.34 838.23 L112.05 838.69 L117.7 839.12 L123.29 839.52 L128.82 839.89 L134.28 840.22 L139.69 + 840.53 L145.03 840.8 L150.32 841.05 L155.54 841.26 L160.7 841.44 L165.8 841.59 L170.84 841.71 L175.82 841.8 + L180.74 841.86 L185.6 841.89 L190.4 841.89 L195.14 841.85 L199.81 841.79 L204.43 841.69 L208.98 841.57 L213.48 + 841.41 L217.91 841.22 L222.28 841 L226.6 840.75 L230.85 840.47 L235.04 840.16 L239.17 839.82 L243.24 839.44 + L247.25 839.04 L251.19 838.61 L255.08 838.14 L258.91 837.64 L262.67 837.12 L266.38 836.56 L270.02 835.97 + L273.6 835.35 L277.13 834.7 L280.59 834.01 L283.99 833.3 L287.33 832.56 L290.61 831.78 L293.83 830.98 L296.99 + 830.14 L300.08 829.28 L303.12 828.38 L306.1 827.45 L306.44 827.33 L311.31 825.61" class="st4"/> </g> - <g id="shape18-56" v:mID="18" v:groupContext="shape" v:layerMember="0" transform="translate(340.157,-308.976)"> + <g id="shape17-55" v:mID="17" v:groupContext="shape" v:layerMember="0" transform="translate(340.152,-308.976)"> <title>Terminator</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -240,32 +221,33 @@ <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"/> - <path d="M14.17 841.89 L56.69 841.89 A14.1732 14.1732 -180 0 0 56.69 813.54 L14.17 813.54 A14.1732 14.1732 -180 1 0 14.17 - 841.89 Z" class="st8"/> + <path d="M14.17 841.89 L56.69 841.89 A14.175 14.175 -180 0 0 56.69 813.54 L14.17 813.54 A14.175 14.175 -180 1 0 14.17 + 841.89 Z" class="st7"/> </g> - <g id="shape19-58" v:mID="19" v:groupContext="shape" v:layerMember="1" transform="translate(368.504,-382.677)"> + <g id="shape18-57" v:mID="18" v:groupContext="shape" v:layerMember="1" transform="translate(375.594,-337.327)"> <title>Dynamic connector.19</title> <v:userDefs> <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> </v:userDefs> - <path d="M7.09 841.89 L7.09 881.72" class="st6"/> + <path d="M0 796.54 L0 836.37 L0 841.89" class="st4"/> </g> - <g id="shape20-63" v:mID="20" v:groupContext="shape" transform="translate(32.2047,-759.354)"> - <title>Sheet.20</title> + <g id="shape19-62" v:mID="19" v:groupContext="shape" transform="translate(32.205,-759.353)"> + <title>Sheet.19</title> <desc>Context</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="32.77" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Context</text> </g> - <g id="shape21-66" v:mID="21" v:groupContext="shape" transform="translate(151.26,-759.354)"> - <title>Sheet.21</title> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="32.76" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>Context</text> </g> + <g id="shape20-65" v:mID="20" v:groupContext="shape" transform="translate(151.26,-759.353)"> + <title>Sheet.20</title> <desc>Seating</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="33.04" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Seating</text> </g> - <g id="shape22-69" v:mID="22" v:groupContext="shape" v:layerMember="0" transform="translate(113.386,-368.504)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="33.04" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>Seating</text> </g> + <g id="shape21-68" v:mID="21" v:groupContext="shape" v:layerMember="0" transform="translate(113.381,-368.503)"> <title>Terminator.22</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -275,18 +257,17 @@ <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"/> - <path d="M14.17 841.89 L56.69 841.89 A14.1732 14.1732 -180 0 0 56.69 813.54 L14.17 813.54 A14.1732 14.1732 -180 1 0 14.17 - 841.89 Z" class="st8"/> + <path d="M14.17 841.89 L56.69 841.89 A14.175 14.175 -180 1 0 56.69 813.54 L14.17 813.54 A14.175 14.175 -180 1 0 14.17 + 841.89 Z" class="st7"/> </g> - <g id="shape23-71" v:mID="23" v:groupContext="shape" v:layerMember="1" transform="translate(155.906,-507.402)"> + <g id="shape22-70" v:mID="22" v:groupContext="shape" v:layerMember="1" transform="translate(148.816,-396.851)"> <title>Dynamic connector.23</title> <v:userDefs> <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> </v:userDefs> - <path d="M-7.09 841.89 L-7.09 946.92" class="st6"/> + <path d="M0 731.34 L0 836.37 L0 841.89" class="st4"/> </g> - <g id="shape24-76" v:mID="24" v:groupContext="shape" v:layerMember="0" transform="translate(56.6929,-255.118)"> + <g id="shape23-75" v:mID="23" v:groupContext="shape" v:layerMember="0" transform="translate(56.6932,-255.118)"> <title>Process</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -296,10 +277,9 @@ <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"/> - <rect x="0" y="274.961" width="184.252" height="566.929" class="st11"/> + <rect x="0" y="274.961" width="184.252" height="566.928" class="st10"/> </g> - <g id="shape25-78" v:mID="25" v:groupContext="shape" v:layerMember="0" transform="translate(240.945,-255.118)"> + <g id="shape24-77" v:mID="24" v:groupContext="shape" v:layerMember="0" transform="translate(240.945,-255.118)"> <title>Process.25</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -309,117 +289,119 @@ <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"/> - <rect x="0" y="274.961" width="269.291" height="566.929" class="st11"/> + <rect x="0" y="274.961" width="269.291" height="566.928" class="st10"/> </g> - <g id="shape26-80" v:mID="26" v:groupContext="shape" transform="translate(284.488,-759.354)"> + <g id="shape25-79" v:mID="25" v:groupContext="shape" transform="translate(284.488,-759.353)"> + <title>Sheet.25</title> + <desc>Path</desc> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="39.71" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>Path</text> </g> + <g id="shape26-82" v:mID="26" v:groupContext="shape" transform="translate(417.717,-759.353)"> <title>Sheet.26</title> <desc>Path</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="39.71" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Path</text> </g> - <g id="shape27-83" v:mID="27" v:groupContext="shape" transform="translate(417.717,-759.354)"> - <title>Sheet.27</title> - <desc>Path</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="39.71" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Path</text> </g> - <g id="shape28-86" v:mID="28" v:groupContext="shape" v:layerMember="1;0" transform="translate(68.0315,-566.929)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="39.71" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>Path</text> </g> + <g id="shape27-85" v:mID="27" v:groupContext="shape" v:layerMember="1;0" transform="translate(68.0317,-566.923)"> <title>On-page reference.28</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st12"/> + <path d="M0 827.71 A14.175 14.175 0 0 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st11"/> </g> - <g id="shape7-88" v:mID="7" v:groupContext="shape" v:layerMember="1" transform="translate(75.1181,-637.795)"> + <g id="shape28-87" v:mID="28" v:groupContext="shape" v:layerMember="1" transform="translate(82.2083,-595.274)"> <title>Dynamic connector.7</title> <v:userDefs> <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> </v:userDefs> - <path d="M7.09 841.89 L7.09 878.89" class="st6"/> + <path d="M0 799.37 L0 836.37 L0 841.89" class="st4"/> </g> - <g id="shape29-93" v:mID="29" v:groupContext="shape" v:layerMember="1" - transform="translate(-620.832,22.5936) rotate(-77.55) scale(-1,1)"> + <g id="shape29-92" v:mID="29" v:groupContext="shape" v:layerMember="1" + transform="translate(-614.025,24.0962) rotate(-77.55) scale(-1,1)"> <title>Line-curve connector.29</title> <v:userDefs> <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> - <path d="M0 841.89 L3.54 842.46 L7.03 843 L10.47 843.51 L13.86 844.01 L17.19 844.48 L20.48 844.92 L23.71 845.35 L26.89 - 845.74 L30.01 846.12 L33.09 846.47 L36.11 846.8 L39.08 847.1 L42 847.38 L44.87 847.63 L47.69 847.86 L50.45 - 848.07 L53.16 848.25 L55.82 848.41 L58.43 848.55 L60.98 848.66 L63.49 848.74 L65.94 848.81 L68.34 848.85 - L70.68 848.86 L72.98 848.86 L75.22 848.82 L77.42 848.77 L79.56 848.69 L81.64 848.58 L83.68 848.45 L85.66 - 848.3 L87.6 848.13 L89.48 847.93 L91.3 847.7 L93.08 847.46 L94.8 847.18 L96.48 846.89 L98.1 846.57 L99.66 - 846.23 L101.18 845.86 L102.65 845.47 L104.06 845.05 L105.42 844.62 L106.73 844.15 L107.06 844" class="st4"/> + <path d="M0 834.92 L3.54 835.49 L7.03 836.03 L10.47 836.54 L13.86 837.04 L17.19 837.51 L20.48 837.95 L23.71 838.38 L26.89 + 838.77 L30.01 839.15 L33.09 839.5 L36.11 839.83 L39.08 840.13 L42 840.41 L44.87 840.66 L47.69 840.89 L50.45 + 841.1 L53.16 841.28 L55.82 841.44 L58.43 841.58 L60.98 841.69 L63.49 841.77 L65.94 841.84 L68.34 841.88 + L70.68 841.89 L72.98 841.89 L75.22 841.85 L77.42 841.8 L79.56 841.72 L81.64 841.61 L83.68 841.48 L85.66 + 841.33 L87.6 841.16 L89.48 840.96 L91.3 840.73 L93.08 840.49 L94.8 840.21 L96.48 839.92 L98.1 839.6 L99.66 + 839.26 L101.18 838.89 L102.65 838.5 L104.06 838.08 L105.42 837.65 L106.73 837.18 L107.06 837.03 L111.76 + 834.89" class="st4"/> </g> - <g id="shape30-98" v:mID="30" v:groupContext="shape" transform="translate(85.0394,-668.976)"> + <g id="shape30-97" v:mID="30" v:groupContext="shape" transform="translate(85.0396,-668.975)"> <title>Sheet.30</title> <desc>state==MAKE_PATH</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="3.03" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>state==MAKE_PATH</text> </g> - <g id="shape31-101" v:mID="31" v:groupContext="shape" transform="translate(325.591,-469.89)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="3.03" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>state==MAKE_PATH</text> </g> + <g id="shape31-100" v:mID="31" v:groupContext="shape" transform="translate(325.591,-469.889)"> <title>Sheet.31</title> <desc>Path.id==Seating.pid Path.name=Seating.ln</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="55.4724" cy="835.89" width="110.95" height="12"/> - <rect x="0" y="829.89" width="110.945" height="12" class="st9"/> - <text x="2" y="832.89" class="st10" v:langID="2057"><v:paragraph/><v:tabList/>Path.id==Seating.pid<v:newlineChar/><tspan - x="2" dy="1.2em" class="st13">Path</tspan>.name=Seating.ln</text> </g> - <g id="shape32-105" v:mID="32" v:groupContext="shape" transform="translate(403.543,-362.504)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="55.472" cy="835.889" width="110.95" height="12"/> + <rect x="0" y="829.889" width="110.945" height="12" class="st8"/> + <text x="2" y="832.89" class="st9" v:langID="1033"><v:paragraph/><v:tabList/>Path.id==Seating.pid<v:newlineChar/><tspan + x="2" dy="1.2em" class="st12">Path</tspan>.name=Seating.ln</text> </g> + <g id="shape32-104" v:mID="32" v:groupContext="shape" transform="translate(403.543,-362.503)"> <title>Sheet.32</title> <desc>Path.id==Seating.id Path.name=Seating.ln</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="56.1811" cy="835.89" width="112.37" height="12"/> - <rect x="0" y="829.89" width="112.362" height="12" class="st9"/> - <text x="2" y="832.89" class="st10" v:langID="2057"><v:paragraph/><v:tabList/>Path.id==Seating.id<v:newlineChar/><tspan - x="2" dy="1.2em" class="st13">Path</tspan>.name=Seating.ln</text> </g> - <g id="shape33-109" v:mID="33" v:groupContext="shape" transform="translate(281.496,-277.465)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="56.1807" cy="835.889" width="112.37" height="12"/> + <rect x="0" y="829.889" width="112.362" height="12" class="st8"/> + <text x="2" y="832.89" class="st9" v:langID="1033"><v:paragraph/><v:tabList/>Path.id==Seating.id<v:newlineChar/><tspan + x="2" dy="1.2em" class="st12">Path</tspan>.name=Seating.ln</text> </g> + <g id="shape33-108" v:mID="33" v:groupContext="shape" transform="translate(281.496,-277.465)"> <title>Sheet.33</title> <desc>assert Path( id=Seating.id, name=Seating.ln, seat=Path.seat )</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="87.0079" cy="835.89" width="174.02" height="12"/> - <rect x="0" y="829.89" width="174.016" height="12" class="st9"/> - <text x="26.83" y="826.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>assert Path( id=Seating.id, <v:newlineChar/><tspan - x="10.44" dy="1.2em" class="st13"> name</tspan>=Seating.ln,<v:newlineChar/><tspan - x="17.11" dy="1.2em" class="st13"> seat</tspan>=Path.seat )</text> </g> - <g id="shape34-114" v:mID="34" v:groupContext="shape" transform="translate(68.4646,-342.331)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="87.0074" cy="835.889" width="174.02" height="12"/> + <rect x="0" y="829.889" width="174.016" height="12" class="st8"/> + <text x="26.82" y="826.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>assert Path( id=Seating.id, <v:newlineChar/><tspan + x="10.43" dy="1.2em" class="st12"> name</tspan>=Seating.ln,<v:newlineChar/><tspan + x="17.11" dy="1.2em" class="st12"> seat</tspan>=Path.seat )</text> </g> + <g id="shape34-113" v:mID="34" v:groupContext="shape" transform="translate(68.4648,-342.331)"> <title>Sheet.34</title> <desc>modify Seating( pathDone = true )</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="80.3543" cy="835.89" width="160.71" height="12"/> - <rect x="0" y="829.89" width="160.709" height="12" class="st9"/> - <text x="5.17" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>modify Seating( pathDone = true )</text> </g> - <g id="shape35-117" v:mID="35" v:groupContext="shape" v:layerMember="1;0" transform="translate(56.6929,-212.598)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="80.3538" cy="835.889" width="160.71" height="12"/> + <rect x="0" y="829.889" width="160.709" height="12" class="st8"/> + <text x="5.17" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>modify Seating( pathDone = true )</text> </g> + <g id="shape35-116" v:mID="35" v:groupContext="shape" v:layerMember="1;0" transform="translate(56.6932,-212.593)"> <title>On-page reference.35</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st1"/> + <path d="M0 827.71 A14.175 14.175 0 0 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st1"/> </g> - <g id="shape36-119" v:mID="36" v:groupContext="shape" v:layerMember="1;0" transform="translate(56.6929,-164.409)"> + <g id="shape36-118" v:mID="36" v:groupContext="shape" v:layerMember="1;0" transform="translate(56.6932,-164.404)"> <title>On-page reference.36</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st2"/> + <path d="M0 827.71 A14.175 14.175 0 0 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st2"/> </g> - <g id="shape37-121" v:mID="37" v:groupContext="shape" v:layerMember="1;0" transform="translate(56.6929,-121.89)"> + <g id="shape37-120" v:mID="37" v:groupContext="shape" v:layerMember="1;0" transform="translate(56.6932,-121.885)"> <title>On-page reference.37</title> <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"/> - <path d="M0 827.72 A14.1732 14.1732 0 0 1 28.35 827.72 A14.1732 14.1732 0 1 1 0 827.72 Z" class="st12"/> + <path d="M0 827.71 A14.175 14.175 0 0 1 28.35 827.71 A14.175 14.175 0 0 1 0 827.71 Z" class="st11"/> </g> - <g id="shape38-123" v:mID="38" v:groupContext="shape" v:layerMember="0" transform="translate(311.811,1442.83) scale(1,-1)"> + <g id="shape38-122" v:mID="38" v:groupContext="shape" v:layerMember="0" transform="translate(311.811,1442.83) scale(1,-1)"> <title>Manual operation.38</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -430,10 +412,9 @@ <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> <path d="M14.17 841.89 L56.69 841.89 L70.87 799.37 L0 799.37 L14.17 841.89 Z" class="st3"/> </g> - <g id="shape39-125" v:mID="39" v:groupContext="shape" v:layerMember="0" transform="translate(311.811,1509.45) scale(1,-1)"> + <g id="shape39-124" v:mID="39" v:groupContext="shape" v:layerMember="0" transform="translate(311.811,1509.45) scale(1,-1)"> <title>Manual operation.39</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -444,10 +425,9 @@ <v:ud v:nameU="AntiScale" v:val="VT0(1):26"/> <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"/> - <path d="M14.17 841.89 L56.69 841.89 L70.87 799.37 L0 799.37 L14.17 841.89 Z" class="st7"/> + <path d="M14.17 841.89 L56.69 841.89 L70.87 799.37 L0 799.37 L14.17 841.89 Z" class="st6"/> </g> - <g id="shape40-127" v:mID="40" v:groupContext="shape" v:layerMember="0" transform="translate(311.811,-73.7008)"> + <g id="shape40-126" v:mID="40" v:groupContext="shape" v:layerMember="0" transform="translate(311.806,-73.7007)"> <title>Terminator.40</title> <v:custProps> <v:cp v:nameU="Cost" v:lbl="Cost" v:type="7" v:format="@" v:langID="1033"/> @@ -457,72 +437,81 @@ <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"/> - <path d="M14.17 841.89 L56.69 841.89 A14.1732 14.1732 -180 0 0 56.69 813.54 L14.17 813.54 A14.1732 14.1732 -180 1 0 14.17 - 841.89 Z" class="st8"/> + <path d="M14.17 841.89 L56.69 841.89 A14.175 14.175 -180 0 0 56.69 813.54 L14.17 813.54 A14.175 14.175 -180 1 0 14.17 + 841.89 Z" class="st7"/> </g> - <g id="shape41-129" v:mID="41" v:groupContext="shape" transform="translate(79.3701,-222.063)"> + <g id="shape41-128" v:mID="41" v:groupContext="shape" transform="translate(79.3703,-222.063)"> <title>Sheet.41</title> <desc>ObjectTypeNode</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="12.48" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>ObjectTypeNode</text> </g> - <g id="shape42-132" v:mID="42" v:groupContext="shape" transform="translate(70.0787,-175.291)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="12.47" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>ObjectTypeNode</text> </g> + <g id="shape42-131" v:mID="42" v:groupContext="shape" transform="translate(70.0789,-175.291)"> <title>Sheet.42</title> <desc>AlphaNode</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="25.26" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>AlphaNode</text> </g> - <g id="shape43-135" v:mID="43" v:groupContext="shape" transform="translate(89.9213,-134.898)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="25.25" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>AlphaNode</text> </g> + <g id="shape43-134" v:mID="43" v:groupContext="shape" transform="translate(89.9215,-134.898)"> <title>Sheet.43</title> <desc>LeftInputAdapterNode</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="57.0866" cy="835.89" width="114.18" height="12"/> - <rect x="0" y="829.89" width="114.173" height="12" class="st9"/> - <text x="8.15" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>LeftInputAdapterNode</text> </g> - <g id="shape44-138" v:mID="44" v:groupContext="shape" transform="translate(362.047,-151.197)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="57.0862" cy="835.889" width="114.18" height="12"/> + <rect x="0" y="829.889" width="114.173" height="12" class="st8"/> + <text x="8.17" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>LeftInputAdapterNode</text> </g> + <g id="shape44-137" v:mID="44" v:groupContext="shape" transform="translate(362.047,-151.197)"> <title>Sheet.44</title> <desc>NotNode</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="30.27" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>NotNode</text> </g> - <g id="shape45-141" v:mID="45" v:groupContext="shape" transform="translate(363.858,-212.142)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="30.26" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>NotNode</text> </g> + <g id="shape45-140" v:mID="45" v:groupContext="shape" transform="translate(363.858,-212.142)"> <title>Sheet.45</title> <desc>JoinNode</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="28.87" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>JoinNode</text> </g> - <g id="shape46-144" v:mID="46" v:groupContext="shape" transform="translate(372.362,-81.874)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="28.87" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>JoinNode</text> </g> + <g id="shape46-143" v:mID="46" v:groupContext="shape" transform="translate(372.362,-81.8739)"> <title>Sheet.46</title> <desc>TerminalNode</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="18.6" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>TerminalNode</text> </g> - <g id="shape47-147" v:mID="47" v:groupContext="shape" transform="translate(111.575,-620.787)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="18.59" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>TerminalNode</text> </g> + <g id="shape47-146" v:mID="47" v:groupContext="shape" transform="translate(111.575,-620.786)"> <title>Sheet.47</title> <desc>pathDone==true</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="13.86" y="838.89" class="st10" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>pathDone==true</text> </g> - <g id="shape48-150" v:mID="48" v:groupContext="shape" transform="translate(98.8189,-801.874)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="11.91" y="838.89" class="st9" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>pathDone==<tspan + class="st12" v:langID="2057">false</tspan></text> </g> + <g id="shape48-150" v:mID="48" v:groupContext="shape" transform="translate(98.8191,-801.873)"> <title>Sheet.48</title> <desc>Path Done</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="16.92" y="840.09" class="st14" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Path Done</text> </g> - <g id="shape49-153" v:mID="49" v:groupContext="shape" transform="translate(340.157,-801.874)"> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="16.92" y="840.09" class="st13" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>Path Done</text> </g> + <g id="shape49-153" v:mID="49" v:groupContext="shape" transform="translate(340.157,-801.873)"> <title>Sheet.49</title> <desc>Make Path</desc> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="50" cy="835.89" width="100.01" height="12"/> - <rect x="0" y="829.89" width="100" height="12" class="st9"/> - <text x="16.54" y="840.09" class="st14" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>Make Path</text> </g> + <v:userDefs/> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="49.9996" cy="835.889" width="100.01" height="12"/> + <rect x="0" y="829.889" width="99.9999" height="12" class="st8"/> + <text x="16.53" y="840.09" class="st13" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>Make Path</text> </g> </g> </svg> Modified: trunk/labs/jbossrules/documentation/articles/Manners/manners_activity_diagram.svg =================================================================== --- trunk/labs/jbossrules/documentation/articles/Manners/manners_activity_diagram.svg 2006-01-18 05:38:22 UTC (rev 2129) +++ trunk/labs/jbossrules/documentation/articles/Manners/manners_activity_diagram.svg 2006-01-18 11:05:45 UTC (rev 2130) @@ -3,23 +3,23 @@ <!-- Generated by Microsoft Visio 11.0, SVG Export, v1.0 manners_activity_diagram.svg Page-1 --> <svg xmlns="http://www.w3.org/2000/svg" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="7.89733in" height="6.9885in" viewBox="0 0 568.608 503.172" xml:space="preserve" color-interpolation-filters="sRGB" class="st14"> - <v:documentProperties v:langID="1033" v:metric="true" v:viewMarkup="false"/> + <v:documentProperties v:langID="1033" v:metric="true"/> <style type="text/css"> <![CDATA[ .st1 {fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} .st2 {fill:#000000;font-family:Arial;font-size:1.00001em} - .st3 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} - .st4 {fill:none;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} - .st5 {fill:#000000;font-family:Arial;font-size:0.666664em} - .st6 {fill:#000000;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} - .st7 {fill:#000000} - .st8 {stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} - .st9 {marker-end:url(#mrkr3-67);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.48} - .st10 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0.10810810810811} - .st11 {stroke:#000000;stroke-dasharray:5.04,3.6;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} - .st12 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} - .st13 {font-size:1em} + .st3 {font-size:1em} + .st4 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} + .st5 {fill:none;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} + .st6 {fill:#000000;font-family:Arial;font-size:0.666664em} + .st7 {fill:#000000;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st8 {fill:#000000;stroke:none;stroke-width:1} + .st9 {marker-end:url(#mrkr3-71);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.48} + .st10 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0.10810806741051} + .st11 {fill:none} + .st12 {stroke:#000000;stroke-dasharray:5.04,3.6;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.72} + .st13 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} .st14 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3} ]]> </style> @@ -28,8 +28,8 @@ <g id="lend3"> <path d="M 2 1 L 0 0 L 2 -1 " style="stroke-linecap:round;stroke-linejoin:round;fill:none"/> </g> - <marker id="mrkr3-67" class="st10" v:arrowType="3" v:arrowSize="4" orient="auto" markerUnits="strokeWidth"> - <use xlink:href="#lend3" transform="scale(-9.25,-9.25) "/> + <marker id="mrkr3-71" class="st10" v:arrowType="3" v:arrowSize="4" orient="auto" markerUnits="strokeWidth"> + <use xlink:href="#lend3" transform="scale(-9.2500034821895,-9.2500034821895) "/> </marker> </defs> <g v:mID="0" v:index="1" v:groupContext="foregroundPage"> @@ -37,7 +37,7 @@ <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="Swimlanes" v:index="0" v:snap="false" v:glue="false"/> - <g id="shape41-1" v:mID="41" v:groupContext="shape" v:layerMember="0" transform="translate(454.263,-0.72)"> + <g id="shape1-1" v:mID="1" v:groupContext="shape" v:layerMember="0" transform="translate(454.263,-0.720106)"> <title>Swimlane.41</title> <desc>PRINT RESULTS</desc> <v:userDefs> @@ -51,9 +51,9 @@ </v:userDefs> <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197" v:verticalAlign="0"/> <v:textRect cx="56.6929" cy="252.306" width="113.39" height="501.732"/> - <rect x="0" y="1.44" width="113.386" height="501.732" class="st1"/> - <text x="9.36" y="16.24" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>PRINT RESULTS</text> </g> - <g id="shape40-4" v:mID="40" v:groupContext="shape" v:layerMember="0" transform="translate(340.877,-0.72)"> + <rect x="0" y="1.44021" width="113.386" height="501.732" class="st1"/> + <text x="9.36" y="16.24" class="st2" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>PRINT RESULTS</text> </g> + <g id="shape2-4" v:mID="2" v:groupContext="shape" v:layerMember="0" transform="translate(340.877,-0.720106)"> <title>Swimlane.40</title> <desc>CHECK DONE</desc> <v:userDefs> @@ -67,9 +67,9 @@ </v:userDefs> <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197" v:verticalAlign="0"/> <v:textRect cx="56.6929" cy="252.306" width="113.39" height="501.732"/> - <rect x="0" y="1.44" width="113.386" height="501.732" class="st1"/> - <text x="16.69" y="16.24" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>CHECK DONE</text> </g> - <g id="shape39-7" v:mID="39" v:groupContext="shape" v:layerMember="0" transform="translate(227.492,-0.72)"> + <rect x="0" y="1.44021" width="113.386" height="501.732" class="st1"/> + <text x="16.69" y="16.24" class="st2" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>CHECK DONE</text> </g> + <g id="shape3-7" v:mID="3" v:groupContext="shape" v:layerMember="0" transform="translate(227.492,-0.720106)"> <title>Swimlane.39</title> <desc>MAK PATH</desc> <v:userDefs> @@ -83,9 +83,10 @@ </v:userDefs> <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197" v:verticalAlign="0"/> <v:textRect cx="56.6929" cy="252.306" width="113.39" height="501.732"/> - <rect x="0" y="1.44" width="113.386" height="501.732" class="st1"/> - <text x="26.03" y="16.24" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>MAK PATH</text> </g> - <g id="shape38-10" v:mID="38" v:groupContext="shape" v:layerMember="0" transform="translate(114.106,-0.72)"> + <rect x="0" y="1.44021" width="113.386" height="501.732" class="st1"/> + <text x="22.02" y="16.24" class="st2" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>MAK<tspan class="st3" + v:langID="2057">E</tspan> PATH</text> </g> + <g id="shape4-11" v:mID="4" v:groupContext="shape" v:layerMember="0" transform="translate(114.106,-0.720106)"> <title>Swimlane.38</title> <desc>ASSIGN SEATS</desc> <v:userDefs> @@ -99,9 +100,9 @@ </v:userDefs> <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197" v:verticalAlign="0"/> <v:textRect cx="56.6929" cy="252.306" width="113.39" height="501.732"/> - <rect x="0" y="1.44" width="113.386" height="501.732" class="st1"/> - <text x="12.69" y="16.24" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>ASSIGN SEATS</text> </g> - <g id="shape37-13" v:mID="37" v:groupContext="shape" v:layerMember="0" transform="translate(0.72,-0.72)"> + <rect x="0" y="1.44021" width="113.386" height="501.732" class="st1"/> + <text x="12.68" y="16.24" class="st2" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>ASSIGN SEATS</text> </g> + <g id="shape5-14" v:mID="5" v:groupContext="shape" v:layerMember="0" transform="translate(0.72,-0.720106)"> <title>Swimlane</title> <desc>START UP</desc> <v:userDefs> @@ -115,9 +116,9 @@ </v:userDefs> <v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197" v:verticalAlign="0"/> <v:textRect cx="56.6929" cy="252.306" width="113.39" height="501.732"/> - <rect x="0" y="1.44" width="113.386" height="501.732" class="st1"/> - <text x="27.03" y="16.24" class="st2" v:langID="2057"><v:paragraph v:horizAlign="1"/><v:tabList/>START UP</text> </g> - <g id="group1-16" transform="translate(21.6928,-370.641)" v:mID="1" v:groupContext="group"> + <rect x="0" y="1.44021" width="113.386" height="501.732" class="st1"/> + <text x="27.03" y="16.24" class="st2" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>START UP</text> </g> + <g id="group6-17" transform="translate(21.6928,-370.641)" v:mID="6" v:groupContext="group"> <v:userDefs> <v:ud v:nameU="UMLShapeType" v:val="VT0(40):26"/> <v:ud v:nameU="UMLObjectGUID" v:val="VT4({DB57AEDC-DB06-4A74-9314-493961D4DB78})"/> @@ -131,24 +132,25 @@ <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> </v:userDefs> <title>State</title> - <g id="shape2-17" v:mID="2" v:groupContext="shape"> - <title>Sheet.2</title> + <g id="shape7-18" v:mID="7" v:groupContext="shape" transform="translate(-3.59712E-013,-0.002)"> + <title>Sheet.7</title> <path d="M9 503.17 L62.44 503.17 A9 9 -180 0 0 71.44 494.17 L71.44 486.66 A9 9 -180 0 0 62.44 477.66 L9 477.66 A9 - 9 -180 0 0 0 486.66 L0 494.17 A9 9 -180 0 0 9 503.17 Z" class="st3"/> + 9 -180 0 0 -0 486.66 L0 494.17 A9 9 -180 0 0 9 503.17 Z" class="s... [truncated message content] |
From: <jbo...@li...> - 2006-01-18 05:38:41
|
Author: mar...@jb... Date: 2006-01-18 00:38:22 -0500 (Wed, 18 Jan 2006) New Revision: 2129 Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/FactHandle.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/DefaultConflictResolver.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/PrimacyConflictResolver.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/RecencyConflictResolver.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/ActivationCancelledEvent.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/ActivationCreatedEvent.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/AfterActivationFiredEvent.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/BeforeActivationFiredEvent.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/Agenda.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/AgendaItem.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/DefaultFactHandleFactory.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleFactory.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleImpl.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleList.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/JoinNode.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/NotNode.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/PropagationContextImpl.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/ReteTuple.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/RuleBaseImpl.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/TupleKey.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/WorkingMemoryImpl.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/DefaultKnowledgeHelper.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/KnowledgeHelper.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/PropagationContext.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/Tuple.java trunk/labs/jbossrules/drools-core/src/main/java/org/drools/visualize/ReteooLayout.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/MockFactHandle.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/examples/manners/MannersTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/AgendaTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/AlphaNodeTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/FactHandleTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/JoinNodeTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/LeftInputAdapterNodeTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/LogicalAssertionTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/NotNodeTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/ObjectSourceTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/ObjectTypeNodeTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/ReteTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/SchedulerTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/TestNodeTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/TupleSourceTest.java trunk/labs/jbossrules/drools-core/src/test/java/org/drools/visualize/ReteooJungViewerTest.java Log: -Changes to get Manners working Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/FactHandle.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/FactHandle.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/FactHandle.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -60,4 +60,6 @@ * @return The external string form. */ String toExternalForm(); + + long getRecency(); } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/DefaultConflictResolver.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/DefaultConflictResolver.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/DefaultConflictResolver.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -64,11 +64,7 @@ // Class members // ---------------------------------------------------------------------- - // private static final ConflictResolver[] CONFLICT_RESOLVERS = new - // ConflictResolver[]{SalienceConflictResolver.getInstance(), - // RecencyConflictResolver.getInstance(), - // ComplexityConflictResolver.getInstance(), - private static final ConflictResolver[] CONFLICT_RESOLVERS = new ConflictResolver[]{SalienceConflictResolver.getInstance(), LifoConflictResolver.getInstance() }; + private static final ConflictResolver[] CONFLICT_RESOLVERS = new ConflictResolver[]{SalienceConflictResolver.getInstance(), LifoConflictResolver.getInstance()}; /** Singleton instance. */ private static final DefaultConflictResolver INSTANCE = new DefaultConflictResolver(); Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/PrimacyConflictResolver.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/PrimacyConflictResolver.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/PrimacyConflictResolver.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -41,6 +41,7 @@ * */ +import org.drools.FactHandle; import org.drools.spi.Activation; import org.drools.spi.ConflictResolver; @@ -93,6 +94,56 @@ */ public int compare(Activation lhs, Activation rhs) { - return (int) (lhs.getTuple().getLeastRecentFactTimeStamp() - rhs.getTuple().getLeastRecentFactTimeStamp()); + FactHandle[] lFacts = lhs.getTuple().getFactHandles(); + FactHandle[] rFacts = rhs.getTuple().getFactHandles(); + + FactHandle leftLeastRecent = getLeastRecentFact(lFacts); + FactHandle rightLeastRecent = getLeastRecentFact(rFacts); + + int lastIndex = ( lFacts.length < rFacts.length ) ? lFacts.length : rFacts.length ; + + if (leftLeastRecent.getRecency() == rightLeastRecent.getRecency() && lastIndex > 1 ) { + for ( int i = 0; i < lastIndex; i++ ) { + leftLeastRecent = getLeastRecentFact( lFacts, leftLeastRecent ); + rightLeastRecent = getLeastRecentFact( rFacts, rightLeastRecent ); + if ( leftLeastRecent.getRecency() != rightLeastRecent.getRecency() ) { + return (int) ( rightLeastRecent.getRecency() - leftLeastRecent.getRecency() ); + } + } + } else { + return (int) ( leftLeastRecent.getRecency() - rightLeastRecent.getRecency() ); + } + + return rFacts.length - lFacts.length; } + + private FactHandle getLeastRecentFact(FactHandle[] handles) { + FactHandle mostRecent = handles[0]; + for ( int i = 1; i < handles.length; i++ ) { + FactHandle eachHandle = handles[i]; + + if ( eachHandle.getRecency() < mostRecent.getRecency()) { + mostRecent = eachHandle; + } + } + return mostRecent; + } + + private FactHandle getLeastRecentFact(FactHandle[] handles, FactHandle handle) { + FactHandle mostRecent = null; + + for ( int i = 0; i < handles.length; i++ ) { + FactHandle eachHandle = handles[i]; + + if ( mostRecent == null && eachHandle.getRecency() > handle.getRecency() ) { + mostRecent = eachHandle; + } + + if ( mostRecent != null && eachHandle.getRecency() < mostRecent.getRecency() && eachHandle.getRecency() > handle.getRecency() ) { + mostRecent = eachHandle; + } + } + return (mostRecent != null) ? mostRecent : handle; + } + } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/RecencyConflictResolver.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/RecencyConflictResolver.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/conflict/RecencyConflictResolver.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -41,6 +41,8 @@ * */ +import org.drools.FactHandle; +import org.drools.reteoo.FactHandleImpl; import org.drools.spi.Activation; import org.drools.spi.ConflictResolver; @@ -93,6 +95,58 @@ */ public int compare(Activation lhs, Activation rhs) { - return (int) (lhs.getTuple().getMostRecentFactTimeStamp() - rhs.getTuple().getMostRecentFactTimeStamp()); + FactHandle[] lFacts = lhs.getTuple().getFactHandles(); + FactHandle[] rFacts = rhs.getTuple().getFactHandles(); + + FactHandle leftMostRecent = getMostRecentFact(lFacts); + FactHandle rightMostRecent = getMostRecentFact(rFacts); + + int lastIndex = ( lFacts.length < rFacts.length ) ? lFacts.length : rFacts.length ; + + if (leftMostRecent.getRecency() == rightMostRecent.getRecency() && lastIndex > 1) { + + for ( int i = 0; i < lastIndex; i++ ) { + leftMostRecent = getMostRecentFact( lFacts, leftMostRecent ); + rightMostRecent = getMostRecentFact( rFacts, rightMostRecent ); + if ( leftMostRecent.getRecency() != rightMostRecent.getRecency() ) { + return (int) ( rightMostRecent.getRecency() - leftMostRecent.getRecency() ); + } + } + } else { + return (int) ( rightMostRecent.getRecency() - leftMostRecent.getRecency() ); + } + + return rFacts.length - lFacts.length; } + + private FactHandle getMostRecentFact(FactHandle[] handles) { + FactHandle mostRecent = handles[0]; + for ( int i = 1; i < handles.length; i++ ) { + FactHandle eachHandle = handles[i]; + + if ( eachHandle.getRecency() > mostRecent.getRecency()) { + mostRecent = eachHandle; + } + } + return mostRecent; + } + + private FactHandle getMostRecentFact(FactHandle[] handles, FactHandle handle) { + FactHandle mostRecent = null; + + for ( int i = 0; i < handles.length; i++ ) { + FactHandle eachHandle = handles[i]; + + if ( mostRecent == null && eachHandle.getRecency() < handle.getRecency() ) { + mostRecent = eachHandle; + } + + if ( mostRecent != null && eachHandle.getRecency() > mostRecent.getRecency() && eachHandle.getRecency() < handle.getRecency() ) { + mostRecent = eachHandle; + } + } + return (mostRecent != null) ? mostRecent : handle; + } + + } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/ActivationCancelledEvent.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/ActivationCancelledEvent.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/ActivationCancelledEvent.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -54,7 +54,7 @@ } public String toString() { - //return "[ActivationCancelled: rule=" + getActivation().getRule().getName() + "; tuple=" + getActivation().getTuple() + "]"; - return "[ActivationCancelled: rule=" + getActivation().getRule().getName() + "]"; + return "<==[ActivationCancelled(" + getActivation().getActivationNumber() + "): rule=" + getActivation().getRule().getName() + "; tuple=" + getActivation().getTuple() + "]"; + //return "<==[ActivationCancelled: rule=" + getActivation().getRule().getName() + "]"; } } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/ActivationCreatedEvent.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/ActivationCreatedEvent.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/ActivationCreatedEvent.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -54,7 +54,12 @@ } public String toString() { - return "[ActivationCreated: rule=" + getActivation().getRule().getName() + "]"; - //return "[ActivationCreated: rule=" + getActivation().getRule().getName() + "; tuple=" + getActivation().getTuple() + "]"; + return "==>[ActivationCreated(" + getActivation().getActivationNumber() + "): rule=" + getActivation().getRule().getName() + "; tuple=" + getActivation().getTuple() + "]"; +// if (getActivation().getRule().getName().equals("fiSeating")) { +// return "==>[ActivationCreated: rule=" + getActivation().getRule().getName() + "; tuple=" + getActivation().getTuple() + "]"; +// } else { +// return "==>[ActivationCreated: rule=" + getActivation().getRule().getName() + "]"; +// } + } } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/AfterActivationFiredEvent.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/AfterActivationFiredEvent.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/AfterActivationFiredEvent.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -55,6 +55,6 @@ public String toString() { //return "[AfterActivationFired: rule=" + getActivation().getRule().getName() + "; tuple=" + getActivation().getTuple() + "]"; - return "[AfterActivationFired: rule=" + getActivation().getRule().getName() + "]"; + return "[AfterActivationFired(" + getActivation().getActivationNumber() + "): rule=" + getActivation().getRule().getName() + "]"; } } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/BeforeActivationFiredEvent.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/BeforeActivationFiredEvent.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/event/BeforeActivationFiredEvent.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -56,7 +56,7 @@ } public String toString() { - //return "[BeforeActivationFired: rule=" + getActivation().getRule().getName() + "; tuple=" + getActivation().getTuple() + "]"; - return "[BeforeActivationFired: rule=" + getActivation().getRule().getName() + "]"; + return "[BeforeActivationFired: rule=" + getActivation().getRule().getName() + "; tuple=" + getActivation().getTuple() + "]"; + //return "[BeforeActivationFired(" + getActivation().getActivationNumber() + "): rule=" + getActivation().getRule().getName() + "]"; } } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/Agenda.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/Agenda.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/Agenda.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -156,7 +156,8 @@ Duration dur = rule.getDuration(); - AgendaItem item = new AgendaItem( tuple, + AgendaItem item = new AgendaItem( context.getPropagationNumber(), + tuple, context, rule ); Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/AgendaItem.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/AgendaItem.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/AgendaItem.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -70,12 +70,9 @@ private PropagationContext context; - // ** The Counter */ - private static long counter; - - private long activationNumber; - private boolean retract; + + public long activationNumber; // ------------------------------------------------------------ // Constructors @@ -89,13 +86,14 @@ * @param rule * The rule. */ - AgendaItem(ReteTuple tuple, + AgendaItem(long activationNumber, + ReteTuple tuple, PropagationContext context, Rule rule) { this.tuple = tuple; this.context = context; this.rule = rule; - this.activationNumber = AgendaItem.counter++; + this.activationNumber = activationNumber; } // ------------------------------------------------------------ @@ -175,14 +173,18 @@ } public long getActivationNumber() { - return this.activationNumber; + return this.activationNumber; } public String toString() { - return "[" + this.rule.getName() + " " + this.tuple + "]"; + return "[Activation rule=" + this.rule.getName() + ", tuple=" + this.tuple + "]"; } public boolean equals(Object object) { + if ( object == this ) { + return true; + } + if ( (object == null) || !(object instanceof AgendaItem) ) { return false; } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/DefaultFactHandleFactory.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/DefaultFactHandleFactory.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/DefaultFactHandleFactory.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -60,4 +60,12 @@ return new FactHandleImpl( id, ++this.counter ); } + + public final void increaseFactHandleRecency(FactHandle factHandle) { + ((FactHandleImpl) factHandle).setRecency( ++this.counter ); + } + + public FactHandleFactory newInstance() { + return new DefaultFactHandleFactory(); + } } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleFactory.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleFactory.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleFactory.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -63,4 +63,12 @@ * @return The handle. */ FactHandle newFactHandle(long id); + + public void increaseFactHandleRecency(FactHandle factHandle); + + /** + * + * @return a fresh instance of the fact handle factory, with any IDs reset etc. + */ + FactHandleFactory newInstance(); } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleImpl.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleImpl.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleImpl.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -56,7 +56,7 @@ /** Handle id. */ private long id; - private final long recency; + private long recency; // ---------------------------------------------------------------------- // Constructors @@ -109,7 +109,7 @@ * @see FactHandle */ public String toExternalForm() { - return "[fid:" + this.id + "]"; + return "[fid:" + this.id + ":" + this.recency + "]"; } /** @@ -122,6 +122,10 @@ public long getRecency() { return this.recency; } + + public void setRecency(long recency) { + this.recency = recency; + } public long getId() { return this.id; Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleList.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleList.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/FactHandleList.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -182,6 +182,10 @@ } return true; } + + FactHandle[] getHandles() { + return this.handles; + } /** * Obtains the length of the list. Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/JoinNode.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/JoinNode.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/JoinNode.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -71,36 +71,35 @@ PropagationContext context, WorkingMemoryImpl workingMemory) throws FactException { BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this ); - if ( !memory.contains( leftTuple.getKey() ) ) { - TupleMatches tupleMatches = new TupleMatches( leftTuple ); - memory.put( leftTuple.getKey(), - tupleMatches ); + + TupleMatches tupleMatches = new TupleMatches( leftTuple ); + memory.put( leftTuple.getKey(), + tupleMatches ); - int column = getColumn(); - FactHandleImpl handle = null; - ReteTuple merged = null; - TupleSet tupleSet = new TupleSet(); - BetaNodeBinder binder = getJoinNodeBinder(); - Iterator it = memory.getRightMemory().iterator(); - while ( it.hasNext() ) { - handle = (FactHandleImpl) it.next(); - if ( binder.isAllowed( handle, - leftTuple, - workingMemory ) ) { - tupleMatches.addMatch( handle ); + int column = getColumn(); + FactHandleImpl handle = null; + ReteTuple merged = null; + TupleSet tupleSet = new TupleSet(); + BetaNodeBinder binder = getJoinNodeBinder(); + Iterator it = memory.getRightMemory().iterator(); + while ( it.hasNext() ) { + handle = (FactHandleImpl) it.next(); + if ( binder.isAllowed( handle, + leftTuple, + workingMemory ) ) { + tupleMatches.addMatch( handle ); - merged = new ReteTuple( leftTuple, - new ReteTuple( column, - handle, - workingMemory ) ); - tupleSet.addTuple( merged ); - } + merged = new ReteTuple( leftTuple, + new ReteTuple( column, + handle, + workingMemory ) ); + tupleSet.addTuple( merged ); } - - propagateAssertTuples( tupleSet, - context, - workingMemory ); } + + propagateAssertTuples( tupleSet, + context, + workingMemory ); } /** @@ -116,38 +115,36 @@ PropagationContext context, WorkingMemoryImpl workingMemory) throws FactException { BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this ); - if ( !memory.contains( handle ) ) { - memory.add( handle ); + memory.add( handle ); - ReteTuple leftTuple = null; - TupleMatches tupleMatches = null; - ReteTuple merged = null; + ReteTuple leftTuple = null; + TupleMatches tupleMatches = null; + ReteTuple merged = null; - ReteTuple rightTuple = new ReteTuple( getColumn(), - handle, - workingMemory ); - TupleSet tupleSet = new TupleSet(); - BetaNodeBinder binder = getJoinNodeBinder(); - Iterator it = memory.getLeftMemory().values().iterator(); + ReteTuple rightTuple = new ReteTuple( getColumn(), + handle, + workingMemory ); + TupleSet tupleSet = new TupleSet(); + BetaNodeBinder binder = getJoinNodeBinder(); + Iterator it = memory.getLeftMemory().values().iterator(); - while ( it.hasNext() ) { - tupleMatches = (TupleMatches) it.next(); - leftTuple = tupleMatches.getTuple(); - if ( binder.isAllowed( object, - handle, - leftTuple, - workingMemory ) ) { - tupleMatches.addMatch( handle ); - merged = new ReteTuple( leftTuple, - rightTuple ); - tupleSet.addTuple( merged ); - } + while ( it.hasNext() ) { + tupleMatches = (TupleMatches) it.next(); + leftTuple = tupleMatches.getTuple(); + if ( binder.isAllowed( object, + handle, + leftTuple, + workingMemory ) ) { + tupleMatches.addMatch( handle ); + merged = new ReteTuple( leftTuple, + rightTuple ); + tupleSet.addTuple( merged ); } - - propagateAssertTuples( tupleSet, - context, - workingMemory ); } + + propagateAssertTuples( tupleSet, + context, + workingMemory ); } /** Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/NotNode.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/NotNode.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/NotNode.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -115,8 +115,7 @@ BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this ); if ( !memory.contains( handle ) ) { memory.add( handle ); - - TupleSet assertTupleSet = null; + List retractKeyList = null; BetaNodeBinder binder = getJoinNodeBinder(); @@ -135,12 +134,7 @@ int size = tupleMatches.getMatches().size(); - if ( size == 0 ) { - if (assertTupleSet == null) { - assertTupleSet = new TupleSet(); - } - assertTupleSet.addTuple( leftTuple ); - } else if ( previousSize == 0 && size == 1 ) { + if ( previousSize == 0 && size != 0 ) { // If we previously had size of 0 and now its one we need to remove any created activations if (retractKeyList == null) { retractKeyList = new ArrayList(); @@ -149,12 +143,6 @@ } } - if (assertTupleSet != null) { - propagateAssertTuples( assertTupleSet, - context, - workingMemory ); - } - if (retractKeyList != null) { propagateRetractTuples( retractKeyList, context, @@ -202,24 +190,28 @@ FactException { BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this ); - if ( memory.contains( handle ) ) { - TupleMatches tupleMatches = null; - TupleSet tupleSet = new TupleSet(); + if ( memory.contains( handle ) ) { + TupleSet tupleSet = null; memory.remove( handle ); - Iterator it = memory.getLeftMemory().values().iterator(); - - while ( it.hasNext() ) { - tupleMatches = (TupleMatches) it.next(); + + for ( Iterator it = memory.getLeftMemory().values().iterator(); it.hasNext(); ) { + TupleMatches tupleMatches = (TupleMatches) it.next(); + int previousSize = tupleMatches.getMatches().size(); tupleMatches.removeMatch( handle ); - - if ( tupleMatches.getMatches().size() == 0 ) { + + if ( previousSize != 0 && tupleMatches.getMatches().size() == 0) { + if ( tupleSet == null ) { + tupleSet = new TupleSet(); + } tupleSet.addTuple( tupleMatches.getTuple() ); } } - propagateAssertTuples( tupleSet, - context, - workingMemory ); + if ( tupleSet != null ) { + propagateAssertTuples( tupleSet, + context, + workingMemory ); + } } } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/PropagationContextImpl.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/PropagationContextImpl.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/PropagationContextImpl.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -7,19 +7,27 @@ public class PropagationContextImpl implements PropagationContext { - private int type; + private final int type; - private Rule rule; + private final Rule rule; - private Activation activation; + private final Activation activation; + + private final long propagationNumber; - public PropagationContextImpl(int type, + public PropagationContextImpl(long number, + int type, Rule rule, Activation activation) { this.type = type; this.rule = rule; this.activation = activation; + this.propagationNumber = number; } + + public long getPropagationNumber() { + return this.propagationNumber; + } /* * (non-Javadoc) Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/ReteTuple.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/ReteTuple.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/ReteTuple.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -93,7 +93,7 @@ public String toString() { StringBuffer buffer = new StringBuffer(); for (int i = 0; i < this.key.size(); i++) { - buffer.append( this.key.get( i ) + " : " + get(i) + "\n" ); + buffer.append( this.key.get( i ) + " : " + get(i) + ", " ); } return buffer.toString(); } @@ -110,6 +110,10 @@ TupleKey getKey() { return this.key; } + + public FactHandle[] getFactHandles() { + return this.key.getFactHandles(); + } /** * Determine if this tuple depends upon a specified object. @@ -138,6 +142,9 @@ */ public Object get(int col) { FactHandle handle = this.key.get( col ); + if ( handle == null) { + return null; + } return get( handle ); } @@ -163,19 +170,4 @@ public WorkingMemory getWorkingMemory() { return this.workingMemory; } - - public long getMostRecentFactTimeStamp() { - if ( this.mostRecentFact == null ) { - this.mostRecentFact = this.key.getMostRecentFact(); - } - return this.mostRecentFact.getRecency(); - } - - public long getLeastRecentFactTimeStamp() { - if ( this.leastRecentFact == null ) { - this.leastRecentFact = this.key.getLeastRecentFact(); - } - return this.leastRecentFact.getRecency(); - } - } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/RuleBaseImpl.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/RuleBaseImpl.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/RuleBaseImpl.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -107,6 +107,14 @@ // ------------------------------------------------------------ // Constructors // ------------------------------------------------------------ + + public RuleBaseImpl(ConflictResolver conflictResolver){ + this( conflictResolver, + new DefaultFactHandleFactory(), + new HashSet(), + new HashMap(), + new RuleBaseContext() ); + } /** * Construct. @@ -183,6 +191,10 @@ public FactHandleFactory getFactHandleFactory() { return this.factHandleFactory; } + + public FactHandleFactory newFactHandleFactory() { + return this.factHandleFactory.newInstance(); + } /** * @see RuleBase Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/TupleKey.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/TupleKey.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/TupleKey.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -128,46 +128,10 @@ public boolean containsAll(TupleKey that) { return this.handles.containsAll( that.handles ); } - - public FactHandleImpl getMostRecentFact() { - FactHandleImpl mostRecent = null; - long currentRecency = Long.MIN_VALUE; - FactHandleImpl eachHandle; - long recency; - - for ( int i = this.handles.size() - 1; i >= 0; i-- ) { - eachHandle = (FactHandleImpl) this.handles.get( i ); - if ( eachHandle != null ) { - recency = eachHandle.getRecency(); - if ( recency > currentRecency ) { - currentRecency = recency; - mostRecent = eachHandle; - } - } - } - - return mostRecent; + + FactHandle[] getFactHandles() { + return this.handles.getHandles(); } - - public FactHandleImpl getLeastRecentFact() { - FactHandleImpl leastRecent = null; - long currentRecency = Long.MAX_VALUE; - FactHandleImpl eachHandle; - long recency; - - for ( int i = this.handles.size() - 1; i >= 0; i-- ) { - eachHandle = (FactHandleImpl) this.handles.get( i ); - if ( eachHandle != null ) { - recency = eachHandle.getRecency(); - if ( recency < currentRecency ) { - currentRecency = recency; - leastRecent = eachHandle; - } - } - } - - return leastRecent; - } public int size() { return this.handles.size(); @@ -196,4 +160,5 @@ public int hashCode() { return this.handles.hashCode(); } + } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/WorkingMemoryImpl.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/WorkingMemoryImpl.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/reteoo/WorkingMemoryImpl.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -122,12 +122,16 @@ /** The <code>RuleBase</code> with which this memory is associated. */ private final RuleBaseImpl ruleBase; + + private final FactHandleFactory handleFactory; /** Rule-firing agenda. */ private final Agenda agenda; /** Flag to determine if a rule is currently being fired. */ private boolean firing; + + private long propagationIdCounter; // ------------------------------------------------------------ // Constructors @@ -143,6 +147,7 @@ this.ruleBase = ruleBase; this.agenda = new Agenda( this, ruleBase.getConflictResolver() ); + this.handleFactory = this.ruleBase.newFactHandleFactory(); } // ------------------------------------------------------------ @@ -192,10 +197,10 @@ */ FactHandle newFactHandle() { if ( !this.factHandlePool.isEmpty() ) { - return this.ruleBase.getFactHandleFactory().newFactHandle( this.factHandlePool.pop() ); + return this.handleFactory.newFactHandle( this.factHandlePool.pop() ); } - return this.ruleBase.getFactHandleFactory().newFactHandle(); + return this.handleFactory.newFactHandle(); } /** @@ -472,7 +477,8 @@ handles.add( handle ); } - PropagationContext propagationContext = new PropagationContextImpl( PropagationContext.ASSERTION, + PropagationContext propagationContext = new PropagationContextImpl( ++this.propagationIdCounter, + PropagationContext.ASSERTION, rule, activation ); @@ -585,7 +591,8 @@ removePropertyChangeListener( handle ); PropagationContext propagationContext = - new PropagationContextImpl( PropagationContext.RETRACTION, + new PropagationContextImpl( ++this.propagationIdCounter, + PropagationContext.RETRACTION, rule, activation ); @@ -636,10 +643,12 @@ Rule rule, Activation activation) throws FactException { Object originalObject = removeObject( handle ); - + if ( originalObject == null ) { throw new NoSuchFactObjectException( handle ); } + + this.handleFactory.increaseFactHandleRecency( handle ); putObject( handle, object ); @@ -652,7 +661,8 @@ handle ); } - PropagationContext propagationContext = new PropagationContextImpl( PropagationContext.MODIFICATION, + PropagationContext propagationContext = new PropagationContextImpl( ++this.propagationIdCounter, + PropagationContext.MODIFICATION, rule, activation ); Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/DefaultKnowledgeHelper.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/DefaultKnowledgeHelper.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/DefaultKnowledgeHelper.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -88,10 +88,12 @@ } public void retractObject(Object object) throws FactException { - FactHandle handle = this.tuple.getFactHandleForObject( object ); - + retractObject( this.tuple.getFactHandleForObject( object ) ); + } + + public void retractObject(FactHandle handle) throws FactException { this.tuple.getWorkingMemory().retractObject( handle ); - } + } public String getRuleName() { return this.rule.getName(); Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/KnowledgeHelper.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/KnowledgeHelper.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/KnowledgeHelper.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -125,6 +125,8 @@ * Wraps and returns any exception that may occur. */ void retractObject(Object object) throws FactException; + + void retractObject(FactHandle handle) throws FactException; /** * @return - The rule name Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/PropagationContext.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/PropagationContext.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/PropagationContext.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -8,10 +8,12 @@ public static final int RETRACTION = 1; public static final int MODIFICATION = 2; - public abstract Rule getRuleOrigin(); + public long getPropagationNumber(); + + public Rule getRuleOrigin(); - public abstract Activation getActivationOrigin(); + public Activation getActivationOrigin(); - public abstract int getType(); + public int getType(); } \ No newline at end of file Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/Tuple.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/Tuple.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/spi/Tuple.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -85,6 +85,8 @@ FactHandle getFactHandleForObject(Object object); FactHandle getFactHandleForDeclaration(Declaration declaration); + + FactHandle[] getFactHandles(); /** * Returns a reference to the <code>WorkingMemory</code> associated with @@ -94,9 +96,5 @@ */ WorkingMemory getWorkingMemory(); - long getMostRecentFactTimeStamp(); - - long getLeastRecentFactTimeStamp(); - // long getConditionTimeStamp(int i); } Modified: trunk/labs/jbossrules/drools-core/src/main/java/org/drools/visualize/ReteooLayout.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/main/java/org/drools/visualize/ReteooLayout.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/main/java/org/drools/visualize/ReteooLayout.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -20,106 +20,110 @@ import edu.uci.ics.jung.visualization.VertexLocationFunction; public class ReteooLayout extends AbstractLayout { - - public final static String COORDS = "drools.ReteooLayout.coords"; - - private static final int COLUMN_SPACE = 20; - private static final int ROW_HEIGHT_MULTIPLIER = 3; - - private RowList rowList; - - private VertexFunctions vertexFunctions; - private int columnWidth; - private int rowHeight; - - public ReteooLayout(Graph g, VertexFunctions vertexFunctions, RowList rowList) { + + public final static String COORDS = "drools.ReteooLayout.coords"; + + private static final int COLUMN_SPACE = 20; + private static final int ROW_HEIGHT_MULTIPLIER = 3; + + private RowList rowList; + + private VertexFunctions vertexFunctions; + private int columnWidth; + private int rowHeight; + + public ReteooLayout(Graph g, + VertexFunctions vertexFunctions, + RowList rowList) { super( g ); this.vertexFunctions = vertexFunctions; - this.rowList = rowList; + this.rowList = rowList; computeSize(); } - + public VertexFunctions getVertexFunctions() { return this.vertexFunctions; } - + public int getColumnWidth() { return columnWidth; } - + public int getRowHeight() { return rowHeight; } - + public int getPreferredWidth() { return rowList.getWidth() * columnWidth; } - + public int getPreferredHeight() { return rowList.getDepth() * getRowHeight() * ROW_HEIGHT_MULTIPLIER; } protected void computeSize() { Set vertices = getGraph().getVertices(); - - for ( Iterator vertexIter = vertices.iterator() ; vertexIter.hasNext() ; ) { - Vertex vertex = (Vertex) vertexIter.next(); - + + for ( Iterator vertexIter = vertices.iterator(); vertexIter.hasNext(); ) { + Vertex vertex = (Vertex) vertexIter.next(); + int width = vertexFunctions.getShapeDimension( vertex ).width; int height = vertexFunctions.getShapeDimension( vertex ).height; - + if ( width > columnWidth ) { columnWidth = width; } - + if ( height > rowHeight ) { - rowHeight = height; + rowHeight = height; } } - + columnWidth = columnWidth + COLUMN_SPACE; } - protected void initialize_local_vertex( Vertex vertex ) { + protected void initialize_local_vertex(Vertex vertex) { int row = rowList.getRow( vertex ); int col = rowList.getColumn( vertex ); - - int widthPx = this.getCurrentSize().width; + + int widthPx = this.getCurrentSize().width; int heightPx = this.getCurrentSize().height; - + int rowWidth = rowList.getWidth( row ); - + int columnWidthPx = getColumnWidth(); int rowHeightPx = getRowHeight(); - + Coordinates coords = new Coordinates(); - - double x = ( col * columnWidthPx ); - double y = ( row * ( rowHeightPx * ROW_HEIGHT_MULTIPLIER ) ); - - x = x + ( widthPx / 2 ) - ( ( rowWidth - 1 ) * ( columnWidthPx / 2 ) ); - y = y + ( rowHeightPx/2 ) + 3; - + + double x = (col * columnWidthPx); + double y = (row * (rowHeightPx * ROW_HEIGHT_MULTIPLIER)); + + x = x + (widthPx / 2) - ((rowWidth - 1) * (columnWidthPx / 2)); + y = y + (rowHeightPx / 2) + 3; + coords.setX( x ); coords.setY( y ); - + //System.err.println( vertex + " -> " + coords.getX() + "," + coords.getY() + " / " + row + "," + col ); - - vertex.setUserDatum( COORDS, coords, new UserDataContainer.CopyAction.Shared() ); + + vertex.setUserDatum( COORDS, + coords, + new UserDataContainer.CopyAction.Shared() ); } - + public double getX(Vertex vertex) { - System.err.println( "getX" ); + //System.err.println( "getX" ); return getCoordinates( vertex ).getX(); } - + public double getY(Vertex vertex) { - System.err.println( "getY" ); + //System.err.println( "getY" ); return getCoordinates( vertex ).getY(); } - + public Coordinates getCoordinates(ArchetypeVertex vertex) { - System.err.println( vertex + " --> " + (Coordinates) vertex.getUserDatum( COORDS ) ); + //System.err.println( vertex + " --> " + (Coordinates) vertex.getUserDatum( COORDS ) ); return (Coordinates) vertex.getUserDatum( COORDS ); } Modified: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/MockFactHandle.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/test/java/org/drools/MockFactHandle.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/test/java/org/drools/MockFactHandle.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -73,4 +73,9 @@ public long getId() { return this.id; } + + public long getRecency() { + // TODO Auto-generated method stub + return 0; + } } Modified: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/examples/manners/MannersTest.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/test/java/org/drools/examples/manners/MannersTest.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/test/java/org/drools/examples/manners/MannersTest.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -26,6 +26,9 @@ import org.drools.RuleIntegrationException; import org.drools.RuleSetIntegrationException; import org.drools.WorkingMemory; +import org.drools.conflict.CompositeConflictResolver; +import org.drools.conflict.RecencyConflictResolver; +import org.drools.conflict.SalienceConflictResolver; import org.drools.event.ActivationCancelledEvent; import org.drools.event.ActivationCreatedEvent; import org.drools.event.BeforeActivationFiredEvent; @@ -51,6 +54,7 @@ import org.drools.spi.ClassFieldExtractor; import org.drools.spi.ClassObjectType; import org.drools.spi.BaseEvaluator; +import org.drools.spi.ConflictResolver; import org.drools.spi.Consequence; import org.drools.spi.ConsequenceException; import org.drools.spi.Constraint; @@ -117,7 +121,7 @@ } - public void test1() throws DuplicateRuleNameException, + public void testManners() throws DuplicateRuleNameException, InvalidRuleException, IntrospectionException, RuleIntegrationException, @@ -135,11 +139,10 @@ ruleSet.addRule( getContinueProcessing() ); ruleSet.addRule( getAllDone() ); - final RuleBaseImpl ruleBase = new RuleBaseImpl(); + final RuleBaseImpl ruleBase = new RuleBaseImpl( new CompositeConflictResolver(new ConflictResolver[]{SalienceConflictResolver.getInstance(), RecencyConflictResolver.getInstance() } ) ); ruleBase.addRuleSet( ruleSet ); -// final ReteooJungViewer viewer = new ReteooJungViewer(ruleBase); -// +// final ReteooJungViewer viewer = new ReteooJungViewer(ruleBase); // javax.swing.SwingUtilities.invokeLater(new Runnable() { // public void run() { // viewer.showGUI(); @@ -148,29 +151,31 @@ WorkingMemory workingMemory = ruleBase.newWorkingMemory(); - InputStream is = getClass().getResourceAsStream( "/manners16.dat" ); + InputStream is = getClass().getResourceAsStream( "/manners8.dat" ); List list = getInputObjects( is ); for ( Iterator it = list.iterator(); it.hasNext(); ) { - FactHandle handle = workingMemory.assertObject( it.next() ); + Object object = it.next(); + System.err.println( object ); + workingMemory.assertObject( object ); } - workingMemory.addEventListener( new DebugWorkingMemoryEventListener() ); + //workingMemory.addEventListener( new DebugWorkingMemoryEventListener() ); -// workingMemory.addEventListener( new DebugAgendaEventListener() ); + //workingMemory.addEventListener( new DebugAgendaEventListener() ); - workingMemory.addEventListener( new DefaultAgendaEventListener() { - public void activationCreated(ActivationCreatedEvent event) { - System.err.println( event ); - } - - public void activationCancelled(ActivationCancelledEvent event) { - System.err.println( event ); - } - - public void beforeActivationFired(BeforeActivationFiredEvent event) { - System.err.println( event ); - } - } ); +// workingMemory.addEventListener( new DefaultAgendaEventListener() { +// public void activationCreated(ActivationCreatedEvent event) { +// System.err.println( event ); +// } +// +// public void activationCancelled(ActivationCancelledEvent event) { +// System.err.println( event ); +// } +// +// public void beforeActivationFired(BeforeActivationFiredEvent event) { +// System.err.println( event ); +// } +// } ); workingMemory.assertObject( new Count( 1 ) ); // @@ -301,7 +306,7 @@ context.setState( Context.ASSIGN_SEATS ); drools.modifyObject( tuple.getFactHandleForDeclaration( contextDeclaration ), context ); - //System.out.println( "assign first seat : " + seating + " : " + path ); + System.out.println( "assign first seat : " + seating + " : " + path ); } catch ( Exception e ) { @@ -444,7 +449,7 @@ leftGuestColumn.addConstraint( getBoundVariableConstraint( leftGuestColumn, "sex", rightGuestSexDeclaration, - objectEqualEvaluator ) ); + objectNotEqualEvaluator ) ); leftGuestColumn.addConstraint( getBoundVariableConstraint( rightGuestColumn, "hobby", @@ -559,17 +564,27 @@ rightGuestHobby ); drools.assertObject( chosen ); - count.setValue( count.getValue() + 1 ); + +// if ( count.getValue() == 5 ) { +// drools.retractObject( tuple.getFactHandleForDeclaration( countDeclaration ) ); +// } else { +// drools.modifyObject( tuple.getFactHandleForDeclaration( countDeclaration ), +// count ); +// } + drools.modifyObject( tuple.getFactHandleForDeclaration( countDeclaration ), - count ); + count ); + context.setState( Context.MAKE_PATH ); drools.modifyObject( tuple.getFactHandleForDeclaration( contextDeclaration ), context ); System.err.println( "find seating : " + seating + " : " + path + " : " + chosen ); + + } catch ( Exception e ) { throw new ConsequenceException( e ); @@ -794,6 +809,10 @@ Seating seating = (Seating) tuple.get( seatingDeclaration ); seating.setPathDone( true ); + + if ( seating.getId() == 6 ) { + System.out.println("pause"); + } drools.modifyObject( tuple.getFactHandleForDeclaration( seatingDeclaration ), seating ); @@ -840,7 +859,8 @@ // context : Context( state == Context.CHECK_DONE ) // ----------- Column contextColumn = new Column( 0, - contextType ); + contextType, + "context" ); contextColumn.addConstraint( getLiteralConstraint( contextColumn, "state", @@ -893,7 +913,7 @@ drools.modifyObject( tuple.getFactHandleForDeclaration( contextDeclaration ), context ); - //System.out.println( "are we done yet" ); + System.err.println( "We Are Done!!!" ); } catch ( Exception e ) { throw new ConsequenceException( e ); @@ -974,12 +994,16 @@ } /** + * <pre> + * rule all_done() { + * Context context; + * when { + * context : Context( state == Context.PRINT_RESULTS ) + * } then { + * } + * } + * </pre> * - * rule all_done() { Context context; when { context : Context( state == - * Context.PRINT_RESULTS ) } then { - * } } - * - * * @return * @throws IntrospectionException * @throws InvalidRuleException @@ -1009,7 +1033,7 @@ public void invoke(Activation activation) throws ConsequenceException { try { - System.out.println( "all done" ); + System.err.println( "all done" ); } catch ( Exception e ) { throw new ConsequenceException( e ); Modified: trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/AgendaTest.java =================================================================== --- trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/AgendaTest.java 2006-01-18 04:44:09 UTC (rev 2128) +++ trunk/labs/jbossrules/drools-core/src/test/java/org/drools/reteoo/AgendaTest.java 2006-01-18 05:38:22 UTC (rev 2129) @@ -59,7 +59,8 @@ */ public class AgendaTest extends DroolsTestCase { - PropagationContext initContext = new PropagationContextImpl( PropagationContext.ASSERTION, + PropagationContext initContext = new PropagationContextImpl( 0, + PropagationContext.ASSERTION, ... [truncated message content] |
From: <jbo...@li...> - 2006-01-17 21:17:22
|
Author: ste...@jb... Date: 2006-01-17 16:17:10 -0500 (Tue, 17 Jan 2006) New Revision: 2126 Modified: trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/LineItem.hbm.xml trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/Order.hbm.xml trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/Product.hbm.xml Log: explicitly use increment generator Modified: trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/LineItem.hbm.xml =================================================================== --- trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/LineItem.hbm.xml 2006-01-17 17:04:06 UTC (rev 2125) +++ trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/LineItem.hbm.xml 2006-01-17 21:17:10 UTC (rev 2126) @@ -7,7 +7,7 @@ <class name="LineItem" table="ORDER_ITEM" lazy="true" > <id name="id" column="ITEM_ID" > - <generator class="native"/> + <generator class="increment"/> </id> <many-to-one name="order" class="Order" column="ORDER_ID" cascade="none"/> Modified: trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/Order.hbm.xml =================================================================== --- trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/Order.hbm.xml 2006-01-17 17:04:06 UTC (rev 2125) +++ trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/Order.hbm.xml 2006-01-17 21:17:10 UTC (rev 2126) @@ -7,7 +7,7 @@ <class name="Order" table="T_ORDER" lazy="true" > <id name="id" column="ORDER_ID" type="long"> - <generator class="native"/> + <generator class="increment"/> </id> <property name="customer" column="CUST" type="string"/> Modified: trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/Product.hbm.xml =================================================================== --- trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/Product.hbm.xml 2006-01-17 17:04:06 UTC (rev 2125) +++ trunk/labs/hibernate/jdbc-redesign/test/org/hibernate/jdbc3/domain/Product.hbm.xml 2006-01-17 21:17:10 UTC (rev 2126) @@ -7,7 +7,7 @@ <class name="Product" table="PRODUCT" lazy="true"> <id name="id" column="PROD_ID" > - <generator class="native"/> + <generator class="increment"/> </id> <property name="description" type="string"/> |
Author: rl...@jb... Date: 2006-01-17 12:04:06 -0500 (Tue, 17 Jan 2006) New Revision: 2125 Added: trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.classpath trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.project trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.wtpmodules trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/pom.xml trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/org/ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/org/apache/ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/org/apache/maven/ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/org/apache/maven/plugin/ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/org/apache/maven/plugin/builddist/ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/org/apache/maven/plugin/builddist/BuildDistMojo.java Log: [JBBUILD-247] - initial entry of plugin for building a distribution Added: trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.classpath =================================================================== --- trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.classpath 2006-01-17 16:25:28 UTC (rev 2124) +++ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.classpath 2006-01-17 17:04:06 UTC (rev 2125) @@ -0,0 +1,25 @@ +<classpath> + <classpathentry kind="src" path="src/main/java"/> + <classpathentry kind="src" path="src/main/resources"/> + <classpathentry kind="output" path="target/classes"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-model/2.0/maven-model-2.0.jar"/> + <classpathentry kind="var" path="M2_REPO/oro/oro/2.0.7/oro-2.0.7.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0.jar"/> + <classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/> + <classpathentry kind="var" path="M2_REPO/doxia/doxia-core/1.0-alpha-4/doxia-core-1.0-alpha-4.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-validator/commons-validator/1.1.4/commons-validator-1.1.4.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact-manager/2.0/maven-artifact-manager-2.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/reporting/maven-reporting-api/2.0/maven-reporting-api-2.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact/2.0/maven-artifact-2.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.jar"/> + <classpathentry kind="var" path="M2_REPO/doxia/doxia-sink-api/1.0-alpha-4/doxia-sink-api-1.0-alpha-4.jar"/> + <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-archiver/1.0-alpha-4-SNAPSHOT/plexus-archiver-1.0-alpha-4-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/reporting/maven-reporting-impl/2.0/maven-reporting-impl-2.0.jar"/> +</classpath> \ No newline at end of file Added: trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.project =================================================================== --- trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.project 2006-01-17 16:25:28 UTC (rev 2124) +++ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.project 2006-01-17 17:04:06 UTC (rev 2125) @@ -0,0 +1,28 @@ +<projectDescription> + <name>maven-builddist-plugin</name> + <comment>Maven plugin parent</comment> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.wst.common.modulecore.ComponentStructuralBuilder</name> + <arguments/> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments/> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + </natures> +</projectDescription> \ No newline at end of file Added: trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.wtpmodules =================================================================== --- trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.wtpmodules 2006-01-17 16:25:28 UTC (rev 2124) +++ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/.wtpmodules 2006-01-17 17:04:06 UTC (rev 2125) @@ -0,0 +1,9 @@ +<project-modules id="moduleCoreId"> + <wb-module deploy-name="maven-builddist-plugin"> + <module-type module-type-id="jst.utility"> + <property name="java-output-path" value="/target/classes"/> + </module-type> + <wb-resource deploy-path="/" source-path="src/main/java"/> + <wb-resource deploy-path="/" source-path="src/main/resources"/> + </wb-module> +</project-modules> \ No newline at end of file Added: trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/pom.xml =================================================================== --- trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/pom.xml 2006-01-17 16:25:28 UTC (rev 2124) +++ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/pom.xml 2006-01-17 17:04:06 UTC (rev 2125) @@ -0,0 +1,49 @@ +<project> + <parent> + <artifactId>maven-plugin-parent</artifactId> + <groupId>org.apache.maven.plugins</groupId> + <version>2.0</version> + <!-- version>2.0.1-SNAPSHOT</version --> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>maven-builddist-plugin</artifactId> + <packaging>maven-plugin</packaging> + <name>Maven Builddist Plugin</name> + <version>1.0</version> + + <build> + + </build> + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-archiver</artifactId> + <version>1.0-alpha-4-SNAPSHOT</version> + <exclusions> + <exclusion> + <artifactId>plexus-utils</artifactId> + <groupId>plexus</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-artifact</artifactId> + <version>2.0</version> + </dependency> + + <dependency> + <groupId>org.apache.maven.reporting</groupId> + <artifactId>maven-reporting-impl</artifactId> + <version>2.0</version> + </dependency> + </dependencies> +</project> Added: trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/org/apache/maven/plugin/builddist/BuildDistMojo.java =================================================================== --- trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/org/apache/maven/plugin/builddist/BuildDistMojo.java 2006-01-17 16:25:28 UTC (rev 2124) +++ trunk/labs/jbossbuild/projects/maven-plugins/maven-builddist-plugin/src/main/java/org/apache/maven/plugin/builddist/BuildDistMojo.java 2006-01-17 17:04:06 UTC (rev 2125) @@ -0,0 +1,15 @@ +package org.apache.maven.plugin.builddist; + +/** + * Assemble an application bundle or distribution from an assembly descriptor. + * + * @version $Id: BuildDistMojoe.java + * @goal builddist + * @requiresDependencyResolution test + * @execute phase="package" + * @aggregator + */ +public class BuildDistMojo + extends AbstractMojo +{ +} |