JBoss JBPM SVN: r4724 - in jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs: jBPM3-JDK1.4.2 and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-05 08:56:15 -0400 (Tue, 05 May 2009)
New Revision: 4724
Added:
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.4.2/
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.4.2/config.xml
Log:
[JBPM-2205] create individual jdk 1.4.2 job
Added: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.4.2/config.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.4.2/config.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.4.2/config.xml 2009-05-05 12:56:15 UTC (rev 4724)
@@ -0,0 +1,76 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+ <actions class="vector" />
+ <description>Build and test @version.id@ on JDK1.4.2</description>
+ <logRotator>
+ <daysToKeep>60</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ </logRotator>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <hudson.model.ParametersDefinitionProperty>
+ <parameterDefinitions>
+ <hudson.model.StringParameterDefinition>
+ <name>CONTAINER</name>
+ <optional>false</optional>
+ <defaultValue>jboss405</defaultValue>
+ </hudson.model.StringParameterDefinition>
+ <hudson.model.StringParameterDefinition>
+ <name>DATABASE</name>
+ <optional>false</optional>
+ <defaultValue>hsqldb</defaultValue>
+ </hudson.model.StringParameterDefinition>
+ </parameterDefinitions>
+ </hudson.model.ParametersDefinitionProperty>
+ <hudson.security.AuthorizationMatrixProperty />
+ </properties>
+ <scm class="hudson.scm.SubversionSCM">
+ <locations>
+ <hudson.scm.SubversionSCM_-ModuleLocation>
+ <remote>@hudson.jbpm.url@</remote>
+ <local>jbpm</local>
+ </hudson.scm.SubversionSCM_-ModuleLocation>
+ </locations>
+ <useUpdate>true</useUpdate>
+ <browser class="hudson.scm.browsers.FishEyeSVN">
+ <url>http://fisheye.jboss.com/browse/JbpmSvn/</url>
+ <rootModule></rootModule>
+ </browser>
+ </scm>
+ <canRoam>true</canRoam>
+ <disabled>false</disabled>
+ <jdk>jdk1.4</jdk>
+ <triggers class="vector" />
+ <builders>
+ <hudson.tasks.Shell>
+ <command>
+WORKSPACE=`pwd`
+JBPMDIR=$WORKSPACE/jbpm
+
+export HUDSON_BASE=(a)hudson.base@
+export JBPM_VERSION=(a)version.id@
+export JBOSS_SERVER=(a)jboss.server.instance@
+export JBOSS_BINDADDR=(a)jboss.bind.address@
+
+# copy the maven profile
+cp @hudson.maven.profile@ $JBPMDIR/profiles.xml
+
+#
+# call command.sh
+#
+/bin/sh $JBPMDIR/hudson/hudson-home/command.sh
+ </command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers>
+ <hudson.tasks.junit.JUnitResultArchiver>
+ <testResults>jbpm/modules/**/target/surefire-reports/TEST-*.xml</testResults>
+ </hudson.tasks.junit.JUnitResultArchiver>
+ <hudson.tasks.Mailer>
+ <recipients></recipients>
+ <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
+ <sendToIndividuals>true</sendToIndividuals>
+ </hudson.tasks.Mailer>
+ </publishers>
+ <buildWrappers />
+</project>
15 years, 1 month
JBoss JBPM SVN: r4723 - in jbpm3/branches/jbpm-3.2.5.SP: hudson and 6 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-05 08:53:05 -0400 (Tue, 05 May 2009)
New Revision: 4723
Modified:
jbpm3/branches/jbpm-3.2.5.SP/hudson/ant.properties.example
jbpm3/branches/jbpm-3.2.5.SP/hudson/build.xml
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Container-Matrix/config.xml
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Database-Matrix/config.xml
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.5/config.xml
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.6/config.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/pom.xml
Log:
[JBPM-2205] incorporate jdk 1.4.2 in hudson matrices
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/ant.properties.example
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/ant.properties.example 2009-05-04 21:19:53 UTC (rev 4722)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/ant.properties.example 2009-05-05 12:53:05 UTC (rev 4723)
@@ -20,11 +20,10 @@
hudson.password=changeme
hudson.maven.path=/usr/java/apache-maven-2.0.9
+hudson.maven.profile=$JBPMDIR/hudson/profiles.xml.local.qa
hudson.root=/home/hudson/workspace
-hudson.maven.profile=$JBPMDIR/hudson/profiles.xml.local.qa
-
hudson.host=jbpm.dyndns.org
hudson.admin.port=8150
hudson.http.port=8180
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/build.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/build.xml 2009-05-04 21:19:53 UTC (rev 4722)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/build.xml 2009-05-05 12:53:05 UTC (rev 4723)
@@ -61,18 +61,18 @@
<mkdir dir="${thirdparty.dir}"/>
<available property="apache.tomcat.available" file="${thirdparty.dir}/apache-tomcat.zip"/>
<available property="sun.hudson.available" file="${thirdparty.dir}/hudson.war"/>
- <available property="jboss422.available" file="${thirdparty.dir}/jboss-4.2.2.GA.zip"/>
+ <available property="jboss405.available" file="${thirdparty.dir}/jboss-4.0.5.GA.zip"/>
<available property="jboss423.available" file="${thirdparty.dir}/jboss-4.2.3.GA.zip"/>
- <available property="jboss500.available" file="${thirdparty.dir}/jboss-5.0.0.GA.zip"/>
+ <available property="jboss501.available" file="${thirdparty.dir}/jboss-5.0.1.GA.zip"/>
</target>
<!--
Get thirdparty dependencies
-->
- <target name="thirdparty" depends="init-thirdparty,get-tomcat,get-hudson,get-jboss422,get-jboss423,get-jboss500">
- <copy todir="${hudson.base}/jboss" file="${thirdparty.dir}/jboss-4.2.2.GA.zip"/>
+ <target name="thirdparty" depends="init-thirdparty,get-tomcat,get-hudson,get-jboss405,get-jboss423,get-jboss501">
+ <copy todir="${hudson.base}/jboss" file="${thirdparty.dir}/jboss-4.0.5.GA.zip"/>
<copy todir="${hudson.base}/jboss" file="${thirdparty.dir}/jboss-4.2.3.GA.zip"/>
- <copy todir="${hudson.base}/jboss" file="${thirdparty.dir}/jboss-5.0.0.GA.zip"/>
+ <copy todir="${hudson.base}/jboss" file="${thirdparty.dir}/jboss-5.0.1.GA.zip"/>
</target>
<target name="get-tomcat" depends="init-thirdparty" unless="apache.tomcat.available">
<get src="${jboss.repository}/apache-tomcat/${apache-tomcat}/lib/apache-tomcat.zip" dest="${thirdparty.dir}/apache-tomcat.zip" usetimestamp="true" verbose="true"/>
@@ -80,17 +80,17 @@
<target name="get-hudson" depends="init-thirdparty" unless="sun.hudson.available">
<get src="https://hudson.dev.java.net/files/documents/${sun-hudson}/hudson.war" dest="${thirdparty.dir}/hudson.war" usetimestamp="true" verbose="true"/>
</target>
- <target name="get-jboss422" depends="init-thirdparty" unless="jboss422.available">
- <property name="hudson.jboss422.zip" value="http://downloads.sourceforge.net/jboss/jboss-4.2.2.GA.zip"/>
- <get src="${hudson.jboss422.zip}" dest="${thirdparty.dir}/jboss-4.2.2.GA.zip" usetimestamp="true" verbose="true"/>
+ <target name="get-jboss405" depends="init-thirdparty" unless="jboss405.available">
+ <property name="hudson.jboss422.zip" value="http://downloads.sourceforge.net/jboss/jboss-4.0.5.GA.zip"/>
+ <get src="${hudson.jboss422.zip}" dest="${thirdparty.dir}/jboss-4.0.5.GA.zip" usetimestamp="true" verbose="true"/>
</target>
<target name="get-jboss423" depends="init-thirdparty" unless="jboss423.available">
<property name="hudson.jboss423.zip" value="http://downloads.sourceforge.net/jboss/jboss-4.2.3.GA.zip"/>
<get src="${hudson.jboss423.zip}" dest="${thirdparty.dir}/jboss-4.2.3.GA.zip" usetimestamp="true" verbose="true"/>
</target>
- <target name="get-jboss500" depends="init-thirdparty" unless="jboss500.available">
- <property name="hudson.jboss500.zip" value="http://downloads.sourceforge.net/jboss/jboss-5.0.0.GA.zip"/>
- <get src="${hudson.jboss500.zip}" dest="${thirdparty.dir}/jboss-5.0.0.GA.zip" usetimestamp="true" verbose="true"/>
+ <target name="get-jboss501" depends="init-thirdparty" unless="jboss501.available">
+ <property name="hudson.jboss500.zip" value="http://downloads.sourceforge.net/jboss/jboss-5.0.1.GA.zip"/>
+ <get src="${hudson.jboss500.zip}" dest="${thirdparty.dir}/jboss-5.0.1.GA.zip" usetimestamp="true" verbose="true"/>
</target>
<!--
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh 2009-05-04 21:19:53 UTC (rev 4722)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh 2009-05-05 12:53:05 UTC (rev 4723)
@@ -23,6 +23,19 @@
;;
esac
+$JAVA_HOME/bin/java -version 2> tmp.ver
+JAVA_VERSION=`grep "java version" tmp.ver | awk '{ print substr($3, 2, length($3)-2); }'`
+JAVA_VERSION=`echo $JAVA_VERSION | awk '{ print substr($1, 1, 3); }' | sed -e 's;\.;0;g'`
+
+if [ $JAVA_VERSION -ge 1.5 ]
+then
+ JDK_HOME=$JAVA_HOME
+ JRE_HOME=$JAVA_HOME
+else
+ JDK_HOME=(a)java.home.jdk15@
+ JRE_HOME=$JAVA_HOME
+fi
+
#
# Unzip the JBoss build
#
@@ -35,7 +48,7 @@
#
# Build distro
#
-cd $JBPMDIR
+export JAVA_HOME=$JDK_HOME
MVN_CMD="mvn -U $ENVIRONMENT -Pdistro,soa clean install"
echo $MVN_CMD; $MVN_CMD; MVN_STATUS=$?
if [ $MVN_STATUS -ne 0 ]; then
@@ -57,7 +70,7 @@
# Deploy distro
#
AUTO_INSTALL=modules/distribution/target/resources/auto-install-template.xml; cat $AUTO_INSTALL;
-JAVA_CMD="java -jar $DISTRODIR/jbpm-installer-$JBPM_VERSION.jar $AUTO_INSTALL"
+JAVA_CMD="JDK_HOME/bin/java -jar $DISTRODIR/jbpm-installer-$JBPM_VERSION.jar $AUTO_INSTALL"
echo $JAVA_CMD; $JAVA_CMD
# FIXME: Autoinstall does not respect conditions
@@ -84,6 +97,7 @@
#
# Start JBoss AS
#
+export JAVA_HOME=$JRE_HOME
$JBPMDIR/hudson/jboss/bin/jboss.sh $JBOSS_HOME start $JBOSS_BINDADDR
# Was it successfully started?
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Container-Matrix/config.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Container-Matrix/config.xml 2009-05-04 21:19:53 UTC (rev 4722)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Container-Matrix/config.xml 2009-05-05 12:53:05 UTC (rev 4723)
@@ -35,7 +35,7 @@
<name>container</name>
<values>
<string>jboss423</string>
- <string>jboss500</string>
+ <string>jboss501</string>
</values>
</axis>
<axis>
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Database-Matrix/config.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Database-Matrix/config.xml 2009-05-04 21:19:53 UTC (rev 4722)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Database-Matrix/config.xml 2009-05-05 12:53:05 UTC (rev 4723)
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<matrix-project>
<actions class="java.util.concurrent.CopyOnWriteArrayList"/>
- <description>Build and test the @version.id@ Database Matrix on JBoss-4.2.2.GA</description>
+ <description>Build and test the @version.id@ Database Matrix on JBoss-4.0.5</description>
<logRotator>
<daysToKeep>60</daysToKeep>
<numToKeep>-1</numToKeep>
@@ -34,7 +34,7 @@
<axis>
<name>container</name>
<values>
- <string>jboss422</string>
+ <string>jboss405</string>
</values>
</axis>
<axis>
@@ -50,8 +50,8 @@
<axis>
<name>jdk</name>
<values>
+ <string>jdk1.4</string>
<string>jdk1.5</string>
- <string>jdk1.6</string>
</values>
</axis>
</axes>
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.5/config.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.5/config.xml 2009-05-04 21:19:53 UTC (rev 4722)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.5/config.xml 2009-05-05 12:53:05 UTC (rev 4723)
@@ -13,7 +13,7 @@
<hudson.model.StringParameterDefinition>
<name>CONTAINER</name>
<optional>false</optional>
- <defaultValue>jboss422</defaultValue>
+ <defaultValue>jboss423</defaultValue>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>DATABASE</name>
@@ -73,4 +73,4 @@
</hudson.tasks.Mailer>
</publishers>
<buildWrappers />
-</project>
\ No newline at end of file
+</project>
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.6/config.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.6/config.xml 2009-05-04 21:19:53 UTC (rev 4722)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.6/config.xml 2009-05-05 12:53:05 UTC (rev 4723)
@@ -13,7 +13,7 @@
<hudson.model.StringParameterDefinition>
<name>CONTAINER</name>
<optional>false</optional>
- <defaultValue>jboss422</defaultValue>
+ <defaultValue>jboss501</defaultValue>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>DATABASE</name>
@@ -73,4 +73,4 @@
</hudson.tasks.Mailer>
</publishers>
<buildWrappers />
-</project>
\ No newline at end of file
+</project>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml 2009-05-04 21:19:53 UTC (rev 4722)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml 2009-05-05 12:53:05 UTC (rev 4723)
@@ -210,9 +210,9 @@
<property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
<property name="database" value="${database}" />
<property name="jboss.home" value="${jboss.home}" />
- <property name="jboss422.home" value="${jboss422.home}" />
+ <property name="jboss405.home" value="${jboss405.home}" />
<property name="jboss423.home" value="${jboss423.home}" />
- <property name="jboss500.home" value="${jboss500.home}" />
+ <property name="jboss501.home" value="${jboss501.home}" />
<property name="jbpm.target.container" value="${jbpm.target.container}" />
<property name="product.name" value="${project.name}" />
<property name="product.short.name" value="${artifactId}" />
Modified: jbpm3/branches/jbpm-3.2.5.SP/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/pom.xml 2009-05-04 21:19:53 UTC (rev 4722)
+++ jbpm3/branches/jbpm-3.2.5.SP/pom.xml 2009-05-05 12:53:05 UTC (rev 4723)
@@ -293,11 +293,6 @@
<build>
<pluginManagement>
<plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>${jdocbook.version}</version>
- </plugin>
</plugins>
</pluginManagement>
<plugins>
15 years, 1 month
JBoss JBPM SVN: r4722 - jbpm4/branches/ainze/modules/test-base/src/main/java/org/jbpm/test.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-05-04 17:19:53 -0400 (Mon, 04 May 2009)
New Revision: 4722
Modified:
jbpm4/branches/ainze/modules/test-base/src/main/java/org/jbpm/test/Db.java
Log:
hack because of not fully initialized hibernate configurations
Modified: jbpm4/branches/ainze/modules/test-base/src/main/java/org/jbpm/test/Db.java
===================================================================
--- jbpm4/branches/ainze/modules/test-base/src/main/java/org/jbpm/test/Db.java 2009-05-04 21:01:08 UTC (rev 4721)
+++ jbpm4/branches/ainze/modules/test-base/src/main/java/org/jbpm/test/Db.java 2009-05-04 21:19:53 UTC (rev 4722)
@@ -78,6 +78,13 @@
List<String> dropForeignKeysSql = new ArrayList<String>();
List<String> createForeignKeysSql = new ArrayList<String>();
Iterator<Table> iter = configuration.getTableMappings();
+
+ //if no session-factory is build, the configuration is not fully initialized.
+ //Hence, the ForeignKey's won't have a referenced table. This is calculated on
+ //second pass.
+ configuration.buildMappings();
+
+
while (iter.hasNext()) {
Table table = (Table) iter.next();
if (table.isPhysicalTable()) {
15 years, 1 month
JBoss JBPM SVN: r4721 - in jbpm4/branches/ainze/modules: pvm/src/main/java/org/jbpm/pvm/internal/cfg and 5 other directories.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-05-04 17:01:08 -0400 (Mon, 04 May 2009)
New Revision: 4721
Added:
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/SpringContext.java
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SpringTransactionInterceptorBinding.java
Removed:
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/HibernateSessionManager.java
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringCommandService.java
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentContext.java
Modified:
jbpm4/branches/ainze/modules/api/src/main/java/org/jbpm/api/Configuration.java
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/CommandTransactionCallback.java
jbpm4/branches/ainze/modules/pvm/src/main/resources/jbpm.wire.bindings.xml
Log:
initial working release
Modified: jbpm4/branches/ainze/modules/api/src/main/java/org/jbpm/api/Configuration.java
===================================================================
--- jbpm4/branches/ainze/modules/api/src/main/java/org/jbpm/api/Configuration.java 2009-05-04 21:00:45 UTC (rev 4720)
+++ jbpm4/branches/ainze/modules/api/src/main/java/org/jbpm/api/Configuration.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -60,8 +60,8 @@
implementationClassNames = new HashMap<String, String>();
// null represents the default configuration (== the JbpmConfiguration)
implementationClassNames.put(null, "org.jbpm.pvm.internal.cfg.JbpmConfiguration");
+ implementationClassNames.put("spring-test", "org.jbpm.pvm.internal.cfg.SpringConfiguration");
// TODO
- // implementationClasses.put("spring", "org.jbpm.pvm.internal.cfg.SpringConfiguration");
// implementationClasses.put("mc", "org.jbpm.pvm.internal.cfg.McConfiguration");
// implementationClasses.put("programatic", "org.jbpm.pvm.internal.cfg.ProgramaticConfiguration");
}
Modified: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java 2009-05-04 21:00:45 UTC (rev 4720)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -21,85 +21,147 @@
*/
package org.jbpm.pvm.internal.cfg;
-import java.util.HashSet;
+import java.io.IOException;
import java.util.List;
-import java.util.Set;
+import org.jbpm.api.ProcessEngine;
+import org.jbpm.api.env.Context;
import org.jbpm.api.env.Environment;
import org.jbpm.api.env.EnvironmentFactory;
import org.jbpm.api.env.WireObject;
-import org.jbpm.pvm.internal.spring.SpringEnvironment;
-import org.jbpm.pvm.internal.util.ReflectUtil;
+import org.jbpm.pvm.internal.env.PvmEnvironment;
+import org.jbpm.pvm.internal.env.SpringContext;
+import org.jbpm.pvm.internal.wire.WireContext;
+import org.jbpm.pvm.internal.wire.WireDefinition;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.core.io.ClassPathResource;
-/** this environment factory will see only the singleton beans.
+/**
+ * this environment factory will see only the singleton beans.
*
- * The created {@link SpringEnvironment}s will see the prototype
- * beans and it will cache them.
- *
- * @author Tom Baeyens
+ * The created {@link SpringEnvironment}s will see the prototype beans and it
+ * will cache them.
+ *
+ * @author Andries Inze
*/
-public class SpringConfiguration implements EnvironmentFactory, ApplicationContextAware {
-
- // TODO pull up the common behaviour between this class and the SpringEnvironmentContext
-
- private static final long serialVersionUID = 1L;
-
- ApplicationContext applicationContext;
-
- public SpringEnvironment openEnvironment() {
- return new SpringEnvironment(this);
- }
+public class SpringConfiguration extends JbpmConfiguration implements
+ EnvironmentFactory, ProcessEngine, ApplicationContextAware {
- public boolean has(String key) {
- return applicationContext.isSingleton(key);
- }
+ private static final long serialVersionUID = 1L;
- public Object get(String key) {
- if (has(key)) {
- return applicationContext.getBean(key);
+ private ApplicationContext applicationContext;
+
+ private String jbpmConfigurationLocation;
+
+ /**
+ * Instantiates a new spring configuration.
+ */
+ public SpringConfiguration(String jbpmConfigurationLocation) {
+ try {
+ super.setInputStream(new ClassPathResource(
+ jbpmConfigurationLocation).getInputStream());
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
}
- return null;
- }
- public <T> T get(Class<T> type) {
- String name = ReflectUtil.getUnqualifiedClassName(type);
- name = name.substring(0, 1).toLowerCase() + name.substring(1);
- return (T) get(name);
- }
+ public SpringConfiguration() {
+ // By jbpmTestCase
+ }
- public Set<String> keys() {
- HashSet<String> keys = new HashSet<String>();
- for (String key : applicationContext.getBeanDefinitionNames()) {
- if (has(key)) {
- keys.add(key);
- }
+ @Override
+ public ProcessEngine buildProcessEngine() {
+ if (applicationContext == null) {
+ applicationContext = new ClassPathXmlApplicationContext(System
+ .getProperty("jbpm.test.cfg.applicationContext"));
+ }
+
+ return super.buildProcessEngine();
}
- return keys;
- }
-
- public ApplicationContext getApplicationContext() {
- return applicationContext;
- }
- public void setApplicationContext(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
+ /**
+ * {@inheritDoc)
-
- public void close() {
- }
+ */
+ @Override
+ public Environment openEnvironment(List<WireObject> txWireObjects) {
- public String getName() {
- return null;
- }
+ PvmEnvironment environment = new PvmEnvironment(this);
- public Object set(String key, Object value) {
- return null;
- }
+ // FIXME: All beneath should be a super call
- public Environment openEnvironment(List<WireObject> txWireObjects) {
- return null;
- }
+ // set the classloader
+ ClassLoader classLoader = processEngineWireContext.getClassLoader();
+ if (classLoader != null) {
+ environment.setClassLoader(classLoader);
+ }
+
+ // add the process-engine context
+ environment.addContext(new SpringContext(applicationContext));
+ environment.addContext(processEngineWireContext);
+
+ // add the transaction context
+ WireDefinition usedWireDefinition = transactionWireDefinition;
+ if (txWireObjects != null) {
+ usedWireDefinition = new WireDefinition(transactionWireDefinition,
+ txWireObjects);
+ }
+
+ WireContext transactionContext = new WireContext(usedWireDefinition,
+ Context.CONTEXTNAME_TRANSACTION, environment, true);
+ // add the environment block context to the environment
+ environment.addContext(transactionContext);
+
+ Environment.pushEnvironment(environment);
+ try {
+ // finish the creation of the environment wire context
+ transactionContext.create();
+
+ } catch (RuntimeException e) {
+ Environment.popEnvironment();
+ throw e;
+ }
+
+ // if all went well, return the created environment
+ return environment;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T get(Class<T> type) {
+ String[] names = applicationContext.getBeanNamesForType(type);
+ if (names.length == 1) {
+ return (T) applicationContext.getBean(names[0]);
+ }
+
+ return super.get(type);
+ }
+
+ @Override
+ public Object get(String key) {
+ if (applicationContext.containsBean(key)) {
+ return applicationContext.getBean(key);
+ }
+
+ return super.get(key);
+ }
+
+ /**
+ * {@inheritDoc)
+
+ */
+ public void setApplicationContext(ApplicationContext applicationContext) {
+ this.applicationContext = applicationContext;
+ }
+
+ /**
+ * Gets the application context.
+ *
+ * @return the application context
+ */
+ public ApplicationContext getApplicationContext() {
+ return applicationContext;
+ }
}
Added: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/SpringContext.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/SpringContext.java (rev 0)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/SpringContext.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -0,0 +1,83 @@
+/**
+ *
+ */
+package org.jbpm.pvm.internal.env;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jbpm.api.env.Context;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @author Andries Inze
+ *
+ */
+public class SpringContext implements Context {
+
+ private ApplicationContext applicationContext;
+
+ public SpringContext(ApplicationContext applicationContext) {
+ this.applicationContext = applicationContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jbpm.api.env.Context#get(java.lang.String)
+ */
+ public Object get(String key) {
+ if (applicationContext.containsBean(key)) {
+ return applicationContext.getBean(key);
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T get(Class<T> type) {
+ String[] names = applicationContext.getBeanNamesForType(type);
+ if (names.length == 1) {
+ return (T) applicationContext.getBean(names[0]);
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jbpm.api.env.Context#getName()
+ */
+ public String getName() {
+ return "SpringContext";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jbpm.api.env.Context#has(java.lang.String)
+ */
+ public boolean has(String key) {
+ return applicationContext.containsBean(key);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jbpm.api.env.Context#keys()
+ */
+ public Set<String> keys() {
+ Set set = new HashSet<String>(Arrays.asList(applicationContext.getBeanDefinitionNames()));
+ return set;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jbpm.api.env.Context#set(java.lang.String, java.lang.Object)
+ */
+ public Object set(String key, Object value) {
+ throw new RuntimeException("Can't add to the spring context");
+ }
+
+}
Property changes on: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/SpringContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/CommandTransactionCallback.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/CommandTransactionCallback.java 2009-05-04 21:00:45 UTC (rev 4720)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/CommandTransactionCallback.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -22,33 +22,34 @@
package org.jbpm.pvm.internal.spring;
import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.api.env.EnvironmentFactory;
+import org.jbpm.api.cmd.CommandService;
+import org.springframework.orm.hibernate3.HibernateTransactionManager;
+import org.springframework.orm.hibernate3.SessionFactoryUtils;
+import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
+import org.springframework.util.Assert;
/**
- * @author Tom Baeyens
+ * @author Andries Inze
*/
public class CommandTransactionCallback<T> implements TransactionCallback {
-
- Command<T> command;
- EnvironmentFactory environmentFactory;
-
- public CommandTransactionCallback(Command<T> command, EnvironmentFactory environmentFactory) {
- this.command = command;
- this.environmentFactory = environmentFactory;
- }
- public T doInTransaction(TransactionStatus status) {
- Environment environment = environmentFactory.openEnvironment();
- try {
- return command.execute(environment);
- } catch (Exception e) {
- throw new RuntimeException("ooops", e);
- } finally {
- environment.close();
+ private Command<T> command;
+ private CommandService commandService;
+ private PlatformTransactionManager manager;
+
+ public CommandTransactionCallback(Command<T> command,
+ CommandService commandService, PlatformTransactionManager platformTransactionManager) {
+ this.command = command;
+ this.commandService = commandService;
+ this.manager = platformTransactionManager;
}
- }
+ public T doInTransaction(TransactionStatus status) {
+ System.out.println("Running tx " + status);
+ ((HibernateTransactionManager) manager).getSessionFactory().getCurrentSession();
+ Assert.isTrue(SessionFactoryUtils.isSessionTransactional(((HibernateTransactionManager) manager).getSessionFactory().getCurrentSession(), ((HibernateTransactionManager) manager).getSessionFactory()));
+ return commandService.execute(command);
+ }
}
Deleted: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/HibernateSessionManager.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/HibernateSessionManager.java 2009-05-04 21:00:45 UTC (rev 4720)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/HibernateSessionManager.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.spring;
-
-import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
-
-/**
- * @author Tom Baeyens
- */
-public class HibernateSessionManager extends HibernateDaoSupport {
-}
Deleted: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringCommandService.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringCommandService.java 2009-05-04 21:00:45 UTC (rev 4720)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringCommandService.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.spring;
-
-import org.hibernate.Session;
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.cmd.CommandService;
-import org.jbpm.api.env.Environment;
-import org.jbpm.api.env.EnvironmentFactory;
-import org.springframework.orm.hibernate3.HibernateTransactionManager;
-import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
-import org.springframework.transaction.support.TransactionTemplate;
-
-
-/**
- * @author Tom Baeyens
- */
-public class SpringCommandService implements CommandService {
-
- TransactionTemplate transactionTemplate;
- EnvironmentFactory environmentFactory;
-
- public void setEnvironmentFactory(EnvironmentFactory environmentFactory) {
- this.environmentFactory = environmentFactory;
- }
-
- public void setTransactionManager(HibernateTransactionManager transactionManager) {
- this.transactionTemplate = new TransactionTemplate(transactionManager);
- }
-
- public <T> T execute(Command<T> command) {
- return (T) transactionTemplate.execute(
- new CommandTransactionCallback(command, environmentFactory)
- );
- }
-
-
-
-}
Deleted: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java 2009-05-04 21:00:45 UTC (rev 4720)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.spring;
-
-import org.jbpm.api.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.cfg.SpringConfiguration;
-import org.jbpm.pvm.internal.env.BasicEnvironment;
-import org.springframework.context.ApplicationContext;
-
-/** sees the prototype beans in the application context and
- * this environment will cache all the prototyped objects.
- *
- * @author Tom Baeyens
- */
-public class SpringEnvironment extends BasicEnvironment {
-
- private static final long serialVersionUID = 1L;
-
- protected ApplicationContext applicationContext;
-
- public SpringEnvironment(SpringConfiguration springConfiguration) {
- addContext(springConfiguration);
- addContext(new SpringEnvironmentContext(springConfiguration.getApplicationContext()));
- pushEnvironment(this);
- }
-
- public ClassLoader getClassLoader() {
- return null;
- }
-
- public EnvironmentFactory getEnvironmentFactory() {
- return null;
- }
-
- public Throwable getException() {
- return null;
- }
-
- public String getUserId() {
- return null;
- }
-
- public void setClassLoader(ClassLoader classLoader) {
- }
-
- public void setException(Throwable exception) {
- }
-
- public void setUserId(String userId) {
- }
-}
Deleted: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentContext.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentContext.java 2009-05-04 21:00:45 UTC (rev 4720)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentContext.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.spring;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.jbpm.api.env.Context;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.util.ReflectUtil;
-import org.springframework.context.ApplicationContext;
-import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
-
-
-/**
- * @author Tom Baeyens
- */
-public class SpringEnvironmentContext implements Context {
-
- // TODO pull up the common behaviour between this class and the SpringEnvironmentFactory
-
- ApplicationContext applicationContext;
- Map<String, Object> cache = new HashMap<String, Object>();
-
- public SpringEnvironmentContext(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
- public boolean has(String key) {
- return applicationContext.isPrototype(key);
- }
-
- public Object get(String key) {
- if (cache.containsKey(key)) {
- return cache.get(key);
- }
- if (has(key)) {
- Object bean = applicationContext.getBean(key);
- // cache.put(key, bean);
- return bean;
- }
- return null;
- }
-
- public <T> T get(Class<T> type) {
- String name = ReflectUtil.getUnqualifiedClassName(type);
- name = name.substring(0, 1).toLowerCase() + name.substring(1);
- return (T) get(name);
- }
-
- public Set<String> keys() {
- HashSet<String> keys = new HashSet<String>();
- for (String key : applicationContext.getBeanDefinitionNames()) {
- if (has(key)) {
- keys.add(key);
- }
- }
- return keys;
- }
-
- public ApplicationContext getApplicationContext() {
- return applicationContext;
- }
-
- public void setApplicationContext(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
-
- public String getName() {
- return null;
- }
-
- public Object set(String key, Object value) {
- return null;
- }
-}
Added: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java (rev 0)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.tx;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.spring.CommandTransactionCallback;
+import org.jbpm.pvm.internal.svc.Interceptor;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.support.TransactionCallback;
+import org.springframework.transaction.support.TransactionTemplate;
+import org.springframework.util.Assert;
+
+
+/** calls setRollbackOnly on the transaction in the environment
+ * in case an exception occurs during execution of the command.
+ *
+ * @author Andries Inze
+ */
+public class SpringTransactionInterceptor extends Interceptor {
+
+ private static final Log log = Log.getLog(SpringTransactionInterceptor.class.getName());
+
+ @SuppressWarnings("unchecked")
+public <T> T execute(Command<T> command) {
+ Environment environment = Environment.getCurrent();
+ if (environment==null) {
+ throw new JbpmException("no environment for managing hibernate transaction");
+ }
+
+ StandardTransaction standardTransaction = environment.get(StandardTransaction.class);
+ if (standardTransaction==null) {
+ throw new JbpmException("no spring-transaction in environment");
+ }
+
+ standardTransaction.begin();
+
+ try {
+ PlatformTransactionManager platformTransactionManager = environment.get(PlatformTransactionManager.class);
+ Assert.notNull(platformTransactionManager);
+ TransactionTemplate template = new TransactionTemplate(platformTransactionManager);
+ TransactionCallback transactionCallback = new CommandTransactionCallback<T>(command, next, platformTransactionManager);
+ return (T) template.execute(transactionCallback);
+
+ } catch (RuntimeException e) {
+ standardTransaction.setRollbackOnly();
+ throw e;
+
+ } finally {
+ standardTransaction.complete();
+ }
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SpringTransactionInterceptorBinding.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SpringTransactionInterceptorBinding.java (rev 0)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SpringTransactionInterceptorBinding.java 2009-05-04 21:01:08 UTC (rev 4721)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.wire.binding;
+
+import org.jbpm.pvm.internal.tx.SpringTransactionInterceptor;
+import org.jbpm.pvm.internal.tx.StandardTransactionInterceptor;
+import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+/** parses a descriptor for creating a {@link StandardTransactionInterceptor}.
+ *
+ * See schema docs for more details.
+ *
+ * @author Tom Baeyens
+ */
+public class SpringTransactionInterceptorBinding extends WireInterceptorBinding {
+
+ public SpringTransactionInterceptorBinding() {
+ super("spring-transaction-interceptor");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ SpringTransactionInterceptor springTransactionInterceptor = new SpringTransactionInterceptor();
+ return new ProvidedObjectDescriptor(springTransactionInterceptor);
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SpringTransactionInterceptorBinding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/branches/ainze/modules/pvm/src/main/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/resources/jbpm.wire.bindings.xml 2009-05-04 21:00:45 UTC (rev 4720)
+++ jbpm4/branches/ainze/modules/pvm/src/main/resources/jbpm.wire.bindings.xml 2009-05-04 21:01:08 UTC (rev 4721)
@@ -97,5 +97,8 @@
<!-- jpdl bindings -->
<binding class="org.jbpm.jpdl.internal.xml.JpdlDeployerBinding" />
+
+ <!-- spring bindings -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.SpringTransactionInterceptorBinding" />
</wire-bindings>
15 years, 1 month
JBoss JBPM SVN: r4720 - jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-05-04 17:00:45 -0400 (Mon, 04 May 2009)
New Revision: 4720
Added:
jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/applicationContext.xml
jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/jbpm.cfg.xml
Removed:
jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/spring.beans.xml
Log:
initial working release
Added: jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/applicationContext.xml
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/applicationContext.xml (rev 0)
+++ jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/applicationContext.xml 2009-05-04 21:00:45 UTC (rev 4720)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
+
+<!--
+ <bean id="configuration" class="org.jbpm.spring.cfg.SpringConfigurationFactoryBean">
+ <property name="jbpmConfigurationLocation" value="org/jbpm/spring/test/jbpm.cfg.xml" />
+ </bean>
+-->
+
+ <bean id="testSF" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+ <property name="configLocation" value="classpath:jbpm.hibernate.cfg.xml" />
+ <!-- A best practice should be to keep split the config into multiple files
+ <property name="configLocations" value="hibernate.cfg.xml, hibernate.jbpm.cfg.xml" />
+ -->
+ </bean>
+
+ <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+ <property name="sessionFactory" ref="testSF" />
+ <property name="dataSource" ref="dataSource" />
+ </bean>
+
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:mem:." />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </bean>
+</beans>
\ No newline at end of file
Property changes on: jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/applicationContext.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/jbpm.cfg.xml (rev 0)
+++ jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/jbpm.cfg.xml 2009-05-04 21:00:45 UTC (rev 4720)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
+
+ <process-engine-context>
+
+ <repository-service />
+ <repository-cache />
+ <execution-service />
+ <history-service />
+ <management-service />
+ <task-service />
+ <identity-service />
+ <command-service>
+ <retry-interceptor />
+ <environment-interceptor />
+ <spring-transaction-interceptor />
+ </command-service>
+
+ <hibernate-configuration>
+ <cfg resource="jbpm.hibernate.cfg.xml" />
+ </hibernate-configuration>
+
+ <deployer-manager>
+ <jpdl-deployer />
+ </deployer-manager>
+
+ <script-manager default-expression-language="juel"
+ default-script-language="juel"
+ read-contexts="execution, environment, process-engine"
+ write-context="">
+ <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+ </script-manager>
+
+ <authentication />
+
+ <job-executor auto-start="false" />
+
+ <id-generator />
+ <types resource="jbpm.variable.types.xml" />
+
+ <business-calendar>
+ <monday hours="9:00-12:00 and 12:30-17:00"/>
+ <tuesday hours="9:00-12:00 and 12:30-17:00"/>
+ <wednesday hours="9:00-12:00 and 12:30-17:00"/>
+ <thursday hours="9:00-12:00 and 12:30-17:00"/>
+ <friday hours="9:00-12:00 and 12:30-17:00"/>
+ <holiday period="01/07/2008 - 31/08/2008"/>
+ </business-calendar>
+
+ </process-engine-context>
+
+ <transaction-context>
+ <repository-session />
+ <pvm-db-session />
+ <job-db-session />
+ <task-db-session />
+ <message-session />
+ <timer-session />
+ <history-session />
+ <hibernate-session />
+ <transaction />
+ <identity-session />
+ </transaction-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/spring.beans.xml
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/spring.beans.xml 2009-05-04 20:12:55 UTC (rev 4719)
+++ jbpm4/branches/ainze/modules/pvm/src/test/resources/org/jbpm/pvm/spring/spring.beans.xml 2009-05-04 21:00:45 UTC (rev 4720)
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <!-- SINGLETONS
- SpringEnvironmentFactory will only see the singleton beans.
- -->
-
- <bean id="processService"
- class="org.jbpm.pvm.internal.svc.ProcessServiceImpl"
- scope="singleton">
- <property name="commandService" ref="commandService" />
- </bean>
-
- <bean id="commandService"
- class="org.jbpm.pvm.internal.spring.SpringCommandService"
- scope="singleton">
- <property name="transactionManager" ref="transactionManager" />
- <property name="environmentFactory" ref="environmentFactory"/>
- </bean>
-
- <bean id="transactionManager"
- class="org.springframework.orm.hibernate3.HibernateTransactionManager"
- scope="singleton">
- <property name="sessionFactory" ref="sessionFactory"/>
- </bean>
-
- <bean id="environmentFactory"
- class="org.jbpm.pvm.internal.cfg.SpringConfiguration"
- scope="singleton" />
-
- <bean id="sessionFactory"
- class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
- scope="singleton">
- <property name="mappingResources">
- <list>
- <value>jbpm.pvm.typedefs.hbm.xml</value>
- <value>jbpm.pvm.wire.hbm.xml</value>
- <value>jbpm.pvm.definition.hbm.xml</value>
- <value>jbpm.pvm.execution.hbm.xml</value>
- <value>jbpm.pvm.variable.hbm.xml</value>
- <value>jbpm.pvm.job.hbm.xml</value>
- </list>
- </property>
- <property name="hibernateProperties"><value>
- hibernate.dialect = org.hibernate.dialect.HSQLDialect
- hibernate.connection.driver_class = org.hsqldb.jdbcDriver
- hibernate.connection.url = jdbc:hsqldb:mem:.
- hibernate.connection.username = sa
- hibernate.connection.password =
- hibernate.hbm2ddl.auto = create-drop
- hibernate.cache.use_second_level_cache = true
- hibernate.cache.provider_class = org.hibernate.cache.HashtableCacheProvider
- </value></property>
- </bean>
-
- <bean id="hibernateSessionManager"
- class="org.jbpm.pvm.internal.spring.HibernateSessionManager"
- scope="singleton">
- <property name="sessionFactory" ref="sessionFactory" />
- </bean>
-
- <!-- PROTOTYPES
- The PVM environment scope will only see prototype beans.
- Each environment will cache the prototype beans that are fetched
- through it.
- -->
-
- <bean id="session"
- factory-bean="hibernateSessionManager"
- factory-method="getSession"
- scope="prototype" />
-
-</beans>
\ No newline at end of file
15 years, 1 month
JBoss JBPM SVN: r4719 - in jbpm4/branches: ainze/modules/userguide and 1 other directory.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-05-04 16:12:55 -0400 (Mon, 04 May 2009)
New Revision: 4719
Added:
jbpm4/branches/ainze/
Modified:
jbpm4/branches/ainze/modules/userguide/
Log:
updated from beta2
Copied: jbpm4/branches/ainze (from rev 4718, jbpm4/trunk)
Property changes on: jbpm4/branches/ainze/modules/userguide
___________________________________________________________________
Name: svn:ignore
- *.iml
.settings
target
+ *.iml
.settings
target
15 years, 1 month
JBoss JBPM SVN: r4718 - jbpm4/branches.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-05-04 16:05:27 -0400 (Mon, 04 May 2009)
New Revision: 4718
Removed:
jbpm4/branches/ainze/
Log:
merging from beta2
15 years, 1 month
JBoss JBPM SVN: r4717 - jbpm4/trunk/qa/db.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-04 16:04:05 -0400 (Mon, 04 May 2009)
New Revision: 4717
Modified:
jbpm4/trunk/qa/db/mysql.properties
Log:
changed mysql qa db server from dev01 to dev02
Modified: jbpm4/trunk/qa/db/mysql.properties
===================================================================
--- jbpm4/trunk/qa/db/mysql.properties 2009-05-04 19:52:00 UTC (rev 4716)
+++ jbpm4/trunk/qa/db/mysql.properties 2009-05-04 20:04:05 UTC (rev 4717)
@@ -1,4 +1,4 @@
jdbc.driver=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://dev01.qa.atl.jboss.com:3306/pvm1
+jdbc.url=jdbc:mysql://dev02.qa.atl.jboss.com:3306/pvm1
jdbc.username=pvm1
jdbc.password=pvm1
15 years, 1 month
JBoss JBPM SVN: r4716 - jbpm4/trunk/qa.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-04 15:52:00 -0400 (Mon, 04 May 2009)
New Revision: 4716
Modified:
jbpm4/trunk/qa/hudson-jbpm4-jboss.sh
Log:
removed maven opts
Modified: jbpm4/trunk/qa/hudson-jbpm4-jboss.sh
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-jboss.sh 2009-05-04 18:30:11 UTC (rev 4715)
+++ jbpm4/trunk/qa/hudson-jbpm4-jboss.sh 2009-05-04 19:52:00 UTC (rev 4716)
@@ -2,7 +2,6 @@
#
# runs the jboss integration test suite
-MAVEN_OPTS=-Xms1024M -Xmx1024M
ANT_PROPERTIES="-Ddatabase=$DATABASE -Djboss.version=$JBOSS_VERSION -Djbpm.parent.dir=$WORKSPACE -Djboss.distro.dir=$SOURCE_REPO/jboss"
echo ANT_PROPERTIES=${ANT_PROPERTIES}
15 years, 1 month
JBoss JBPM SVN: r4715 - jbpm4/trunk/qa/db.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-04 14:30:11 -0400 (Mon, 04 May 2009)
New Revision: 4715
Modified:
jbpm4/trunk/qa/db/mysql.properties
jbpm4/trunk/qa/db/postgresql.properties
Log:
qa lab mysql and postgresql properties
Modified: jbpm4/trunk/qa/db/mysql.properties
===================================================================
--- jbpm4/trunk/qa/db/mysql.properties 2009-05-04 17:55:44 UTC (rev 4714)
+++ jbpm4/trunk/qa/db/mysql.properties 2009-05-04 18:30:11 UTC (rev 4715)
@@ -1,4 +1,4 @@
jdbc.driver=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://dev01.qa.atl.jboss.com:3306/jbpmdb
-jdbc.username=JBPM4
-jdbc.password=JBPM4
+jdbc.url=jdbc:mysql://dev01.qa.atl.jboss.com:3306/pvm1
+jdbc.username=pvm1
+jdbc.password=pvm1
Modified: jbpm4/trunk/qa/db/postgresql.properties
===================================================================
--- jbpm4/trunk/qa/db/postgresql.properties 2009-05-04 17:55:44 UTC (rev 4714)
+++ jbpm4/trunk/qa/db/postgresql.properties 2009-05-04 18:30:11 UTC (rev 4715)
@@ -1,7 +1,7 @@
jdbc.driver=org.postgresql.Driver
jdbc.port=5432
jdbc.server=dev01.qa.atl.jboss.com
-jdbc.databasename=jbpmdb
-jdbc.url=jdbc:postgresql://dev01.qa.atl.jboss.com:5432/jbpmdb
-jdbc.username=JBPM4
-jdbc.password=JBPM4
+jdbc.databasename=pvm3
+jdbc.url=jdbc:postgresql://dev01.qa.atl.jboss.com:5432/pvm3
+jdbc.username=pvm3
+jdbc.password=pvm3
15 years, 1 month