[jboss-svn-commits] JBL Code SVN: r18346 - in labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2: product/docs and 28 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Feb 6 09:27:36 EST 2008
Author: kevin.conner at jboss.com
Date: 2008-02-06 09:27:36 -0500 (Wed, 06 Feb 2008)
New Revision: 18346
Added:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/h2.jar
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java
Removed:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/AsyncTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/Wait2SecondsAction.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/.gpd.testAsync.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/.gpd.testSync.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testAsync.jpg
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testAsync.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testSync.jpg
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testSync.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java
Modified:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/MessageActionGuide.odt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/MessageActionGuide.pdf
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/advanced/SOAConcepts.odt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/advanced/WebServices.odt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/services/jBPMIntegrationGuide.odt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/services/jBPMIntegrationGuide.pdf
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/install/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/install/standalone/jbossesb-server-base.zip
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/common/JBossESBPropertyService.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_bpel/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_wsaddressing/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_wssecurity/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm-ds.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/skip.properties-example
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/build.xml
Log:
Merged IR10 into SOA
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -128,19 +128,19 @@
<!-- Test targets -->
- <target name="esb.test" depends="org.jboss.esb.test.configure-default, org.jboss.esb.test"/>
+ <target name="esb.test" depends="org.jboss.esb.test.configure-default, org.jboss.esb.test" unless="skip.tests"/>
<target name="org.jboss.esb.test.configure-default">
<property name="tests.to.run" value="*" />
</target>
- <target name="esb.testx" depends="org.jboss.esb.test.configure-tests, org.jboss.esb.test"/>
+ <target name="esb.testx" depends="org.jboss.esb.test.configure-tests, org.jboss.esb.test" unless="skip.tests"/>
<target name="org.jboss.esb.test.configure-tests">
<input addproperty="tests.to.run" message="Enter the name of the class(es) to be tested. Wildcards Supported. No need to specify the 'UnitTest' suffix:" />
</target>
- <target name="org.jboss.esb.test" depends="org.jboss.esb.jar">
+ <target name="org.jboss.esb.test" depends="org.jboss.esb.jar" unless="skip.tests">
<echo message="Testing of modules, using unit and functional tests"/>
<ant dir="rosetta" target="org.jboss.esb.rosetta.test"/>
<ant dir="services" target="test"/>
@@ -156,7 +156,7 @@
</target>
<!-- Integration test targets -->
- <target name="org.jboss.esb.integration.test" depends="org.jboss.esb.compile">
+ <target name="org.jboss.esb.integration.test" depends="org.jboss.esb.compile" unless="skip.tests">
<echo message="Testing of modules, using unit, functional and integration tests"/>
<ant dir="rosetta">
<target name="org.jboss.esb.rosetta.integration.test"/>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/MessageActionGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/MessageActionGuide.pdf
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/advanced/SOAConcepts.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/advanced/WebServices.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/services/jBPMIntegrationGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/services/jBPMIntegrationGuide.pdf
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -112,7 +112,12 @@
<target name="esb.init-app-server" if="org.jboss.esb.server.home">
<property name="org.jboss.esb.test.server.config" value="test-esb"/>
<condition property="esb.server.config.nameclash">
+ <and>
<equals arg1="${org.jboss.esb.test.server.config}" arg2="${org.jboss.esb.server.config}"/>
+ <not>
+ <equals arg1="true" arg2="${soa.test.no-prepare}"/>
+ </not>
+ </and>
</condition>
<fail if="esb.server.config.nameclash" message="Specified server config matches test profile name: ${org.jboss.esb.test.server.config}"/>
@@ -139,7 +144,7 @@
<property name="org.jboss.esb.server.config.appserver" value="true"/>
</target>
- <target name="esb.configure-app-server" if="org.jboss.esb.server.config.appserver">
+ <target name="esb.configure-app-server" unless="soa.test.no-prepare" if="org.jboss.esb.server.config.appserver">
<property name="esb.target-dir" location="${org.jboss.esb.server.home}/server/${org.jboss.esb.test.server.config}"/>
<delete dir="${esb.target-dir}" quiet="true"/>
@@ -171,7 +176,7 @@
<property name="org.jboss.esb.server.config.ftpserver" value="true"/>
</target>
- <target name="esb.configure-ftp-server" if="org.jboss.esb.server.config.ftpserver">
+ <target name="esb.configure-ftp-server" unless="soa.test.no-prepare" if="org.jboss.esb.server.config.ftpserver">
<ant antfile="build.xml" dir="${esb.ftp.location}"/>
<property name="esb.deploy-dir" location="${org.jboss.esb.server.home}/server/${org.jboss.esb.test.server.config}/deploy"/>
<copy todir="${esb.deploy-dir}">
@@ -191,8 +196,8 @@
<target name="esb.configure" depends="esb.init, esb.configure-app-server, esb.configure-esb-server, esb.configure-ftp-server"/>
- <target name="esb.setup-esb" depends="esb.configure" description="target for configuring a clean esb">
- <echo>install dir: ${esb.install.location}</echo>
+ <target name="esb.setup-esb" depends="esb.configure" unless="soa.test.no-prepare" description="target for configuring a clean esb">
+ <echo>install dir: ${esb.install.location}</echo>
<ant antfile="build.xml" dir="${esb.install.location}" target="deploy"
inheritall="false">
<property name="org.jboss.esb.server.home" value="${org.jboss.esb.server.home}"/>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/install/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/install/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/install/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -10,6 +10,7 @@
<property name="server.dir" value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}"/>
<property name="conf.dir" value="${server.dir}/conf"/>
<property name="deploy.dir" value="${server.dir}/deploy"/>
+ <property name="server.lib.dir" value="${server.dir}/lib"/>
<property name="hadeploy.dir" value="${server.dir}/deploy-hasingleton"/>
<property name="product.dir" location=".."/>
@@ -152,6 +153,9 @@
<copy file="${org.jboss.esb.dist}/tools/configeditor/dist/jbossesb-config-editor.war" todir="${deploy.dir}" />
<copy file="${org.jboss.esb.dist}/tools/configeditor/resources/action-templates.xml" todir="${conf.dir}" />
+ <!-- install h2 jar -->
+ <copy file="${org.jboss.esb.dist.lib}/ext/h2.jar" todir="${server.lib.dir}"/>
+
<ant dir="jbpm-patch" target="replace">
<property name="org.jboss.esb.server.home" value="${org.jboss.esb.server.home}"/>
<property name="org.jboss.esb.server.config" value="${org.jboss.esb.server.config}"/>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/install/standalone/jbossesb-server-base.zip
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/h2.jar (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/product/lib/ext/h2.jar)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -46,6 +46,8 @@
import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+import org.jboss.internal.soa.esb.rosetta.pooling.xa.XaJmsConnectionPool;
+import org.jboss.internal.soa.esb.rosetta.pooling.xa.XaJmsConnectionPoolContainer;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.addressing.MalformedEPRException;
import org.jboss.soa.esb.addressing.eprs.JMSEpr;
@@ -142,35 +144,11 @@
}
public Session getJmsSession(final int acknowledgeMode) throws CourierException {
+ reset();
+
if(jmsSession == null) {
synchronized(this) {
- try
- {
- TransactionStrategy txStrategy = TransactionStrategy.getStrategy();
- Object txHandle = ((txStrategy == null) ? null : txStrategy.getTransaction());
- boolean isActive = ((txStrategy == null) ? false : txStrategy.isActive());
-
- transactional = (txHandle != null);
-
- /*
- * Make sure the current transaction is still active! If we
- * have previously slept, then the timeout may be longer than that
- * associated with the transaction.
- */
-
- /*
- * MessageAwareListener will catch exceptions and roll back the transaction.
- */
-
- if (transactional && !isActive)
- {
- throw new CourierException("Associated transaction is no longer active!");
- }
- }
- catch (TransactionStrategyException ex)
- {
- throw new CourierException(ex);
- }
+ checkTransaction();
if(jmsSession == null) {
String sType;
@@ -261,35 +239,9 @@
if (null == message) {
return false;
}
-
- try
- {
- TransactionStrategy txStrategy = TransactionStrategy.getStrategy();
- Object txHandle = ((txStrategy == null) ? null : txStrategy.getTransaction());
- boolean isActive = ((txStrategy == null) ? false : txStrategy.isActive());
-
- transactional = (txHandle != null);
-
- /*
- * Make sure the current transaction is still active! If we
- * have previously slept, then the timeout may be longer than that
- * associated with the transaction.
- */
-
- /*
- * MessageAwareListener will catch exceptions and roll back the transaction.
- */
-
- if (transactional && !isActive)
- {
- throw new CourierException("Associated transaction is no longer active!");
- }
- }
- catch (TransactionStrategyException ex)
- {
- throw new CourierException(ex);
- }
-
+
+ reset();
+
if (_messageProducer == null) {
try {
createMessageProducer();
@@ -306,6 +258,8 @@
message.setStringProperty(key, kvp.getValue());
}
}
+
+ checkTransaction();
sendMessage(message);
if ( jmsSession.getTransacted() && !transactional )
@@ -375,6 +329,10 @@
private void createMessageProducer() throws CourierException, NamingContextException {
Context oJndiCtx = null;
+ reset();
+
+ checkTransaction();
+
if (_messageProducer == null) {
synchronized(this) {
if (_messageProducer == null) {
@@ -415,7 +373,7 @@
}
_messageProducer.setDeliveryMode(_epr.getPersistent()?DeliveryMode.PERSISTENT:DeliveryMode.NON_PERSISTENT);
if ( _logger.isDebugEnabled() )
- _logger.debug(" JMSCourier deliveryMode: " + _messageProducer.getDeliveryMode() + ", peristent:" + _epr.getPersistent());
+ _logger.debug("JMSCourier deliveryMode: " + _messageProducer.getDeliveryMode() + ", peristent:" + _epr.getPersistent());
}
catch (JMSException ex) {
_logger.debug("Error from JMS system.", ex);
@@ -435,15 +393,19 @@
} // ________________________________
private JmsConnectionPool getConnectionPool() throws ConnectionException {
- /*
- * We need to ignore the pool if we are being used within the scope of
- * a global transaction. However, the pool conveniently wraps the JNDI
- * lookup and configuration. Rather than refactor that out, for now we
- * "work around" it.
- */
+ reset();
- if ((jmsConnectionPool == null) || (transactional)) {
+ if (jmsConnectionPool == null) {
synchronized(this) {
+ try
+ {
+ checkTransaction();
+ }
+ catch (CourierException ex)
+ {
+ throw new ConnectionException(ex);
+ }
+
if(jmsConnectionPool == null) {
String sFactoryClass;
String sType;
@@ -471,7 +433,25 @@
* Needs to be a one-shot instance if transactional.
*/
- jmsConnectionPool = JmsConnectionPoolContainer.getPool(properties, sFactoryClass, sType, username, password, transacted, transactional);
+ Object tx = null;
+
+ try
+ {
+ TransactionStrategy txS = TransactionStrategy.getTransactionStrategy(true);
+
+ tx = txS.getTransaction();
+ }
+ catch (TransactionStrategyException ex)
+ {
+ _logger.warn("Problem getting transaction strategy: ", ex);
+
+ throw new ConnectionException(ex);
+ }
+
+ if (tx == null)
+ jmsConnectionPool = JmsConnectionPoolContainer.getPool(properties, sFactoryClass, sType, username, password, transacted);
+ else
+ jmsConnectionPool = XaJmsConnectionPoolContainer.getPool(properties, sFactoryClass, sType, username, password, true, tx); // force transacted to be true!
}
}
}
@@ -479,6 +459,56 @@
return jmsConnectionPool;
}
+ private void reset ()
+ {
+ /*
+ * Are we in a global transaction?
+ */
+
+ if (jmsConnectionPool instanceof XaJmsConnectionPool)
+ {
+ /*
+ * If the global transaction has terminated then this pool instance has been
+ * closed and we need to get another one.
+ */
+
+ if (!((XaJmsConnectionPool) jmsConnectionPool).active())
+ {
+ jmsConnectionPool = null;
+ _messageProducer = null;
+ _messageConsumer = null;
+ jmsSession = null;
+ }
+ }
+ }
+
+ private void checkTransaction () throws CourierException
+ {
+ try
+ {
+ TransactionStrategy txStrategy = TransactionStrategy.getTransactionStrategy(true);
+ Object txHandle = txStrategy.getTransaction();
+ boolean isActive = txStrategy.isActive();
+
+ transactional = (txHandle != null);
+
+ /*
+ * Make sure the current transaction is still active! If we
+ * have previously slept, then the timeout may be longer than that
+ * associated with the transaction.
+ */
+
+ if (transactional && !isActive)
+ {
+ throw new CourierException("Associated transaction is no longer active!");
+ }
+ }
+ catch (TransactionStrategyException ex)
+ {
+ throw new CourierException(ex);
+ }
+ }
+
public Message pickup(long millis) throws CourierException, CourierTimeoutException {
javax.jms.Message jmsMessage = pickupPayload(millis);
@@ -504,6 +534,8 @@
javax.jms.Message jmsMessage = null;
while (null != _messageConsumer) {
+ checkTransaction();
+
try {
jmsMessage = _messageConsumer.receive(millis);
break;
@@ -562,6 +594,8 @@
private void createMessageConsumer() throws CourierException, ConfigurationException, MalformedEPRException, NamingContextException {
Context oJndiCtx = null;
+ reset();
+
if (_messageConsumer == null) {
synchronized(this) {
if (_messageConsumer == null) {
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -47,6 +47,7 @@
private String datasource;
private String sqlFiles;
private String existsSql;
+ private boolean useEOL ;
public String getExistsSql()
@@ -59,6 +60,16 @@
this.existsSql = existsSql;
}
+ public boolean getUseEOL()
+ {
+ return useEOL;
+ }
+
+ public void setUseEOL(boolean useEOL)
+ {
+ this.useEOL = useEOL;
+ }
+
public String getSqlFiles()
{
return sqlFiles;
@@ -118,7 +129,12 @@
URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
String sql = Configuration.getStringFromStream(url.openStream());
sql = sql.replaceAll("(?m)^--([^\n]+)?$", ""); // Remove all commented lines
- String[] statements = sql.split(";");
+ final String[] statements ;
+ if (useEOL) {
+ statements = sql.split("[\n;]");
+ } else {
+ statements = sql.split(";");
+ }
for (String statement : statements)
{
if ((statement == null) || ("".equals(statement.trim()))) {
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -37,6 +37,10 @@
void setExistsSql(String existsSql)
;
+ boolean getUseEOL() ;
+
+ void setUseEOL(boolean useEOL) ;
+
String getSqlFiles()
;
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,333 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.dependencies;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.system.server.ServerConfigLocator;
+
+/**
+ * Integration with H2.
+ *
+ * @author <a href="mailto:rickard.oberg at telkel.com">Rickard �berg</a>
+ * @author <a href="mailto:Scott_Stark at displayscape.com">Scott Stark</a>.
+ * @author <a href="mailto:pf at iprobot.com">Peter Fagerlund</a>
+ * @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
+ * @author <a href="mailto:vesco.claudio at previnet.it">Claudio Vesco</a>
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ * @author <a href="mailto:kevin.conner at jboss.org">Kevin Conner</a>
+ * @version $Revision$
+ */
+public class H2Database extends ServiceMBeanSupport
+ implements H2DatabaseMBean
+{
+ /** Default password: <code>empty string</code>. */
+ private static final String DEFAULT_PASSWORD = "";
+
+ /** Default user: <code>sa</code>. */
+ private static final String DEFAULT_USER = "sa";
+
+ /** JDBC Driver class: <code>org.h2.Driver</code>. */
+ private static final String JDBC_DRIVER_CLASS = "org.h2.Driver";
+
+ /** JDBC URL common prefix: <code>jdbc:h2:</code>. */
+ private static final String JDBC_URL_PREFIX = "jdbc:h2:";
+
+ /** JDBC in memory URL prefix: <code>jdbc:h2:mem:</code>. */
+ private static final String JDBC_MEM_URL_PREFIX = JDBC_URL_PREFIX + "mem:";
+
+ /** Default data subdir: <code>h2</code>. */
+ private static final String H2_DATA_DIR = "h2";
+
+ /** Default database name: <code>default</code>. */
+ private static final String DEFAULT_DATABASE_NAME = "default";
+
+ // Private Data --------------------------------------------------
+
+ /** Full path to db/h2. */
+ private File dbPath;
+
+ /** Database name. */
+ private String name = DEFAULT_DATABASE_NAME;
+
+ /** In memory mode. */
+ private boolean inMemoryMode ;
+
+ /** Database user. */
+ private String user = DEFAULT_USER;
+
+ /** Database password. */
+ private String password = DEFAULT_PASSWORD;
+
+ /** Hold a connection for in memory h2. */
+ private Connection connection;
+
+
+ // Attributes ----------------------------------------------------
+
+ /**
+ * Set the database name.
+ *
+ * @jmx.managed-attribute
+ */
+ public void setDatabase(String name)
+ {
+ if (name == null)
+ {
+ name = DEFAULT_DATABASE_NAME;
+ }
+ this.name = name;
+ }
+
+ /**
+ * Get the database name.
+ *
+ * @jmx.managed-attribute
+ */
+ public String getDatabase()
+ {
+ return name;
+ }
+
+ /**
+ * Get the full database path.
+ *
+ * @jmx.managed-attribute
+ */
+ public String getDatabasePath()
+ {
+ if (dbPath != null)
+ {
+ return dbPath.toString();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * @return the <code>inMemoryMode</code> flag.
+ *
+ * @jmx.managed-attribute
+ */
+ public boolean isInMemoryMode()
+ {
+ return inMemoryMode;
+ }
+
+ /**
+ * If <b>true</b> the h2 is in memory mode otherwise h2 is in server or remote mode.
+ *
+ * @param b in memory mode.
+ *
+ * @jmx.managed-attribute
+ */
+ public void setInMemoryMode(boolean b)
+ {
+ inMemoryMode = b;
+ }
+
+ /**
+ * @return the password
+ *
+ * @jmx.managed-attribute
+ */
+ public String getPassword()
+ {
+ return password;
+ }
+
+ /**
+ * @return the user
+ *
+ * @jmx.managed-attribute
+ */
+ public String getUser()
+ {
+ return user;
+ }
+
+ /**
+ * @param password
+ *
+ * @jmx.managed-attribute
+ */
+ public void setPassword(String password)
+ {
+ if (password == null)
+ {
+ password = DEFAULT_PASSWORD;
+ }
+ this.password = password;
+ }
+
+ /**
+ * @param user
+ *
+ * @jmx.managed-attribute
+ */
+ public void setUser(String user)
+ {
+ if (user == null)
+ {
+ user = DEFAULT_USER;
+ }
+ this.user = user;
+ }
+
+ // Lifecycle -----------------------------------------------------
+
+ /**
+ * Start the database
+ */
+ protected void startService() throws Exception
+ {
+ if (inMemoryMode)
+ {
+ startInMemoryDatabase();
+ }
+ else
+ {
+ startStandaloneDatabase();
+ }
+ }
+
+ /**
+ * We now close the connection clean by calling the
+ * serverSocket throught jdbc. The MBeanServer calls this
+ * method at closing time.
+ */
+ protected void stopService() throws Exception
+ {
+ if (inMemoryMode)
+ {
+ stopInMemoryDatabase();
+ }
+ else
+ {
+ stopStandaloneDatabase();
+ }
+ }
+
+ // Private -------------------------------------------------------
+
+ /**
+ * Start the standalone (in process) database.
+ */
+ private void startStandaloneDatabase() throws Exception
+ {
+ final File h2Dir = checkDataDir() ;
+
+ dbPath = new File(h2Dir, name);
+
+ final String dbURL = JDBC_URL_PREFIX + dbPath.toURI().toString();
+
+ // Check wee have connectivity
+ final Connection connection = getConnection(dbURL);
+ connection.close() ;
+ }
+
+ /**
+ * Start the only in memory database.
+ */
+ private void startInMemoryDatabase() throws Exception
+ {
+ final String dbURL = JDBC_MEM_URL_PREFIX + name;
+
+ // hold a connection so h2 does not close the database
+ connection = getConnection(dbURL);
+ }
+
+ /**
+ * Stop the standalone (in process) database.
+ */
+ private void stopStandaloneDatabase() throws Exception
+ {
+ // Nothing to do here
+ log.info("Database standalone closed clean");
+ }
+
+ /**
+ * Stop the in memory database.
+ */
+ private void stopInMemoryDatabase() throws Exception
+ {
+ try
+ {
+ connection.close() ;
+ }
+ finally
+ {
+ connection = null;
+ }
+ log.info("Database in memory closed clean");
+ }
+
+ /**
+ * Get the connection.
+ *
+ * @param dbURL jdbc url.
+ * @return the connection, allocate one if needed.
+ * @throws Exception
+ */
+ private synchronized Connection getConnection(String dbURL) throws Exception
+ {
+ if (connection == null)
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ Class.forName(JDBC_DRIVER_CLASS, true, cl).newInstance();
+ connection = DriverManager.getConnection(dbURL, user, password);
+ }
+ return connection;
+ }
+
+ /**
+ * Check the existence of the h2 data directory.
+ * @return The h2 data directory.
+ * @throws IOException For errors checking/creating the h2 data directory.
+ */
+ private File checkDataDir()
+ throws IOException
+ {
+ // Get the server data directory
+ final File dataDir = ServerConfigLocator.locate().getServerDataDir();
+
+ // Get DB directory
+ final File h2Dir = new File(dataDir, H2_DATA_DIR);
+
+ if (!h2Dir.exists())
+ {
+ h2Dir.mkdirs();
+ }
+ else if (!h2Dir.isDirectory())
+ {
+ throw new IOException("Failed to create directory: " + h2Dir);
+ }
+ return h2Dir ;
+ }
+
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.dependencies;
+
+import javax.management.ObjectName;
+
+import org.jboss.mx.util.ObjectNameFactory;
+import org.jboss.system.ServiceMBean;
+
+/**
+ * MBean interface.
+ *
+ * In all cases we run h2 in the same VM with JBoss.
+ * A few notes on h2 running modes:
+ *
+ * remote (server) mode
+ * Not supported yet
+ *
+ * in-process (standalone) mode
+ * h2 can only be contacted from in-vm clients
+ *
+ * memory-only mode
+ * h2 will only keep tables in memory, no persistence of data
+ *
+ * @version $Revision$
+ */
+public interface H2DatabaseMBean extends ServiceMBean
+{
+ /** The default ObjectName */
+ ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss:service=h2");
+
+ // Attributes ----------------------------------------------------
+
+ /** The database name, default is 'default' */
+ String getDatabase();
+ void setDatabase(String name);
+
+ /** The default user to use when connecting to the DB, default is "sa" */
+ String getUser();
+ void setUser(String user);
+
+ /** The default password to use when connecting to the DB, default is "" */
+ String getPassword();
+ void setPassword(String password);
+
+ /** The full database path */
+ String getDatabasePath();
+
+ /** In memory mode */
+ boolean isInMemoryMode() ;
+ void setInMemoryMode(boolean b) ;
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -80,7 +80,7 @@
private Map<Integer,ArrayList<Session>> inUseSessionsMap = new HashMap<Integer,ArrayList<Session>>();
/** Reference to a Queue or Topic Connection, we only need one per pool */
- private Connection jmsConnection = null;
+ protected Connection jmsConnection = null;
/** The Indentifier of the pool */
private Map<String, String> poolKey;
@@ -135,27 +135,10 @@
try {
String connectionFactoryString = poolKey.get(JMSEpr.CONNECTION_FACTORY_TAG);
Object factoryConnection=null;
- try {
- /*
- * For XA connections, use java:/JmsXA which should return a wrapped
- * XAConnectionFactory instance, which will be the base for the
- * XAQueueConnectionFactory or XATopicConnectionFactory.
- */
-
- try
- {
- if (TransactionStrategy.getTransactionStrategy(true).getTransaction() != null)
- {
- if ("XAConnectionFactory".equals(connectionFactoryString))
- connectionFactoryString = "java:/JmsXA";
- }
- }
- catch (TransactionStrategyException ex)
- {
- logger.warn("Could not determine transaction strategy!", ex);
- }
- factoryConnection = jndiContext.lookup(connectionFactoryString);
+ try
+ {
+ factoryConnection = jndiContext.lookup(overrideName(connectionFactoryString));
} catch (NamingException ne) {
logger.info("Received NamingException, refreshing context.");
jndiContext = NamingContextPool.replaceNamingContext(jndiContext, JmsConnectionPoolContainer.getJndiEnvironment(poolKey));
@@ -174,29 +157,8 @@
jmsConnection = useJMSSecurity ? factory.createTopicConnection(username,password): factory.createTopicConnection();
}
- TransactionStrategy txStrategy = TransactionStrategy.getStrategy();
+ addExceptionListener();
- /*
- * It is illegal to set ExceptionListeners if we are within a transaction.
- */
-
- try
- {
- if ((txStrategy != null) && (txStrategy.getTransaction() == null))
- {
- jmsConnection.setExceptionListener(new ExceptionListener() {
- public void onException(JMSException arg0)
- {
- removeSessionPool() ;
- }
- }) ;
- }
- }
- catch (TransactionStrategyException ex)
- {
- throw new ConnectionException(ex);
- }
-
jmsConnection.start();
} finally {
NamingContextPool.releaseNamingContext(jndiContext) ;
@@ -413,6 +375,21 @@
return inUseSessionsMap.get(acknowledgeMode).size();
}
+ protected String overrideName (String name) throws ConnectionException
+ {
+ return name;
+ }
+
+ protected void addExceptionListener () throws JMSException, ConnectionException
+ {
+ jmsConnection.setExceptionListener(new ExceptionListener() {
+ public void onException(JMSException arg0)
+ {
+ removeSessionPool() ;
+ }
+ }) ;
+ }
+
static
{
PropertyManager prop = ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE);
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -43,7 +43,7 @@
*/
public class JmsConnectionPoolContainer{
- private static Logger logger = Logger.getLogger(JmsConnectionPoolContainer.class);
+ protected static Logger logger = Logger.getLogger(JmsConnectionPoolContainer.class);
/**
* The lifecycle resource factory.
@@ -56,6 +56,8 @@
new LifecycleResource<Map<Map<String, String>, JmsConnectionPool>>(lifecycleJMSPoolFactory,
LifecyclePriorities.JMS_CONNECTION_POOL_PRIORITY) ;
+ protected static final HashMap<Object, JmsConnectionPool> transactions = new HashMap<Object, JmsConnectionPool>();
+
/**
* Returns the pool given a JMSEpr.
*
@@ -76,7 +78,7 @@
/**
* Returns the pool given the identifiers for the JMS provider.
*
- * @param enviroment - JNDI evironment for which a JMSConnectionPool should be retreived
+ * @param enviroment - JNDI environment for which a JMSConnectionPool should be retreived
* @param connectionFactory - connectionfactory for which a JMSConnectionPool should be retreived
* @param destinationType - destinationType(Queue or Topic) for which a JMSConnectionPool should be retreived
* @return <code>JmsConnectionPool</code>
@@ -95,13 +97,6 @@
}
- public static JmsConnectionPool getPool(Properties enviroment, String connectionFactory, String destinationType,
- final String username, final String password, final boolean transacted)
- throws ConnectionException
- {
- return getPool(enviroment, connectionFactory, destinationType, username, password, transacted, false);
- }
-
/**
* Returns the pool given the identifiers for the JMS provider.
*
@@ -115,31 +110,19 @@
* @throws ConnectionException
*/
public static JmsConnectionPool getPool(Properties enviroment, String connectionFactory, String destinationType,
- final String username, final String password, final boolean transacted, final boolean ignore)
+ final String username, final String password, final boolean transacted)
throws ConnectionException
{
Map<String,String> poolKey = createPoolKey(enviroment, connectionFactory, destinationType, username, password, transacted);
final Map<Map<String, String>, JmsConnectionPool> poolMap = getMap() ;
- if (poolMap.containsKey(poolKey) && !ignore) {
+ if (poolMap.containsKey(poolKey)) {
return poolMap.get(poolKey);
} else {
JmsConnectionPool pool = new JmsConnectionPool(poolKey);
- /*
- * Horrible, but means we don't have to rewrite the pool code at this stage!
- */
+ poolMap.put(poolKey, pool);
- if (!ignore)
- {
- /*
- * Put it into the pool unless this is a one-shot connection, e.g., for
- * use in a global transaction.
- */
-
- poolMap.put(poolKey, pool);
- }
-
return pool;
}
}
@@ -286,4 +269,4 @@
}
}
}
-}
+}
\ No newline at end of file
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,160 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.internal.soa.esb.rosetta.pooling.xa;
-
-import java.util.Map;
-
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Session;
-import javax.naming.NamingException;
-
-import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
-import org.jboss.soa.esb.common.TransactionStrategy;
-import org.jboss.soa.esb.common.TransactionStrategyException;
-
-/**
- * One instance per global transaction.
- *
- * @author marklittle
- *
- */
-
-public class XaJmsConnectionPool extends JmsConnectionPool
-{
- public XaJmsConnectionPool(Map<String, String> poolKey)
- {
- super(poolKey);
- }
-
- public XaJmsConnectionPool(Map<String, String> poolKey, int poolSize,
- int sleepTime)
- {
- super(poolKey, poolSize, sleepTime);
- }
-
- public boolean active ()
- {
- return _active;
- }
-
- public void terminated ()
- {
- _active = false;
- }
-
- /*
- * Make sure we return the same connection during the transaction.
- * @see org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool#getSession(int)
- */
- public synchronized Session getSession (final int acknowledgeMode)
- throws NamingException, JMSException, ConnectionException
- {
- if (_theSession == null)
- _theSession = super.getSession(acknowledgeMode);
-
- return _theSession;
- }
-
- public synchronized void closeSession (Session sessionToClose)
- {
- // not within the scope of a transaction!
- }
-
- public synchronized void releaseSession (final Session sessionToClose)
- {
- // not within the scope of a transaction!
- }
-
- public synchronized void removeSessionPool()
- {
- // ignore and let Synchronization cleanup for us.
- }
-
- public synchronized void removeTxSessionPool()
- {
- super.closeSession(_theSession);
- _theSession = null;
-
- super.removeSessionPool();
- }
-
- protected String overrideName (String name) throws ConnectionException
- {
- try
- {
- /*
- * If there is a global transaction in place then make sure we
- * grab the right connection, irrespective of the provider info.
- */
-
- if (TransactionStrategy.getTransactionStrategy(true)
- .getTransaction() != null)
- {
- if (("XAConnectionFactory".equals(name))
- || ("ConnectionFactory".equals(name)))
- return "java:/JmsXA";
- }
-
- return name;
- }
- catch (TransactionStrategyException ex)
- {
- throw new ConnectionException(ex);
- }
- }
-
- protected void addExceptionListener () throws JMSException,
- ConnectionException
- {
- /*
- * It is illegal to set ExceptionListeners if we are within a
- * transaction.
- */
-
- try
- {
- TransactionStrategy txStrategy = TransactionStrategy
- .getTransactionStrategy(true);
-
- if ((txStrategy != null) && (txStrategy.getTransaction() == null))
- {
- jmsConnection.setExceptionListener(new ExceptionListener()
- {
- public void onException (JMSException arg0)
- {
- removeSessionPool();
- }
- });
- }
- }
- catch (TransactionStrategyException ex)
- {
- throw new ConnectionException(ex);
- }
- }
-
- private boolean _active = true;
-
- private Session _theSession = null;
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.rosetta.pooling.xa;
+
+import java.util.Map;
+
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Session;
+import javax.naming.NamingException;
+
+import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
+
+/**
+ * One instance per global transaction.
+ *
+ * @author marklittle
+ *
+ */
+
+public class XaJmsConnectionPool extends JmsConnectionPool
+{
+ public XaJmsConnectionPool(Map<String, String> poolKey)
+ {
+ super(poolKey);
+ }
+
+ public XaJmsConnectionPool(Map<String, String> poolKey, int poolSize,
+ int sleepTime)
+ {
+ super(poolKey, poolSize, sleepTime);
+ }
+
+ public boolean active ()
+ {
+ return _active;
+ }
+
+ public void terminated ()
+ {
+ _active = false;
+ }
+
+ /*
+ * Make sure we return the same connection during the transaction.
+ * @see org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool#getSession(int)
+ */
+ public synchronized Session getSession (final int acknowledgeMode)
+ throws NamingException, JMSException, ConnectionException
+ {
+ if (_theSession == null)
+ _theSession = super.getSession(acknowledgeMode);
+
+ return _theSession;
+ }
+
+ public synchronized void closeSession (Session sessionToClose)
+ {
+ // not within the scope of a transaction!
+ }
+
+ public synchronized void releaseSession (final Session sessionToClose)
+ {
+ // not within the scope of a transaction!
+ }
+
+ public synchronized void removeSessionPool()
+ {
+ // ignore and let Synchronization cleanup for us.
+ }
+
+ public synchronized void removeTxSessionPool()
+ {
+ super.closeSession(_theSession);
+ _theSession = null;
+
+ super.removeSessionPool();
+ }
+
+ protected String overrideName (String name) throws ConnectionException
+ {
+ try
+ {
+ /*
+ * If there is a global transaction in place then make sure we
+ * grab the right connection, irrespective of the provider info.
+ */
+
+ if (TransactionStrategy.getTransactionStrategy(true)
+ .getTransaction() != null)
+ {
+ if (("XAConnectionFactory".equals(name))
+ || ("ConnectionFactory".equals(name)))
+ return "java:/JmsXA";
+ }
+
+ return name;
+ }
+ catch (TransactionStrategyException ex)
+ {
+ throw new ConnectionException(ex);
+ }
+ }
+
+ protected void addExceptionListener () throws JMSException,
+ ConnectionException
+ {
+ /*
+ * It is illegal to set ExceptionListeners if we are within a
+ * transaction.
+ */
+
+ try
+ {
+ TransactionStrategy txStrategy = TransactionStrategy
+ .getTransactionStrategy(true);
+
+ if ((txStrategy != null) && (txStrategy.getTransaction() == null))
+ {
+ jmsConnection.setExceptionListener(new ExceptionListener()
+ {
+ public void onException (JMSException arg0)
+ {
+ removeSessionPool();
+ }
+ });
+ }
+ }
+ catch (TransactionStrategyException ex)
+ {
+ throw new ConnectionException(ex);
+ }
+ }
+
+ private boolean _active = true;
+
+ private Session _theSession = null;
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,114 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.internal.soa.esb.rosetta.pooling.xa;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.transaction.Synchronization;
-
-import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
-import org.jboss.internal.soa.esb.rosetta.pooling.xa.XaJmsConnectionPool;
-import org.jboss.soa.esb.common.TransactionStrategy;
-import org.jboss.soa.esb.common.TransactionStrategyException;
-
-public class XaJmsConnectionPoolContainer extends JmsConnectionPoolContainer
-{
-
- public static JmsConnectionPool getPool (Properties enviroment,
- String connectionFactory, String destinationType,
- final String username, final String password,
- final boolean transacted, final Object transaction)
- throws ConnectionException
- {
- synchronized (transactions)
- {
- JmsConnectionPool connection = transactions.get(transaction);
-
- if (connection == null)
- {
- // we could override the connectionfactory name here ...
- // in fact we could change all of the info here if necessary ...
-
- Map<String, String> poolKey = createPoolKey(enviroment,
- connectionFactory, destinationType, username, password,
- true); // force transacted to be true
- XaJmsConnectionPool pool = new XaJmsConnectionPool(poolKey);
-
- transactions.put(transaction, pool);
-
- TransactionStrategy tx = TransactionStrategy
- .getTransactionStrategy(true);
-
- try
- {
- tx.registerSynchronization(new PoolSynchronization(
- transactions, pool));
- }
- catch (TransactionStrategyException ex)
- {
- logger.warn("Problem when enlisting synchronization", ex);
-
- throw new ConnectionException(ex);
- }
-
- return pool;
- }
- else
- return connection;
- }
- }
-
-}
-
-class PoolSynchronization implements Synchronization
-{
- PoolSynchronization(HashMap<Object, JmsConnectionPool> transactions,
- XaJmsConnectionPool pool)
- {
- _transactions = transactions;
- _pool = pool;
- }
-
- public void beforeCompletion ()
- {
- }
-
- public void afterCompletion (int status) // we don't care about the
- // status
- {
- _pool.removeTxSessionPool();
- _pool.terminated();
-
- synchronized (_transactions)
- {
- _transactions.remove(_pool);
- }
- }
-
- private HashMap<Object, JmsConnectionPool> _transactions;
-
- private XaJmsConnectionPool _pool;
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.rosetta.pooling.xa;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.transaction.Synchronization;
+
+import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+import org.jboss.internal.soa.esb.rosetta.pooling.xa.XaJmsConnectionPool;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
+
+public class XaJmsConnectionPoolContainer extends JmsConnectionPoolContainer
+{
+
+ public static JmsConnectionPool getPool (Properties enviroment,
+ String connectionFactory, String destinationType,
+ final String username, final String password,
+ final boolean transacted, final Object transaction)
+ throws ConnectionException
+ {
+ synchronized (transactions)
+ {
+ JmsConnectionPool connection = transactions.get(transaction);
+
+ if (connection == null)
+ {
+ // we could override the connectionfactory name here ...
+ // in fact we could change all of the info here if necessary ...
+
+ Map<String, String> poolKey = createPoolKey(enviroment,
+ connectionFactory, destinationType, username, password,
+ true); // force transacted to be true
+ XaJmsConnectionPool pool = new XaJmsConnectionPool(poolKey);
+
+ transactions.put(transaction, pool);
+
+ TransactionStrategy tx = TransactionStrategy
+ .getTransactionStrategy(true);
+
+ try
+ {
+ tx.registerSynchronization(new PoolSynchronization(
+ transactions, pool));
+ }
+ catch (TransactionStrategyException ex)
+ {
+ logger.warn("Problem when enlisting synchronization", ex);
+
+ throw new ConnectionException(ex);
+ }
+
+ return pool;
+ }
+ else
+ return connection;
+ }
+ }
+
+}
+
+class PoolSynchronization implements Synchronization
+{
+ PoolSynchronization(HashMap<Object, JmsConnectionPool> transactions,
+ XaJmsConnectionPool pool)
+ {
+ _transactions = transactions;
+ _pool = pool;
+ }
+
+ public void beforeCompletion ()
+ {
+ }
+
+ public void afterCompletion (int status) // we don't care about the
+ // status
+ {
+ _pool.removeTxSessionPool();
+ _pool.terminated();
+
+ synchronized (_transactions)
+ {
+ _transactions.remove(_pool);
+ }
+ }
+
+ private HashMap<Object, JmsConnectionPool> _transactions;
+
+ private XaJmsConnectionPool _pool;
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/common/JBossESBPropertyService.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/common/JBossESBPropertyService.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/common/JBossESBPropertyService.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -27,6 +27,7 @@
import java.net.URL;
import javax.transaction.Status;
+import javax.transaction.Synchronization;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
@@ -262,6 +263,22 @@
}
/**
+ * Add a synchronization to the current transaction.
+ * @param sync
+ * @throws TransactionStrategyException
+ */
+ public void registerSynchronization (Synchronization sync) throws TransactionStrategyException
+ {
+ try
+ {
+ tm.getTransaction().registerSynchronization(sync);
+ }
+ catch (final Throwable th)
+ {
+ throw new TransactionStrategyException("Problem when registering synchronization: ", th);
+ }
+ }
+ /**
* Is the currently associated transaction active?
* @return
* @throws TransactionStrategyException
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -22,6 +22,8 @@
package org.jboss.soa.esb.common;
+import javax.transaction.Synchronization;
+
/**
* This class represents the transaction strategy that is currently in force
* within the ESB. At present there are two strategies employed, a null strategy
@@ -119,6 +121,13 @@
*/
public abstract void resume (Object tx) throws TransactionStrategyException;
+ /**
+ * Add a synchronization to the current transaction.
+ * @param sync
+ * @throws TransactionStrategyException
+ */
+ public abstract void registerSynchronization (Synchronization sync) throws TransactionStrategyException;
+
public static void setStrategy (TransactionStrategy txSt)
{
_currentStrategy.set(txSt);
@@ -202,6 +211,15 @@
}
/**
+ * Add a synchronization to the current transaction.
+ * @param sync
+ * @throws TransactionStrategyException
+ */
+ public void registerSynchronization (Synchronization sync) throws TransactionStrategyException
+ {
+ }
+
+ /**
* Is the currently associated transaction active?
* @return
* @throws TransactionStrategyException
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -175,6 +175,18 @@
<target name="jbossesb-source-dependencies"
depends="jbossesb-quickstart-override" if="build.jbossesb">
+ <condition
+ property="org.jboss.esb.server.config"
+ value="${quickstart.org.jboss.esb.server.config}">
+ <isset property="quickstart.org.jboss.esb.server.config"/>
+ </condition>
+
+ <condition
+ property="org.jboss.esb.server.home"
+ value="${quickstart.org.jboss.esb.server.home}">
+ <isset property="quickstart.org.jboss.esb.server.home"/>
+ </condition>
+
<!-- check for installation deployment.properties -->
<property name="install.dir" value="${product.dir}/install"/>
<property file="${install.dir}/deployment.properties" prefix="install" />
@@ -237,7 +249,9 @@
<!-- compile-classpath, exec-classpath -->
<!-- ==================================================================== -->
- <target name="dependencies" depends="messaging-dependencies, jbossmq-dependencies, quickstart-specific-dependencies">
+ <target name="dependencies" depends="classpath-dependencies, quickstart-specific-checks"/>
+
+ <target name="classpath-dependencies" depends="messaging-dependencies, jbossmq-dependencies, quickstart-specific-dependencies">
<path id="compile-classpath">
<path refid="quickstart-dependencies-classpath" />
@@ -247,6 +261,7 @@
<path refid="deployment-classpath" />
<fileset dir="${org.jboss.esb.server.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->
</path>
+ <property name="compile-classpath" refid="compile-classpath"/>
<path id="exec-classpath">
<pathelement location="." />
@@ -260,6 +275,7 @@
<path refid="compile-classpath" />
<pathelement location="${pwd}/anttasks/classes" />
</path>
+ <property name="exec-classpath" refid="exec-classpath"/>
</target>
<!-- ==================================================================== -->
@@ -277,8 +293,8 @@
<mkdir dir="${pwd}/anttasks/classes" />
<javac srcdir="${pwd}/anttasks/src" destdir="${pwd}/anttasks/classes" debug="true">
- <classpath refid="compile-classpath" />
- </javac>
+ <classpath refid="compile-classpath" />
+ </javac>
</target>
<target name="run" depends="compile,config">
@@ -447,7 +463,7 @@
<!-- supports JBossWS or EJB. -->
<!-- ==================================================================== -->
- <target name="assert-ws-available">
+ <target name="assert-ws-available" depends="jbossesb-dependencies">
<available property="ws-spi" file="${org.jboss.esb.server.server}/lib/jbossws-spi.jar"/>
<available property="ws-intros" file="${org.jboss.esb.server.deploy.dir}/jbossws.sar/jboss-jaxb-intros.jar"/>
@@ -481,7 +497,7 @@
<fail unless="quickstart.ftp.config" message="Please configure ftp properties in quickstart.properties"/>
</target>
- <target name="assert-jbossremoting-version">
+ <target name="assert-jbossremoting-version" depends="classpath-dependencies">
<java fork="yes" classname="org.jboss.remoting.Version" failonerror="true" outputproperty="jbr-version-string">
<classpath refid="exec-classpath"/>
</java>
@@ -510,6 +526,8 @@
<path id="quickstart-dependencies-classpath"/>
</target>
+ <target name="quickstart-specific-checks"/>
+
<target name="quickstart-specific-assemblies">
<echo message="No Quickstart specific assembly tasks." />
</target>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_bpel/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_bpel/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_bpel/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -28,7 +28,9 @@
</javac>
</target>
- <target name="quickstart-specific-assemblies" depends="assert-ws-available">
+ <target name="quickstart-specific-checks" depends="assert-ws-available"/>
+
+ <target name="quickstart-specific-assemblies">
<!-- Overriden from the target of the same name in base-build.xml. -->
<!-- Called by the "deploy" target. Don't call directly!! -->
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -10,7 +10,9 @@
<property name="war.build.dir" location="${build.dir}/war/classes"/>
- <target name="quickstart-specific-assemblies" depends="assert-ws-available, makewar"/>
+ <target name="quickstart-specific-checks" depends="assert-ws-available"/>
+
+ <target name="quickstart-specific-assemblies" depends="makewar"/>
<target name="makewar" description="make war">
<!-- Compile... -->
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -10,8 +10,10 @@
<property name="war.build.dir" location="${build.dir}/war/classes"/>
- <target name="quickstart-specific-assemblies" depends="assert-ws-available, makewar"/>
+ <target name="quickstart-specific-checks" depends="assert-ws-available"/>
+ <target name="quickstart-specific-assemblies" depends="makewar"/>
+
<target name="makewar" description="make war">
<!-- Compile... -->
<mkdir dir="${war.build.dir}" />
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -8,7 +8,9 @@
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
- <target name="quickstart-specific-dependencies" depends="assert-ws-available,assert-jbossremoting-version">
+ <target name="quickstart-specific-checks" depends="assert-ws-available,assert-jbossremoting-version"/>
+
+ <target name="quickstart-specific-dependencies">
<path id="quickstart-dependencies-classpath">
<fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
</path>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -8,7 +8,9 @@
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
- <target name="quickstart-specific-dependencies" depends="assert-ws-available">
+ <target name="quickstart-specific-checks" depends="assert-ws-available"/>
+
+ <target name="quickstart-specific-dependencies">
<path id="quickstart-dependencies-classpath">
<fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
</path>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_wsaddressing/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_wsaddressing/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_wsaddressing/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -8,7 +8,9 @@
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
- <target name="quickstart-specific-dependencies" depends="assert-ws-available,assert-jbossremoting-version">
+ <target name="quickstart-specific-checks" depends="assert-ws-available,assert-jbossremoting-version"/>
+
+ <target name="quickstart-specific-dependencies">
<path id="quickstart-dependencies-classpath">
<fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
</path>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_wssecurity/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_wssecurity/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_wssecurity/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -8,7 +8,9 @@
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
- <target name="quickstart-specific-dependencies" depends="assert-ws-available,assert-jbossremoting-version">
+ <target name="quickstart-specific-checks" depends="assert-ws-available,assert-jbossremoting-version"/>
+
+ <target name="quickstart-specific-dependencies">
<path id="quickstart-dependencies-classpath">
<fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar"/>
</path>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,194 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import java.util.Date;
+
+import org.apache.log4j.Logger;
+import org.jbpm.JbpmException;
+import org.jbpm.command.SignalCommand;
+import org.jbpm.context.exe.ContextInstance;
+import org.jbpm.graph.def.Action;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+import org.jbpm.instantiation.Delegation;
+import org.jbpm.job.ExecuteActionJob;
+import org.jbpm.msg.MessageService;
+import org.jbpm.svc.Services;
+
+/**
+ * Handle the asynchronous signalling of a process instance task.
+ *
+ * @author <a href='kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+class AsyncProcessSignal
+{
+ /**
+ * The logger for this class.
+ */
+ private static Logger logger = Logger.getLogger(AsyncProcessSignal.class);
+
+ /**
+ * The name of the ESB asynchronous signal action.
+ */
+ private static final String ESB_ASYNC_SIGNAL_ACTION_NAME = "ESB_ASYNC_SIGNAL_ACTION" ;
+ /**
+ * The base name of the ESB asynchronous signal context variable.
+ */
+ private static final String ESB_ASYNC_SIGNAL_VARIABLE_NAME = "ESB_ASYNC_SIGNAL_VARIABLE_" ;
+
+ /**
+ * Create an asynchronous signal job for the specified token and transition.
+ * @param token The token to signal.
+ * @param transitionName The transition to signal or null if the default transition is to be used.
+ */
+ static void createSignalJob(final Token token, final String transitionName)
+ {
+ final boolean isDebugEnabled = logger.isDebugEnabled() ;
+ final long tokenId = token.getId() ;
+ final ProcessInstance processInstance = token.getProcessInstance() ;
+ final long processInstanceId = processInstance.getId() ;
+ final ContextInstance contextInstance = processInstance.getContextInstance() ;
+
+ if (isDebugEnabled)
+ {
+ logger.debug("Locking token id " + tokenId + " from process instance " + processInstanceId) ;
+ }
+ token.lock(ESB_ASYNC_SIGNAL_ACTION_NAME);
+
+ final String transitionVariableName = ESB_ASYNC_SIGNAL_VARIABLE_NAME + tokenId ;
+ if (transitionName != null)
+ {
+ contextInstance.setVariable(transitionVariableName, transitionName) ;
+ }
+ else
+ {
+ contextInstance.deleteVariable(transitionVariableName) ;
+ }
+ final ExecuteActionJob signalJob = new ExecuteActionJob(token) ;
+ signalJob.setAction(getAsyncSignalAction(token)) ;
+ signalJob.setDueDate(new Date()) ;
+ signalJob.setSuspended(token.isSuspended()) ;
+
+ if (isDebugEnabled)
+ {
+ logger.debug("Sending signal task to message service for token id " + tokenId + " from process instance " + processInstanceId) ;
+ }
+ final MessageService messageService = (MessageService)Services.getCurrentService(Services.SERVICENAME_MESSAGE, true) ;
+ messageService.send(signalJob) ;
+ if (isDebugEnabled)
+ {
+ logger.debug("Sent signal task to message service for token id " + tokenId + " from process instance " + processInstanceId) ;
+ }
+ }
+
+ /**
+ * Locate the asynchronous signal action associated with the process instance.
+ * @param token The token to signal.
+ * @return The action used for asynchronous signalling.
+ * @throws JbpmException For errors creating or locating the action.
+ */
+ private static Action getAsyncSignalAction(final Token token)
+ throws JbpmException
+ {
+ final ProcessInstance processInstance = token.getProcessInstance() ;
+ final ProcessDefinition processDefinition = token.getProcessInstance().getProcessDefinition() ;
+ if (processDefinition == null)
+ {
+ throw new JbpmException("Could not locate process definition for process instance: " + processInstance.getId()) ;
+ }
+ final Action currentAction = token.getProcessInstance().getProcessDefinition().getAction(ESB_ASYNC_SIGNAL_ACTION_NAME) ;
+ if (currentAction!= null)
+ {
+ return currentAction ;
+ }
+
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("Creating Callback action for process definition: " + processDefinition.getName() + ", id: " + processDefinition.getId()) ;
+ }
+ final Delegation delegation = new Delegation(AsyncSignalAction.class.getName()) ;
+ delegation.setConfigType("constructor") ;
+ final Action newAction = new Action(delegation) ;
+ newAction.setName(ESB_ASYNC_SIGNAL_ACTION_NAME) ;
+ processDefinition.addAction(newAction) ;
+
+ return newAction ;
+ }
+
+ /**
+ * The task for asynchronously signalling the token.
+ * @author <a href='kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+ private static class AsyncSignalAction implements ActionHandler
+ {
+ /**
+ * Serial version UID for this action.
+ */
+ private static final long serialVersionUID = -1462271955979788905L;
+
+ /**
+ * Construct the signal job.
+ * @param configuration The configuration.
+ */
+ AsyncSignalAction(final String configuration)
+ throws JbpmException
+ {
+ }
+
+ /**
+ * Process the background signal task.
+ * @param executionContext The current execution context.
+ */
+ public void execute(final ExecutionContext executionContext)
+ throws Exception
+ {
+ final boolean isDebugEnabled = logger.isDebugEnabled() ;
+ final Token token = executionContext.getToken() ;
+ final long tokenId = token.getId() ;
+ if (isDebugEnabled)
+ {
+ logger.debug("Unlocking token id " + tokenId + " from process instance " +
+ token.getProcessInstance().getId()) ;
+ }
+ token.unlock(ESB_ASYNC_SIGNAL_ACTION_NAME) ;
+ if (isDebugEnabled)
+ {
+ logger.debug("Signaling task " + tokenId + " from process instance " +
+ token.getProcessInstance().getId()) ;
+ }
+ final ProcessInstance processInstance = token.getProcessInstance() ;
+ final ContextInstance contextInstance = processInstance.getContextInstance() ;
+ final String transitionName = (String)contextInstance.getVariable(ESB_ASYNC_SIGNAL_VARIABLE_NAME + tokenId) ;
+ final SignalCommand signalCommand = new SignalCommand(tokenId, transitionName) ;
+ signalCommand.execute(executionContext.getJbpmContext()) ;
+ if (isDebugEnabled)
+ {
+ logger.debug("Signalled task " + tokenId + " from process instance " +
+ token.getProcessInstance().getId()) ;
+ }
+ }
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,15 +1,34 @@
-/**
- *
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.soa.esb.services.jbpm.cmd;
-import java.util.List;
+import java.util.Map;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.services.jbpm.Constants;
import org.jbpm.JbpmContext;
-import org.jbpm.command.SignalCommand;
+import org.jbpm.command.Command;
+import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
@@ -17,29 +36,29 @@
* @author kstam
*
*/
-public class CallbackCommand extends SignalCommand {
+public class CallbackCommand implements Command {
- private Logger logger = Logger.getLogger(this.getClass());
+ private static Logger logger = Logger.getLogger(CallbackCommand.class);
/**
*
*/
private static final long serialVersionUID = 1L;
+
+ /**
+ * The named transition or null if the default is to be used.
+ */
+ private String transitionName ;
+ /**
+ * The variable map.
+ */
+ private Map variables ;
+
private EPR callbackEpr;
public CallbackCommand() {
super();
}
- public CallbackCommand(long tokenId, String transitionName) {
- super(tokenId, transitionName);
- }
-
- public CallbackCommand(long tokenId, String transitionName, EPR callbackEpr)
- {
- super(tokenId, transitionName);
- this.callbackEpr = callbackEpr;
- }
-
public EPR getCallbackEpr() {
return callbackEpr;
}
@@ -47,71 +66,69 @@
this.callbackEpr = callbackEpr;
}
+ public void setTransitionName(final String transitionName) {
+ this.transitionName = transitionName ;
+ }
+
+ public void setVariables(final Map variables) {
+ this.variables = variables ;
+ }
+
public Object execute(JbpmContext jbpmContext)
{
+ final boolean isDebugEnabled = logger.isDebugEnabled() ;
try {
- long tokenId = checkCurrentState(jbpmContext, callbackEpr);
- //if the state is ok, then goahead with the signalling the transition
- this.setTokenId(tokenId);
- return super.execute(jbpmContext);
+ long nodeId = Long.parseLong(callbackEpr.getAddr().getExtensionValue(Constants.NODE_ID));
+ long tokenId = Long.parseLong(callbackEpr.getAddr().getExtensionValue(Constants.TOKEN_ID));
+ long processInstanceId = Long.parseLong(callbackEpr.getAddr().getExtensionValue(Constants.PROCESS_INSTANCE_ID));
+ String counterName = Constants.PROCESS_NODE_VERSION_COUNTER + nodeId + '_' + tokenId;
+ long processNodeVersion = Long.parseLong(callbackEpr.getAddr().getExtensionValue(counterName));
+ if (isDebugEnabled) logger.debug("Expected nodeId=" + nodeId +
+ ", tokenId=" + tokenId + ", processNodeVersion=" + processNodeVersion);
+ //get update on current state of things.
+ final Token token = jbpmContext.getToken(tokenId) ;
+ if (token == null) {
+ throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " is no longer active") ;
+ }
+ final ProcessInstance instance = token.getProcessInstance() ;
+ if (instance == null) {
+ throw new CallbackException("Process instance " + processInstanceId + " is no longer active") ;
+ }
+ if (instance.getId() != processInstanceId) {
+ throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " now attached to process instance " + instance.getId()) ;
+ }
+
+ if (nodeId != token.getNode().getId()) {
+ throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " is no longer on expected node, expected " + nodeId + " but discovered " + token.getNode().getId()) ;
+ }
+ if (token.hasEnded()) {
+ throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " has already terminated") ;
+ }
+
+ if (token.isLocked()) {
+ throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " is already locked, another thread is active") ;
+ }
+
+ final ContextInstance contextInstance = instance.getContextInstance() ;
+ final long currentProcessNodeVersion = Long.parseLong(String.valueOf(
+ contextInstance.getVariable(counterName)));
+ if (isDebugEnabled) logger.debug("ProcessNodeVersion=" + currentProcessNodeVersion);
+ if (processNodeVersion!=currentProcessNodeVersion) {
+ throw new CallbackException("The current processNodeVersion (id=" + currentProcessNodeVersion +
+ ") is not the expected version (version=" + processNodeVersion + ").");
+ }
+
+ if (variables != null && variables.size() > 0) {
+ if (isDebugEnabled) {
+ logger.debug("Initialising variables for token id " + tokenId + " from process instance " + processInstanceId) ;
+ }
+ contextInstance.addVariables(variables);
+ }
+
+ AsyncProcessSignal.createSignalJob(token, transitionName) ;
} catch (CallbackException jbpmCe) {
logger.warn(jbpmCe.getMessage());
- return null;
}
+ return null;
}
-
- /**
- * Checks whether the current state in jBPM is the expected state. If so it returns the tokenId
- * on which we can invoke a signal.
- *
- * @param replyTo
- * @return
- * @throws CallbackException
- */
- protected long checkCurrentState(JbpmContext jbpmContext, EPR callbackEpr)
- throws CallbackException
- {
- long nodeId = Long.parseLong(callbackEpr.getAddr().getExtensionValue(Constants.NODE_ID));
- long tokenId = Long.parseLong(callbackEpr.getAddr().getExtensionValue(Constants.TOKEN_ID));
- long processInstanceId = Long.parseLong(callbackEpr.getAddr().getExtensionValue(Constants.PROCESS_INSTANCE_ID));
- String counterName = Constants.PROCESS_NODE_VERSION_COUNTER + nodeId + '_' + tokenId;
- long processNodeVersion = Long.parseLong(callbackEpr.getAddr().getExtensionValue(counterName));
- if (logger.isDebugEnabled()) logger.debug("Expected nodeId=" + nodeId +
- ", tokenId=" + tokenId + ", processNodeVersion=" + processNodeVersion);
- //get update on current state of things.
- ProcessInstance instance = jbpmContext.getProcessInstance(processInstanceId);
- if (instance == null) {
- throw new CallbackException("Process instance " + processInstanceId + " is no longer active") ;
- }
- List tokens = instance.findAllTokens();
- boolean discovered = false ;
- for (Object object : tokens) {
- Token token = (Token) object;
- if (token.getId()==tokenId) {
- if (nodeId != token.getNode().getId()) {
- throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " is no longer on expected node") ;
- }
- if (token.hasEnded()) {
- throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " has already terminated") ;
- }
- discovered = true ;
- break;
- }
- }
- if (!discovered) {
- throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " is no longer active") ;
- }
- //Compare current with expected
- //get the current processNode Version
- Long currentProcessNodeVersion = Long.parseLong(String.valueOf(
- instance.getContextInstance().getVariable(counterName)));
- if (logger.isDebugEnabled()) logger.debug("ProcessNodeVersion=" + currentProcessNodeVersion);
- if (processNodeVersion!=currentProcessNodeVersion) {
- throw new CallbackException("The current processNodeVersion (id=" + currentProcessNodeVersion +
- ") is not the expected version (version=" + processNodeVersion + ").");
- }
- return tokenId;
- }
-
-
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -34,13 +34,13 @@
import org.jboss.soa.esb.services.jbpm.Constants;
import org.jboss.soa.esb.services.jbpm.JBpmObjectMapper;
import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.command.CancelProcessInstanceCommand;
import org.jbpm.command.CommandService;
import org.jbpm.command.GetProcessInstanceCommand;
import org.jbpm.command.NewProcessInstanceCommand;
import org.jbpm.command.SignalCommand;
-import org.jbpm.command.StartProcessInstanceCommand;
import org.jbpm.command.impl.CommandServiceImpl;
import org.jbpm.graph.exe.ProcessInstance;
@@ -177,13 +177,10 @@
private void perform(Message request, boolean start)
{
ObjectMapper objectMapper = new ObjectMapper();
- NewProcessInstanceCommand command = null;
+ final NewProcessInstanceCommand command ;
if (start) {
- StartProcessInstanceCommand startCmd = new StartProcessInstanceCommand();
- String transition = MessageHelper.getStringValue(request, Constants.TRANSITION_NAME);
- if (null!=transition)
- startCmd.setStartTransitionName(transition);
- command = startCmd;
+ final String transition = MessageHelper.getStringValue(request, Constants.TRANSITION_NAME);
+ command = new AsyncStartProcessInstanceCommand(transition);
} else {
command = new NewProcessInstanceCommand();
}
@@ -241,6 +238,48 @@
return jbpmService;
}
-
-
+ /**
+ * Command responsible for creating a process instance and firing an asynchronous signal to the root node.
+ *
+ * @author <a href='kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+ private static class AsyncStartProcessInstanceCommand extends NewProcessInstanceCommand
+ {
+ /**
+ * The serial version UID for this class.
+ */
+ private static final long serialVersionUID = 7917063133912138584L;
+
+ /**
+ * The name of the transition to signal.
+ */
+ private final String transitionName ;
+
+ /**
+ * Create the asynchronous process instance command with the specified transition.
+ * @param transitionName The transition to signal or null if the default transition should be used.
+ */
+ AsyncStartProcessInstanceCommand(final String transitionName)
+ {
+ this.transitionName = transitionName ;
+ }
+
+ /**
+ * Execute the command.
+ * @param jbpmContext The current jBPM context.
+ * @throws Exception for any errors.
+ */
+ @Override
+ public Object execute(final JbpmContext jbpmContext)
+ throws Exception
+ {
+ final Object result = super.execute(jbpmContext) ;
+ if (result instanceof ProcessInstance)
+ {
+ final ProcessInstance processInstance = (ProcessInstance)result ;
+ AsyncProcessSignal.createSignalJob(processInstance.getRootToken(), transitionName) ;
+ }
+ return result ;
+ }
+ }
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -5,14 +5,14 @@
-->
<providers>
<!-- change the following element to jms-jca-provider to enable transactional context -->
- <jms-provider name="CallbackQueue-JMS-Provider" connection-factory="ConnectionFactory">
+ <jms-jca-provider name="CallbackQueue-JMS-Provider" connection-factory="ConnectionFactory">
<jms-bus busid="jBPMCallbackBus">
<jms-message-filter
dest-type="QUEUE"
dest-name="queue/CallbackQueue"
/>
</jms-bus>
- </jms-provider>
+ </jms-jca-provider>
</providers>
<services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm-ds.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm-ds.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm-ds.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
- <local-tx-datasource>
+ <xa-datasource>
<jndi-name>JbpmDS</jndi-name>
- <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}jbpmDB</connection-url>
- <driver-class>org.hsqldb.jdbcDriver</driver-class>
- <user-name>sa</user-name>
- <password></password>
+ <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
+ <track-connection-by-tx/>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ <xa-datasource-property name="URL">jdbc:h2:${jboss.server.data.dir}${/}h2${/}jbpmDB</xa-datasource-property>
+ <xa-datasource-property name="User">sa</xa-datasource-property>
+ <xa-datasource-property name="Password"></xa-datasource-property>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
- <depends>jboss:service=Hypersonic,database=jbpmDB</depends>
- </local-tx-datasource>
- <mbean code="org.jboss.jdbc.HypersonicDatabase"
- name="jboss:service=Hypersonic,database=jbpmDB">
- <attribute name="Database">jbpmDB</attribute>
- <attribute name="InProcessMode">true</attribute>
+ <depends>jboss:service=h2,database=jbpmDB</depends>
+ </xa-datasource>
+ <mbean code="org.jboss.internal.soa.esb.dependencies.H2Database"
+ name="jboss:service=h2,database=jbpmDB">
+ <attribute name="Database">jbpmDS</attribute>
</mbean>
-
</datasources>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm-service.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm-service.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm-service.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -12,6 +12,7 @@
jbpm-sql/import.sql
</attribute>
<depends>jboss.jca:service=DataSourceBinding,name=JbpmDS</depends>
+ <attribute name="UseEOL">true</attribute>
</mbean>
<mbean code="org.jboss.soa.esb.services.jbpm.configuration.JbpmService"
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/AsyncTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/AsyncTest.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/AsyncTest.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,167 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.services.jbpm.actionhandlers;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.graph.exe.Token;
-import org.junit.Before;
-import org.junit.Test;
-/**
- * Tests the capabilities of jBPM async, which we are using.
- *
- * @author kstam
- *
- */
-public class AsyncTest
-{
- private static String PROCESS_DEF_XML_ASYNC = "testAsync.xml";
- private static String PROCESS_DEF_XML_SYNC = "testSync.xml";
- private static Logger logger = Logger.getLogger(AsyncTest.class);
-
- /**
- * If the node *after* myNode is set to async="true", then the signal
- * command will return immediately, and run in a different transaction.
- *
- * @throws Exception
- */
- @Test
- public void sync() throws Exception
- {
- logger.info("Setting up jBPM");
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
-
- jbpmConfiguration.getJobExecutor().start();
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- //Extract a process definition from the processdefinition.xml file.
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(PROCESS_DEF_XML_SYNC);
- assertNotNull(processDefinition);
- //Create an instance of the process definition.
- jbpmContext.deployProcessDefinition(processDefinition);
- ProcessInstance processInstance = jbpmContext.newProcessInstance("testSync");
- long processInstanceId = processInstance.getId();
- assertTrue(
- "Instance is in start state",
- "start".equals(processInstance.getRootToken().getNode().getName()));
- jbpmContext.close();
-
- jbpmConfiguration = JbpmConfiguration.getInstance();
- jbpmContext = jbpmConfiguration.createJbpmContext();
- processInstance = jbpmContext.loadProcessInstance(processInstanceId);
-
- Token token = processInstance.getRootToken();
- processInstance.signal();
- assertEquals("mynode",token.getNode().getName());
- jbpmContext.close();
-
- long startTime = System.currentTimeMillis();
-// Send mynode a signal such that it goes to wait2seconds
- jbpmContext = jbpmConfiguration.createJbpmContext();
- processInstance = jbpmContext.loadProcessInstance(processInstanceId);
- processInstance.signal();
- jbpmContext.save(processInstance);
- jbpmContext.close();
-
- jbpmContext = jbpmConfiguration.createJbpmContext();
- processInstance = jbpmContext.loadProcessInstance(processInstanceId);
- token = processInstance.getRootToken();
-// Check that we are now in the end node.
- String currentNode = token.getNode().getName();
- long endTime = System.currentTimeMillis();
- assertEquals("end",currentNode);
- jbpmContext.close();
- long elapsedMillies = endTime - startTime;
- System.out.println("async elapsedMillies=" + elapsedMillies);
- assertTrue(elapsedMillies > 2000);
- }
-
- /**
- * If the node *after* myNode is set to async="true", then the signal
- * command will return immediately, and run in a different transaction.
- *
- * @throws Exception
- */
- @Test
- public void async() throws Exception
- {
- logger.info("Setting up jBPM");
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
-
- jbpmConfiguration.getJobExecutor().start();
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- //Extract a process definition from the processdefinition.xml file.
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(PROCESS_DEF_XML_ASYNC);
- assertNotNull(processDefinition);
- //Create an instance of the process definition.
- jbpmContext.deployProcessDefinition(processDefinition);
- ProcessInstance processInstance = jbpmContext.newProcessInstance("testAsync");
- long processInstanceId = processInstance.getId();
- assertTrue(
- "Instance is in start state",
- "start".equals(processInstance.getRootToken().getNode().getName()));
- jbpmContext.close();
-
- jbpmConfiguration = JbpmConfiguration.getInstance();
- jbpmContext = jbpmConfiguration.createJbpmContext();
- processInstance = jbpmContext.loadProcessInstance(processInstanceId);
-
- Token token = processInstance.getRootToken();
- processInstance.signal();
- assertEquals("mynode",token.getNode().getName());
- jbpmContext.close();
-
- long startTime = System.currentTimeMillis();
-// Send mynode a signal such that it goes to wait2seconds
- jbpmContext = jbpmConfiguration.createJbpmContext();
- processInstance = jbpmContext.loadProcessInstance(processInstanceId);
- processInstance.signal();
- jbpmContext.save(processInstance);
- jbpmContext.close();
-
- jbpmContext = jbpmConfiguration.createJbpmContext();
- processInstance = jbpmContext.loadProcessInstance(processInstanceId);
- token = processInstance.getRootToken();
-// Check that we are now in the end node.
- String currentNode = token.getNode().getName();
- long endTime = System.currentTimeMillis();
- assertEquals("wait2seconds",currentNode);
- jbpmContext.close();
- long elapsedMillies = endTime - startTime;
- System.out.println("async elapsedMillies=" + elapsedMillies);
- assertTrue(elapsedMillies < 2000);
- }
-
- public static junit.framework.Test suite(){
- return new JUnit4TestAdapter(AsyncTest.class);
- }
-
-}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/Wait2SecondsAction.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/Wait2SecondsAction.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/Wait2SecondsAction.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,31 +0,0 @@
-/**
- *
- */
-package org.jboss.soa.esb.services.jbpm.actionhandlers;
-
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.exe.ExecutionContext;
-
-/**
- * @author kstam
- *
- */
-
-public class Wait2SecondsAction implements ActionHandler{
-
- private static final long serialVersionUID = 1L;
-
- public void execute (ExecutionContext executionContext) throws Exception
- {
- for (int i=0; i<2; i++){
- try {
- Thread.sleep(1000);
- System.out.println("Waited " + (i+1) + " seconds");
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- System.out.println("Done Waiting");
- }
-
-}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/.gpd.testAsync.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/.gpd.testAsync.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/.gpd.testAsync.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process-diagram name="testAsync" width="647" height="644">
- <node name="start" x="78" y="32" width="140" height="40">
- <transition name="toExtraNode">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="extranode" x="0" y="0" width="140" height="40">
- <transition name="toMyNode">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="mynode" x="80" y="191" width="140" height="40">
- <transition name="toWait2Seconds">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="wait2seconds" x="74" y="275" width="140" height="40">
- <transition name="toEnd">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="end" x="79" y="402" width="140" height="40"/>
-</process-diagram>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/.gpd.testSync.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/.gpd.testSync.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/.gpd.testSync.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process-diagram name="testSync" width="645" height="584">
- <node name="start" x="0" y="0" width="140" height="40">
- <transition name="toExtraNode">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="extranode" x="0" y="0" width="140" height="40">
- <transition name="toMyNode">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="mynode" x="0" y="0" width="140" height="40">
- <transition name="toWait2Seconds">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="wait2seconds" x="0" y="0" width="140" height="40">
- <transition name="toEnd">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="end" x="0" y="0" width="140" height="40"/>
-</process-diagram>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testAsync.jpg
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testAsync.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testAsync.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testAsync.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process-definition
- xmlns="urn:jbpm.org:jpdl-3.2"
- name="testAsync">
- <start-state name="start">
- <transition name="toExtraNode" to="extranode"></transition>
- </start-state>
- <node name="extranode">
- <transition name="toMyNode" to="mynode"></transition>
- </node>
- <node name="mynode" >
- <action name="dummy" class="org.jboss.soa.esb.services.jbpm.actionhandlers.DummyAction"/>
- <transition name="toWait2Seconds" to="wait2seconds" />
- </node>
- <node name="wait2seconds" async="true">
- <transition name="toEnd" to="end">
- <action name="wait2seconds" class="org.jboss.soa.esb.services.jbpm.actionhandlers.Wait2SecondsAction"/>
- </transition>
- </node>
- <end-state name="end"></end-state>
-</process-definition>
\ No newline at end of file
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testSync.jpg
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testSync.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testSync.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testSync.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process-definition
- xmlns="urn:jbpm.org:jpdl-3.2"
- name="testSync">
- <start-state name="start">
- <transition name="toExtraNode" to="extranode"></transition>
- </start-state>
- <node name="extranode">
- <transition name="toMyNode" to="mynode"></transition>
- </node>
- <node name="mynode" >
- <action name="dummy" class="org.jboss.soa.esb.services.jbpm.actionhandlers.DummyAction"/>
- <transition name="toWait2Seconds" to="wait2seconds" />
- </node>
- <node name="wait2seconds">
- <transition name="toEnd" to="end">
- <action name="wait2seconds" class="org.jboss.soa.esb.services.jbpm.actionhandlers.Wait2SecondsAction"/>
- </transition>
- </node>
- <end-state name="end"></end-state>
-</process-definition>
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/skip.properties-example
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/skip.properties-example 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/skip.properties-example 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,7 +1,8 @@
#
# The following properties should be added or removed if you want to skip those
-# parts of the build. Adding all of these skips cuts "ant clean dist" on my
-# machine down from about 3m30s to about 1m10s. Without the clean it's about 55s
+# parts of the build. Adding all of these skips cuts "ant clean dist" on a sample
+# machine down from about 3m30s to about 1m10s. Without the clean it's about 55s.
+# Without the tests it is even less.
#
#
@@ -13,3 +14,4 @@
#skip.server.esb=true
#skip.docs=true
#skip.samples=true
+#skip.tests=true
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -10,15 +10,19 @@
<property name="product.dir" location="../product"/>
<property name="build.location" location="build"/>
+ <property file="test.properties" />
<import file="${product.dir}/esb-config.xml"/>
<property name="org.jboss.esb.properties" location="${product.dir}/product.properties"/>
<property file="${org.jboss.esb.properties}"/>
-
- <property file="test.properties" />
+
<property name="org.jboss.esb.test.quickstarts.dir" location="${product.dir}/build/jbossesb/samples/quickstarts"/>
+ <propertyset id="soa.props">
+ <propertyref regex="soa.test.*"/>
+ </propertyset>
+
<property name="junit.jar" location="lib/ext/junit-4.1.jar"/>
<macrodef name="runant">
<attribute name="target"/>
@@ -29,9 +33,10 @@
classpath="${ant.library.dir}/ant-launcher.jar"
fork="true" failonerror="@{failonerror}"
resultproperty="@{resultproperty}">
+ <syspropertyset refid="soa.props"/>
<sysproperty key="ant.home" value="${ant.home}"/>
<sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
- <sysproperty key="org.jboss.esb.properties" value="${org.jboss.esb.properties}"/>
+ <sysproperty key="org.jboss.esb.properties" value="${org.jboss.esb.properties}"/>
<arg value="-cp"/>
<arg value="${junit.jar}"/>
<arg value="-f"/>
@@ -42,8 +47,29 @@
</macrodef>
<target name="test" description="Run all QA tests." depends="test.junit"/>
+
+ <target name="soa-test" description="Run tests on the SOA server.">
+ <property name="soa.test.no-prepare" value="true"/>
+ <property name="server.timeout.seconds" value="240"/>
+ <antcall target="start-server">
+ <param name="no-prepare" value="true"/>
+ <param name="org.jboss.esb.server.config" value="all"/>
+ </antcall>
+ <runant target="ci-test.junit"
+ failonerror="false" resultproperty="integration.qa.resultproperty"/>
+
+ <antcall target="stop-server"/>
+
+ <condition property="integration.qa.tests.failed">
+ <not>
+ <equals arg1="0" arg2="${integration.qa.resultproperty}"/>
+ </not>
+ </condition>
+ <fail if="integration.qa.tests.failed" message="QA Unit Test failure"/>
+ </target>
<target name="ci-test" description="Run all QA tests.">
+ <property name="server.timeout.seconds" value="120"/>
<antcall target="start-server"/>
<runant target="ci-test.junit"
failonerror="false" resultproperty="integration.qa.resultproperty"/>
@@ -67,7 +93,7 @@
</target>
<target name="ci-test.junit" depends="esb.init" description="Run JUnit based QA tests.">
- <ant dir="junit" target="ci-test" />
+ <!--<ant dir="junit" target="ci-test" />-->
<ant dir="quickstarts" target="ci-test" />
</target>
@@ -76,16 +102,17 @@
<delete dir="${build.location}" />
</target>
-
+
<target name="start-server" depends="esb.setup-esb">
<echo>server ${org.jboss.esb.server.home} ${org.jboss.esb.test.server.config}</echo>
+ <property name="server.timeout.seconds" value="120"/>
<start-server serverHome="${org.jboss.esb.server.home}"
serverConfig="${org.jboss.esb.test.server.config}">
<sysproperty key="build.dir" value="${build.location}"/>
<jvmarg value="-Xmx512m"/>
<jvmarg value="-Xms512m"/>
</start-server>
- <wait-on-server/>
+ <wait-on-server seconds="${server.timeout.seconds}"/>
</target>
<target name="stop-server" depends="esb.init">
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/build.xml 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/build.xml 2008-02-06 14:27:36 UTC (rev 18346)
@@ -27,6 +27,7 @@
excludes="*.jar" includes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
<fileset dir="${qa.lib}/ext" includes="*.jar"/>
<fileset dir="${product.lib}/ext" includes="*.jar"/>
+ <fileset dir="${product.lib}/jbpm.esb" includes="*.jar"/>
<pathelement location="../"/>
</path>
@@ -136,6 +137,17 @@
<include name="META-INF/*.xml"/>
</fileset>
</jar>
+ <jar jarfile="${qa.build.lib}/jbpm-async-test.esb">
+ <fileset dir="${qa.junit.classes}">
+ <include name="org/jboss/soa/esb/server/jbpmAsync/*.class"/>
+ </fileset>
+ <fileset dir="${qa.junit.resources}/server/jbpmAsync">
+ <include name="esb-${org.jboss.soa.esb.qa.jmsprovider}-service.xml"/>
+ <include name="test-jbpm-service.xml"/>
+ <include name="jbpmAsyncTest.xml"/>
+ <include name="META-INF/*.xml"/>
+ </fileset>
+ </jar>
</target>
<target name="one-test" if="test" depends="jars"
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,71 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.server.jbpmAsync;
-
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-
-import org.jboss.mx.util.MBeanProxyExt;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Action class to attempt a suspend of a running jBPM process.
- *
- * @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
- */
-public class EchoSuspendAction extends AbstractActionLifecycle implements ActionPipelineProcessor
-{
- public EchoSuspendAction(final ConfigTree config)
- {
- }
-
- public Message process(final Message message)
- throws ActionProcessingException
- {
- final MBeanServer server = MBeanServerLocator.locateJBoss();
-
- final JbpmServerMBean jbpmServer ;
- try
- {
- jbpmServer = (JbpmServerMBean) MBeanProxyExt.create(JbpmServerMBean.class, JbpmServerMBean.OBJECT_NAME, server);
- }
- catch (final MalformedObjectNameException mone)
- {
- throw new ActionProcessingException("Error creating MBean proxy", mone) ;
- }
- jbpmServer.suspendProcessInstance() ;
- return message;
- }
-
- public void processException(final Message message, final Throwable th)
- {
- }
-
- public void processSuccess(final Message message)
- {
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server.jbpmAsync;
+
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+
+import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Action class to attempt a suspend of a running jBPM process.
+ *
+ * @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
+ */
+public class EchoSuspendAction extends AbstractActionLifecycle implements ActionPipelineProcessor
+{
+ public EchoSuspendAction(final ConfigTree config)
+ {
+ }
+
+ public Message process(final Message message)
+ throws ActionProcessingException
+ {
+ final MBeanServer server = MBeanServerLocator.locateJBoss();
+
+ final JbpmServerMBean jbpmServer ;
+ try
+ {
+ jbpmServer = (JbpmServerMBean) MBeanProxyExt.create(JbpmServerMBean.class, JbpmServerMBean.OBJECT_NAME, server);
+ }
+ catch (final MalformedObjectNameException mone)
+ {
+ throw new ActionProcessingException("Error creating MBean proxy", mone) ;
+ }
+ jbpmServer.suspendProcessInstance() ;
+ return message;
+ }
+
+ public void processException(final Message message, final Throwable th)
+ {
+ }
+
+ public void processSuccess(final Message message)
+ {
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,131 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.server.jbpmAsync;
-
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.exe.ExecutionContext;
-
-/**
- * Action Handler for jBPM Async test.
- */
-public class JbpmAsyncActionHandler implements ActionHandler
-{
- /**
- * Serial version UID for this class.
- */
- private static final long serialVersionUID = 6205275164157280372L;
-
- /**
- * The notification lock.
- */
- private static final Lock NOTIFICATION_LOCK = new ReentrantLock() ;
-
- /**
- * The notification condition.
- */
- private static Condition NOTIFICATION_CONDITION = NOTIFICATION_LOCK.newCondition() ;
-
- /**
- * The waiting flag.
- */
- private static boolean waiting ;
- /**
- * The notified flag.
- */
- private static boolean notified ;
-
- /**
- * Wait for a notification from the test.
- */
- public void execute(final ExecutionContext executionContext)
- throws Exception
- {
- if (!waitForNotification(60000L))
- {
- throw new Exception("Notification failed") ;
- }
- }
-
- /**
- * Notify the action.
- * @param delay The maximum delay waiting for the action.
- * @return true if waiting, false otherwise.
- */
- public static boolean notifyAction(final long delay)
- {
- NOTIFICATION_LOCK.lock() ;
- try
- {
- if (!waiting)
- {
- try
- {
- NOTIFICATION_CONDITION.await(delay, TimeUnit.MILLISECONDS) ;
- }
- catch (final InterruptedException ie) {}
- }
-
- if (waiting)
- {
- notified = true ;
- NOTIFICATION_CONDITION.signal() ;
- }
- return waiting ;
- }
- finally
- {
- NOTIFICATION_LOCK.unlock() ;
- }
- }
-
- /**
- * Wait for a notification from the test.
- * @param delay The maximum delay waiting for notification.
- * @return true if notified, false otherwise.
- */
- private static boolean waitForNotification(final long delay)
- {
- NOTIFICATION_LOCK.lock() ;
- waiting = true ;
- try
- {
- NOTIFICATION_CONDITION.signal() ;
- try
- {
- NOTIFICATION_CONDITION.await(delay, TimeUnit.MILLISECONDS) ;
- }
- catch (final InterruptedException ie) {}
- return notified ;
- }
- finally
- {
- waiting = false ;
- notified = false ;
- NOTIFICATION_LOCK.unlock() ;
- }
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.server.jbpmAsync;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+/**
+ * Action Handler for jBPM Async test.
+ */
+public class JbpmAsyncActionHandler implements ActionHandler
+{
+ /**
+ * Serial version UID for this class.
+ */
+ private static final long serialVersionUID = 6205275164157280372L;
+
+ /**
+ * The notification lock.
+ */
+ private static final Lock NOTIFICATION_LOCK = new ReentrantLock() ;
+
+ /**
+ * The notification condition.
+ */
+ private static Condition NOTIFICATION_CONDITION = NOTIFICATION_LOCK.newCondition() ;
+
+ /**
+ * The waiting flag.
+ */
+ private static boolean waiting ;
+ /**
+ * The notified flag.
+ */
+ private static boolean notified ;
+
+ /**
+ * Wait for a notification from the test.
+ */
+ public void execute(final ExecutionContext executionContext)
+ throws Exception
+ {
+ if (!waitForNotification(60000L))
+ {
+ throw new Exception("Notification failed") ;
+ }
+ }
+
+ /**
+ * Notify the action.
+ * @param delay The maximum delay waiting for the action.
+ * @return true if waiting, false otherwise.
+ */
+ public static boolean notifyAction(final long delay)
+ {
+ NOTIFICATION_LOCK.lock() ;
+ try
+ {
+ if (!waiting)
+ {
+ try
+ {
+ NOTIFICATION_CONDITION.await(delay, TimeUnit.MILLISECONDS) ;
+ }
+ catch (final InterruptedException ie) {}
+ }
+
+ if (waiting)
+ {
+ notified = true ;
+ NOTIFICATION_CONDITION.signal() ;
+ }
+ return waiting ;
+ }
+ finally
+ {
+ NOTIFICATION_LOCK.unlock() ;
+ }
+ }
+
+ /**
+ * Wait for a notification from the test.
+ * @param delay The maximum delay waiting for notification.
+ * @return true if notified, false otherwise.
+ */
+ private static boolean waitForNotification(final long delay)
+ {
+ NOTIFICATION_LOCK.lock() ;
+ waiting = true ;
+ try
+ {
+ NOTIFICATION_CONDITION.signal() ;
+ try
+ {
+ NOTIFICATION_CONDITION.await(delay, TimeUnit.MILLISECONDS) ;
+ }
+ catch (final InterruptedException ie) {}
+ return notified ;
+ }
+ finally
+ {
+ waiting = false ;
+ notified = false ;
+ NOTIFICATION_LOCK.unlock() ;
+ }
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.server.jbpmAsync;
-
-import javax.management.ObjectName;
-
-import junit.framework.Test;
-
-import org.jboss.test.JBossTestCase;
-
-/**
- * Test asynchronous callbacks for jBPM processes.
- *
- * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
- */
-public class JbpmAsyncUnitTest extends JBossTestCase
-{
- /**
- * The name of the deployment archive.
- */
- private static final String ESB_ARCHIVE = "jbpm-async-test.esb" ;
-
- /**
- * Construct the test case with the specified name.
- * @param name The name of the test case.
- */
- public JbpmAsyncUnitTest(final String name)
- {
- super(name) ;
- }
-
- /**
- * Test for normal asynchronous callback.
- * @throws Exception For any failures.
- */
- public void testAsyncCallback()
- throws Exception
- {
- execute("setSuspendProcess", new Object[] {Boolean.FALSE}, new String[] {Boolean.TYPE.getName()}) ;
- execute("startProcess", null, null) ;
-
- final Boolean result = (Boolean)execute("checkWaitingAction", new Object[] {new Long(10000L)}, new String[] {Long.TYPE.getName()}) ;
- assertEquals("checkWaitingAction", Boolean.TRUE, result) ;
- }
- /**
- * Test for asynchronous callback on a suspended process.
- * @throws Exception For any failures.
- */
- public void testSuspendedAsyncCallback()
- throws Exception
- {
- execute("setSuspendProcess", new Object[] {Boolean.TRUE}, new String[] {Boolean.TYPE.getName()}) ;
- execute("startProcess", null, null) ;
-
- final Boolean suspendedResult = (Boolean)execute("checkWaitingAction", new Object[] {new Long(10000L)}, new String[] {Long.TYPE.getName()}) ;
- assertEquals("checkWaitingAction", Boolean.FALSE, suspendedResult) ;
-
- execute("resumeProcessInstance", null, null) ;
-
- final Boolean resumedResult = (Boolean)execute("checkWaitingAction", new Object[] {new Long(30000L)}, new String[] {Long.TYPE.getName()}) ;
- assertEquals("checkWaitingAction", Boolean.TRUE, resumedResult) ;
- }
-
- /**
- * Execute the specified method on the mbean.
- * @param method The method name.
- * @param values The parmeter values.
- * @param types The parameter types.
- * @return The method return value.
- * @throws Exception For errors during invocation.
- */
- private Object execute(final String method, final Object[] values, final String[] types)
- throws Exception
- {
- return getServer().invoke(new ObjectName(JbpmServerMBean.OBJECT_NAME), method, values, types) ;
- }
-
- /**
- * Create the test suite.
- * @return The suite representing this test case.
- */
- public static Test suite()
- throws Exception
- {
- return getDeploySetup(JbpmAsyncUnitTest.class, ESB_ARCHIVE);
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.server.jbpmAsync;
+
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Test asynchronous callbacks for jBPM processes.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+public class JbpmAsyncUnitTest extends JBossTestCase
+{
+ /**
+ * The name of the deployment archive.
+ */
+ private static final String ESB_ARCHIVE = "jbpm-async-test.esb" ;
+
+ /**
+ * Construct the test case with the specified name.
+ * @param name The name of the test case.
+ */
+ public JbpmAsyncUnitTest(final String name)
+ {
+ super(name) ;
+ }
+
+ /**
+ * Test for normal asynchronous callback.
+ * @throws Exception For any failures.
+ */
+ public void testAsyncCallback()
+ throws Exception
+ {
+ execute("setSuspendProcess", new Object[] {Boolean.FALSE}, new String[] {Boolean.TYPE.getName()}) ;
+ execute("startProcess", null, null) ;
+
+ final Boolean result = (Boolean)execute("checkWaitingAction", new Object[] {new Long(10000L)}, new String[] {Long.TYPE.getName()}) ;
+ assertEquals("checkWaitingAction", Boolean.TRUE, result) ;
+ }
+ /**
+ * Test for asynchronous callback on a suspended process.
+ * @throws Exception For any failures.
+ */
+ public void testSuspendedAsyncCallback()
+ throws Exception
+ {
+ execute("setSuspendProcess", new Object[] {Boolean.TRUE}, new String[] {Boolean.TYPE.getName()}) ;
+ execute("startProcess", null, null) ;
+
+ final Boolean suspendedResult = (Boolean)execute("checkWaitingAction", new Object[] {new Long(10000L)}, new String[] {Long.TYPE.getName()}) ;
+ assertEquals("checkWaitingAction", Boolean.FALSE, suspendedResult) ;
+
+ execute("resumeProcessInstance", null, null) ;
+
+ final Boolean resumedResult = (Boolean)execute("checkWaitingAction", new Object[] {new Long(30000L)}, new String[] {Long.TYPE.getName()}) ;
+ assertEquals("checkWaitingAction", Boolean.TRUE, resumedResult) ;
+ }
+
+ /**
+ * Execute the specified method on the mbean.
+ * @param method The method name.
+ * @param values The parmeter values.
+ * @param types The parameter types.
+ * @return The method return value.
+ * @throws Exception For errors during invocation.
+ */
+ private Object execute(final String method, final Object[] values, final String[] types)
+ throws Exception
+ {
+ return getServer().invoke(new ObjectName(JbpmServerMBean.OBJECT_NAME), method, values, types) ;
+ }
+
+ /**
+ * Create the test suite.
+ * @return The suite representing this test case.
+ */
+ public static Test suite()
+ throws Exception
+ {
+ return getDeploySetup(JbpmAsyncUnitTest.class, ESB_ARCHIVE);
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,100 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.server.jbpmAsync;
-
-import java.io.InputStream;
-
-import org.jboss.soa.esb.util.ClassUtil;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * MBean to manage jBPM Asynchronous callback tests.
- *
- * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
- */
-public class JbpmServer implements JbpmServerMBean
-{
- private static final String PROCESS_DEFINITION = "/jbpmAsyncTest.xml" ;
-
- private boolean suspendProcess ;
-
- private long processInstanceId ;
-
- public synchronized void startProcess()
- {
- final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
- final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
-
- // Create process definition
- final InputStream is = ClassUtil.getResourceAsStream(PROCESS_DEFINITION, getClass()) ;
- final ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(is) ;
- jbpmContext.deployProcessDefinition(processDefinition) ;
-
- // Create process instance
- final ProcessInstance processInstance = jbpmContext.newProcessInstance(processDefinition.getName()) ;
- processInstanceId = processInstance.getId() ;
-
- // Start process instance
- processInstance.signal() ;
-
- jbpmContext.close() ;
- }
-
- public synchronized void suspendProcessInstance()
- {
- if (suspendProcess)
- {
- final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
- final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
-
- final ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId) ;
- processInstance.suspend() ;
-
- jbpmContext.close() ;
- }
- }
-
- public synchronized void resumeProcessInstance()
- {
- if (suspendProcess)
- {
- final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
- final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
-
- final ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId) ;
- processInstance.resume() ;
-
- jbpmContext.close() ;
- }
- }
-
- public synchronized void setSuspendProcess(final boolean suspendProcess)
- {
- this.suspendProcess = suspendProcess ;
- }
-
- public boolean checkWaitingAction(final long delay)
- {
- return JbpmAsyncActionHandler.notifyAction(delay) ;
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.server.jbpmAsync;
+
+import java.io.InputStream;
+
+import org.jboss.soa.esb.util.ClassUtil;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * MBean to manage jBPM Asynchronous callback tests.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+public class JbpmServer implements JbpmServerMBean
+{
+ private static final String PROCESS_DEFINITION = "/jbpmAsyncTest.xml" ;
+
+ private boolean suspendProcess ;
+
+ private long processInstanceId ;
+
+ public synchronized void startProcess()
+ {
+ final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
+ final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
+
+ // Create process definition
+ final InputStream is = ClassUtil.getResourceAsStream(PROCESS_DEFINITION, getClass()) ;
+ final ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(is) ;
+ jbpmContext.deployProcessDefinition(processDefinition) ;
+
+ // Create process instance
+ final ProcessInstance processInstance = jbpmContext.newProcessInstance(processDefinition.getName()) ;
+ processInstanceId = processInstance.getId() ;
+
+ // Start process instance
+ processInstance.signal() ;
+
+ jbpmContext.close() ;
+ }
+
+ public synchronized void suspendProcessInstance()
+ {
+ if (suspendProcess)
+ {
+ final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
+ final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
+
+ final ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId) ;
+ processInstance.suspend() ;
+
+ jbpmContext.close() ;
+ }
+ }
+
+ public synchronized void resumeProcessInstance()
+ {
+ if (suspendProcess)
+ {
+ final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
+ final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
+
+ final ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId) ;
+ processInstance.resume() ;
+
+ jbpmContext.close() ;
+ }
+ }
+
+ public synchronized void setSuspendProcess(final boolean suspendProcess)
+ {
+ this.suspendProcess = suspendProcess ;
+ }
+
+ public boolean checkWaitingAction(final long delay)
+ {
+ return JbpmAsyncActionHandler.notifyAction(delay) ;
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java 2008-02-06 14:09:06 UTC (rev 18345)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.server.jbpmAsync;
-
-/**
- * MBean to manage jBPM Asynchronous callback tests.
- *
- * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
- */
-public interface JbpmServerMBean
-{
- public static final String OBJECT_NAME="jboss.esb:test=JbpmServer" ;
-
- public void startProcess() ;
-
- public void suspendProcessInstance() ;
-
- public void resumeProcessInstance() ;
-
- public void setSuspendProcess(final boolean suspend) ;
-
- public boolean checkWaitingAction(final long delay) ;
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java (from rev 18345, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR10/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java 2008-02-06 14:27:36 UTC (rev 18346)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.server.jbpmAsync;
+
+/**
+ * MBean to manage jBPM Asynchronous callback tests.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+public interface JbpmServerMBean
+{
+ public static final String OBJECT_NAME="jboss.esb:test=JbpmServer" ;
+
+ public void startProcess() ;
+
+ public void suspendProcessInstance() ;
+
+ public void resumeProcessInstance() ;
+
+ public void setSuspendProcess(final boolean suspend) ;
+
+ public boolean checkWaitingAction(final long delay) ;
+}
More information about the jboss-svn-commits
mailing list