[jboss-svn-commits] JBL Code SVN: r18679 - in labs/jbossesb/trunk: product and 242 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Mar 4 11:24:25 EST 2008
Author: kevin.conner at jboss.com
Date: 2008-03-04 11:24:20 -0500 (Tue, 04 Mar 2008)
New Revision: 18679
Added:
labs/jbossesb/trunk/product/docs/services/WS-BPEL.odt
labs/jbossesb/trunk/product/docs/services/jBPMIntegrationGuide.odt
labs/jbossesb/trunk/product/docs/services/jBPMIntegrationGuide.pdf
labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml.template
labs/jbossesb/trunk/product/lib/ext/h2.jar
labs/jbossesb/trunk/product/lib/ext/juddi-2.0rc5.jar
labs/jbossesb/trunk/product/lib/ext/juddi-client-2.0rc5.jar
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierIntegrationTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/OtherAggregatorUnitTest.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_attachment.ser
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_body.ser
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.ser
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_properties.ser
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_attachment.ser
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_body.ser
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.ser
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_properties.ser
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java
labs/jbossesb/trunk/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/CBRRules.drl
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Discount_Rules.drl
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/MyRoutingRules.drl
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Priority_Rules.drl
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SampleOrder.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SamplePetsOrder.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/altered_jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/Readme.odt
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/Readme.pdf
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/images/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/lib/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/Review_Order.xhtml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/forms.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/gpd.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processdefinition.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processimage.jpg
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/check-origin.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/discount_service.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/display.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/fixer.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/intake_service.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_discount.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_key.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_priority.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/shipping_service.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/smooks-config.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SetupMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SimpleJMSNotifier.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessageStart.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/Customer.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderHeader.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderItem.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/StoreAction.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-dvdstore.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-petstore.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/lib/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/lib/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldsqlaction/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java
labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/quickstart-ds.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb/create.sql
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/DBInsertAction.java
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/ThrowExceptionAction.java
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/JMXAttributeFinder.java
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/LGCallbackHandler.java
labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/rss.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java
labs/jbossesb/trunk/product/services/jbpm/ant-task/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build.xml
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/org/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/org/jbpm/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/org/jbpm/ant/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/DeployProcessToServerTask.java
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/ProcessDeployer.java
labs/jbossesb/trunk/product/services/jbpm/lib/ext/jbpm-ant.jar
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java
labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbm-queue-service.xml
labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbmq-queue-service.xml
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/DummyAction.java
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/ExceptionFlowTest.java
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/TimerTest.java
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.jpg
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/jbpm.cfg.xml
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testExceptionHandling.jpg
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testExceptionHandling.xml
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testMappingDefinition.jpg
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testTimer.jpg
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testTimer.xml
labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/WEB-INF/
labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/WEB-INF/jboss-web.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/deployment.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/jboss-esb.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbm-service.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbmq-service.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/jbpmAsyncTest.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/test-jbpm-service.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java
labs/jbossesb/trunk/qa/quickstarts/resources/server/
labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF/
labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF/jboss-service.xml
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AggregatorTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/CustomActionTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/GroovyGatewayTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSSecuredTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/NativeClientTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java
Removed:
labs/jbossesb/trunk/product/docs/advanced/ServiceOrchestration.odt
labs/jbossesb/trunk/product/docs/advanced/ServiceOrchestration.pdf
labs/jbossesb/trunk/product/install/jUDDI-registry/build.xml
labs/jbossesb/trunk/product/install/jaxb.xslt
labs/jbossesb/trunk/product/lib/ext/juddi-20071022.191630-27.jar
labs/jbossesb/trunk/product/lib/ext/juddi-client-20071022.191630-6.jar
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/CBRRules.drl
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Discount_Rules.drl
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/MyRoutingRules.drl
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Priority_Rules.drl
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SampleOrder.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SamplePetsOrder.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/altered_jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/Readme.odt
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/Readme.pdf
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/images/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/lib/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/Review_Order.xhtml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/forms.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/gpd.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processdefinition.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processimage.jpg
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/check-origin.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/discount_service.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/display.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/fixer.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/intake_service.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_discount.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_key.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_priority.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/shipping_service.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/smooks-config.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SetupMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SimpleJMSNotifier.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessageStart.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/Customer.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderHeader.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderItem.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/StoreAction.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-dvdstore.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-petstore.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/lib/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/lib/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldsqlaction/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/quickstart-ds.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb/create.sql
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/DBInsertAction.java
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/ThrowExceptionAction.java
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/JMXAttributeFinder.java
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/LGCallbackHandler.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build.xml
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/org/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/org/jbpm/
labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/org/jbpm/ant/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/DeployProcessToServerTask.java
labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/ProcessDeployer.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/CommandExecutorFactory.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/MessageFacadeFactory.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/impl/
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/util/
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/jbossws/
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/wsf/
labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/WEB-INF/jboss-web.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/deployment.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/jboss-esb.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbm-service.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbmq-service.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/jbpmAsyncTest.xml
labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/test-jbpm-service.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java
labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF/
labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF/jboss-service.xml
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/util/
Modified:
labs/jbossesb/trunk/
labs/jbossesb/trunk/product/
labs/jbossesb/trunk/product/build.xml
labs/jbossesb/trunk/product/docs/AdministrationGuide.odt
labs/jbossesb/trunk/product/docs/GettingStarted.odt
labs/jbossesb/trunk/product/docs/MessageActionGuide.odt
labs/jbossesb/trunk/product/docs/MessageActionGuide.pdf
labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
labs/jbossesb/trunk/product/docs/ReleaseNotes.odt
labs/jbossesb/trunk/product/docs/advanced/SOAConcepts.odt
labs/jbossesb/trunk/product/docs/advanced/WebServices.odt
labs/jbossesb/trunk/product/docs/governance/MonitoringGuide.odt
labs/jbossesb/trunk/product/docs/samples/TBGuide.odt
labs/jbossesb/trunk/product/docs/services/ContentBasedRouting.odt
labs/jbossesb/trunk/product/docs/services/MessageStore.odt
labs/jbossesb/trunk/product/docs/services/MessageTransformation.odt
labs/jbossesb/trunk/product/docs/services/Registry.odt
labs/jbossesb/trunk/product/docs/services/Registry.pdf
labs/jbossesb/trunk/product/docs/wiki/FilesToGenerate.txt
labs/jbossesb/trunk/product/esb-config.xml
labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd
labs/jbossesb/trunk/product/install/Deployment.txt
labs/jbossesb/trunk/product/install/build.xml
labs/jbossesb/trunk/product/install/jUDDI-registry/juddi.war
labs/jbossesb/trunk/product/install/standalone/jbossesb-server-base.zip
labs/jbossesb/trunk/product/lib/Licenses.txt
labs/jbossesb/trunk/product/plugins/org.jboss.soa.esb.oracle.aq/src/main/java/org/jboss/soa/esb/oracle/aq/AQUtil.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/MapBodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/MapBodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/ObjectBodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/TextBodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ElementContent.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ParsingSupport.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/StreamHelper.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/TextElement.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/LogicalEPR.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/MessageMulticaster.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/JBossESBPropertyService.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/BytesBody.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/jms/DefaultJMSPropertiesSetter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/jms/JMSPropertiesSetter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainerUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregatorUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetterUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounterUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/MessageAttachmentSerializeTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/MessagePropertiesSerializeTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/JMSUtil.java
labs/jbossesb/trunk/product/samples/quickstarts/aggregator/aggregation_service/jbossesb.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/gpd.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processimage.jpg
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/ProcessInfo.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/process_actions/MyBPMActionHandler.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/test/SendTestMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/gpd.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/processdefinition.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/processimage.jpg
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/scripts/service6.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration2/test/SendJMSMessageDeploy.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/gpd.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/processdefinition.xml
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/processimage.jpg
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/scripts/service1.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/scripts/service2.groovy
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/esb_actions/SimpleJMSNotifier.java
labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
labs/jbossesb/trunk/product/samples/quickstarts/custom_action/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/exceptions_faults/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/exceptions_faults/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/src/org/jboss/soa/esb/samples/quickstart/funcbr/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/groovy_gateway/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/src/org/jboss/soa/esb/samples/quickstart/helloworldaction/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/jboss-esb-unfiltered.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldfilenotifier/MyJMSListenerAction.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldfilenotifier/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/hsqldb/create.sql
labs/jbossesb/trunk/product/samples/quickstarts/jms_secured/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/MessageAugmentor.java
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JmsLoadAgent.groovy
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadUtil.groovy
labs/jbossesb/trunk/product/samples/quickstarts/messagefilter/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/messagefilter/src/org/jboss/soa/esb/samples/quickstart/messagefilter/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/messagestore/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/MyScheduledActionMsgComposer.java
labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/scripts/iTunesTop10.groovy
labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/src/org/jboss/soa/esb/samples/quickstart/simplecbr/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/MySpringEnabledAction.java
labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/src/org/jboss/soa/esb/samples/quickstart/spring_helloworld/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/src/org/jboss/soa/esb/samples/quickstart/spring_jpetstore/test/SendJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/src/org/jboss/soa/esb/samples/quickstart/transformxml2pojo/test/ReceiveJMSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/MyResponseAction.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/README.html
labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/SendMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/README.html
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/src/org/jboss/soa/esb/samples/quickstart/webservicewsa/ServerHandler.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/src/org/jboss/soa/esb/samples/quickstart/webservicewsa/client/ClientHandler.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wssecurity/README.html
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wssecurity/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/wiretap/jboss-esb.xml
labs/jbossesb/trunk/product/samples/trailblazer/build.xml
labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java
labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
labs/jbossesb/trunk/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java
labs/jbossesb/trunk/product/services/jbpm/src/main/resources/META-INF/deployment.xml
labs/jbossesb/trunk/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml
labs/jbossesb/trunk/product/services/jbpm/src/main/resources/hibernate.cfg.xml
labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm-ds.xml
labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm-service.xml
labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm.cfg.xml
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/log4j.xml
labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testMappingDefinition.xml
labs/jbossesb/trunk/product/services/jbrules/src/main/resources/XPathLanguage.dsl
labs/jbossesb/trunk/product/services/soap/lib/ext/build-time/jbossws-core.jar
labs/jbossesb/trunk/product/services/soap/lib/ext/build-time/jbossws-jboss42.jar
labs/jbossesb/trunk/product/services/soap/lib/ext/build-time/jbossws-spi.jar
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java
labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected.wsdl
labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
labs/jbossesb/trunk/product/skip.properties-example
labs/jbossesb/trunk/product/tools/configeditor/editor/docs/JBossESBConfigEditor.pdf
labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/mysql/create_database.sql
labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/attribute.jsp
labs/jbossesb/trunk/product/tools/console/management/build.xml
labs/jbossesb/trunk/product/tools/console/management/mysql.properties
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/MonitoringSessionFactory.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/Invoker.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/OperationsCollector.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/BeanRegistrationServlet.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFiler.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerScheduler.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/Filer.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/InvokerFiler.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/OperationsFiler.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/StatisticsHelper.java
labs/jbossesb/trunk/qa/build.xml
labs/jbossesb/trunk/qa/junit/build.xml
labs/jbossesb/trunk/qa/quickstarts/
labs/jbossesb/trunk/qa/quickstarts/build.xml
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java
Log:
Merging CP1 changes over to trunk: JBESB-1577
Property changes on: labs/jbossesb/trunk
___________________________________________________________________
Name: svn:ignore
- .settings
.classpath
.project
bin
.packaging
build
junit
ObjectToFileWriter.tst
null
classes
+ .settings
.classpath
.project
bin
.packaging
build
junit
ObjectToFileWriter.tst
null
classes
ESB.ipr
ESB.iws
runci.bat
Property changes on: labs/jbossesb/trunk/product
___________________________________________________________________
Name: svn:ignore
- build
deployment.properties
javadocs
*.bat
ObjectToFileWriter.tst
*.log
test-outdir
foobar
res
skip.properties
+ build
deployment.properties
javadocs
*.bat
ObjectToFileWriter.tst
*.log
test-outdir
foobar
res
skip.properties
product.iml
Modified: labs/jbossesb/trunk/product/build.xml
===================================================================
--- labs/jbossesb/trunk/product/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/product/docs/AdministrationGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/GettingStarted.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/MessageActionGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/MessageActionGuide.pdf
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/ReleaseNotes.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/advanced/SOAConcepts.odt
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/docs/advanced/ServiceOrchestration.odt
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/docs/advanced/ServiceOrchestration.pdf
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/advanced/WebServices.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/governance/MonitoringGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/samples/TBGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/services/ContentBasedRouting.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/services/MessageStore.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/services/MessageTransformation.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/services/Registry.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/services/Registry.pdf
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/docs/services/WS-BPEL.odt (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/docs/services/WS-BPEL.odt)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/docs/services/jBPMIntegrationGuide.odt (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/docs/services/jBPMIntegrationGuide.odt)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/docs/services/jBPMIntegrationGuide.pdf (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/docs/services/jBPMIntegrationGuide.pdf)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/wiki/FilesToGenerate.txt
===================================================================
--- labs/jbossesb/trunk/product/docs/wiki/FilesToGenerate.txt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/docs/wiki/FilesToGenerate.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -8,6 +8,7 @@
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossESBDeadLetterService
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossESBHelloworld
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossESBContentBasedRouting
+http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossESBjBPMIntegration
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossESBMessageFilter
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossESBMessageStore
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossESBRecipientList
Modified: labs/jbossesb/trunk/product/esb-config.xml
===================================================================
--- labs/jbossesb/trunk/product/esb-config.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/esb-config.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -108,7 +108,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}"/>
@@ -135,7 +140,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"/>
@@ -167,7 +172,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}">
@@ -187,8 +192,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/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd
===================================================================
--- labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-03-04 16:24:20 UTC (rev 18679)
@@ -626,6 +626,15 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attribute default="false" name="transacted"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, JMS sessions will be transaction aware.
+ Default is false.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="jms-bus" substitutionGroup="jesb:bus">
@@ -749,6 +758,13 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attribute name="providerAdapterJNDI" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The JNDI location of an alternate provider adapter
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -1160,24 +1176,24 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute default="message_id" name="message-id-column"
- type="xsd:string" use="optional">
+ <xsd:attribute name="message-id-column"
+ type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
A unique key (PK) in the table.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute default="message" name="message-column"
- type="xsd:string" use="optional">
+ <xsd:attribute name="message-column"
+ type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
The field that holds the serialized message.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute default="status" name="status-column"
- type="xsd:string" use="optional">
+ <xsd:attribute name="status-column"
+ type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
This column contents ('P', 'W', 'E' or 'D')
@@ -1207,7 +1223,7 @@
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="insert-timestamp-column" use="optional"
- type="xsd:string" default="insert_timestamp">
+ type="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Holds the timestamp when the record was
Modified: labs/jbossesb/trunk/product/install/Deployment.txt
===================================================================
--- labs/jbossesb/trunk/product/install/Deployment.txt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/install/Deployment.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -8,8 +8,8 @@
| Java | 1.5 (Sun) | http://java.sun.com/javase/downloads/index.jsp
| JavaMail | 1.3.1 | http://java.sun.com/products/javamail/
| | |
-| JBoss Application Server | 4.0.4.GA | http://labs.jboss.com/portal/jbossas/download
-| JBoss TS (Common) | 4.2.1 GA | http://labs.jboss.com/portal/jbosstm/downloads
+| JBoss Application Server | 4.2.1.GA | http://labs.jboss.com/portal/jbossas/download
+| JBoss TS (Common) | 4.2.1 SP5 GA | http://labs.jboss.com/portal/jbosstm/downloads
| | |
| Postgres Database Server | 8.1 | http://www.postgresql.org/download/
| | |
@@ -25,8 +25,8 @@
| XStream | 1.1.3 | http://xstream.codehaus.org/
| edtftpj | 1.5.2 | http://www.enterprisedt.com/products/edtftpj/download.html
| | |
-| milyn-commons | 0.7 | http://milyn.codehaus.org/downloads
-| milyn-smooks-core | 0.8-SNAPSHOT | http://milyn.codehaus.org/downloads
-| milyn-smooks-misc | 0.2 | http://milyn.codehaus.org/downloads
-| milyn-tinak | 0.7.1 | http://milyn.codehaus.org/downloads
+| milyn-commons | 0.9 | http://milyn.codehaus.org/downloads
+| milyn-smooks-core | 0.9 | http://milyn.codehaus.org/downloads
+| milyn-smooks-misc | 0.2.1 | http://milyn.codehaus.org/downloads
+| milyn-tinak | 0.9 | http://milyn.codehaus.org/downloads
--------------------------------------------------------------------------------------------------------------------------------
Modified: labs/jbossesb/trunk/product/install/build.xml
===================================================================
--- labs/jbossesb/trunk/product/install/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/install/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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}"/>
Copied: labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml.template (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/install/conf/jbossesb-properties.xml.template)
===================================================================
--- labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml.template (rev 0)
+++ labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml.template 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+ <properties name="filters">
+ <property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+ <property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+ </properties>
+</esb>
Deleted: labs/jbossesb/trunk/product/install/jUDDI-registry/build.xml
===================================================================
--- labs/jbossesb/trunk/product/install/jUDDI-registry/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/install/jUDDI-registry/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,28 +0,0 @@
-<project name="JBESB_Config_jUDDI_Deployment" default="deploy.juddi" basedir=".">
-
- <!-- Set deployment properties filename -->
- <property name="org.jboss.esb.deployment.properties" location="../deployment.properties"/>
-
- <!-- Load Build Properties File -->
- <property file="${org.jboss.esb.deployment.properties}"/>
- <property name="juddi.deploy.dir" value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy" />
- <echo>Using JBoss AS at ${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}</echo>
-
- <target name="deploy.juddi">
- <!-- deploy -->
- <copy verbose="true" file="juddi.war" overwrite="true"
- todir="${juddi.deploy.dir}" />
- <!-- is installed by default
- <copy verbose="true" file="juddi-ds.xml" overwrite="true"
- todir="${juddi.deploy.dir}" /> -->
- </target>
-
-
- <target name="undeploy.juddi">
- <!-- undeploy -->
- <delete verbose="true" file="${juddi.deploy.dir}/juddi.war" />
- <!--
- <delete verbose="true" file="${juddi.deploy.dir}/juddi-ds.xml" />
- -->
- </target>
-</project>
Modified: labs/jbossesb/trunk/product/install/jUDDI-registry/juddi.war
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/install/jaxb.xslt
===================================================================
--- labs/jbossesb/trunk/product/install/jaxb.xslt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/install/jaxb.xslt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,43 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:deployer="urn:jboss:bean-deployer">
- <xsl:output method="xml" encoding="UTF-8"/>
-
- <xsl:template match="deployer:deployment/deployer:bean[1]">
- <xsl:element name="bean" namespace="urn:jboss:bean-deployer">
- <xsl:attribute name="name">WSEndpointJAXBIntrosCustomizationsDeployer</xsl:attribute>
- <xsl:attribute name="class">org.jboss.wsf.spi.deployment.JAXBIntrosCustomizationsDeployer</xsl:attribute>
- </xsl:element>
- <xsl:comment>ESB Customization Deployer</xsl:comment>
- <xsl:text>
- </xsl:text>
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="deployer:bean[@name='WSMainDeployerManager']/deployer:property[@name='deployers']//deployer:inject[@bean='WSEndpointHandlerDeployer']">
- <xsl:element name="inject" namespace="urn:jboss:bean-deployer">
- <xsl:attribute name="bean">WSEndpointJAXBIntrosCustomizationsDeployer</xsl:attribute>
- </xsl:element>
- <xsl:comment>ESB Customization Deployer</xsl:comment>
- <xsl:text>
- </xsl:text>
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="deployer:bean[@name='WSWebMetaDataAdapter']">
- <xsl:element name="bean" namespace="urn:jboss:bean-deployer">
- <xsl:attribute name="name">WSWebMetaDataAdapter</xsl:attribute>
- <xsl:attribute name="class">org.jboss.soa.esb.jbossws.ESBWebMetaDataAdapter</xsl:attribute>
- </xsl:element>
- <xsl:comment>ESB Customization Deployer</xsl:comment>
- </xsl:template>
-
- <xsl:template match="@*|node()">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:template>
-</xsl:stylesheet>
Modified: labs/jbossesb/trunk/product/install/standalone/jbossesb-server-base.zip
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/lib/Licenses.txt
===================================================================
--- labs/jbossesb/trunk/product/lib/Licenses.txt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/lib/Licenses.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -707,3 +707,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
+
+
+--- h2 database jar ----------------------------------------------------------
+
+Licensed under the H2 License, Version 1.0
+(http://h2database.com/html/license.html).
+Initial Developer: H2 Group
+
+------------------------------------------------------------------------------
Copied: labs/jbossesb/trunk/product/lib/ext/h2.jar (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/lib/ext/h2.jar)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/lib/ext/juddi-2.0rc5.jar (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/lib/ext/juddi-2.0rc5.jar)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/lib/ext/juddi-20071022.191630-27.jar
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/lib/ext/juddi-client-2.0rc5.jar (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/lib/ext/juddi-client-2.0rc5.jar)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/lib/ext/juddi-client-20071022.191630-6.jar
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/plugins/org.jboss.soa.esb.oracle.aq/src/main/java/org/jboss/soa/esb/oracle/aq/AQUtil.java
===================================================================
--- labs/jbossesb/trunk/product/plugins/org.jboss.soa.esb.oracle.aq/src/main/java/org/jboss/soa/esb/oracle/aq/AQUtil.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/plugins/org.jboss.soa.esb.oracle.aq/src/main/java/org/jboss/soa/esb/oracle/aq/AQUtil.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -138,6 +138,14 @@
} catch (SQLException e) {
log.error("caught sqlexception", e);
} finally {
+ if (rs != null)
+ {
+ try {
+ rs.close();
+ } catch (SQLException e) {
+ if(log.isDebugEnabled()) log.debug("sqlexception while closing resultset", e);
+ }
+ }
if(statement!=null)
try {
statement.close();
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -31,7 +31,11 @@
public DefaultHibernateReplyToEpr(HibernateEpr epr) throws URISyntaxException
{
super(epr);
- setClassName(replyToClassName(epr));
+
+ if (getClassName() == null)
+ setClassName(replyToClassName(epr));
+ else
+ changeClassName(replyToClassName(epr));
}
public static String replyToClassName(HibernateEpr epr) throws URISyntaxException
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -30,7 +30,11 @@
public DefaultJdbcReplyToEpr(JDBCEpr epr) throws URISyntaxException
{
super(epr);
- setTableName(replyToTableName(epr));
+
+ if (super.getTableName() == null)
+ setTableName(replyToTableName(epr));
+ else
+ changeTableName(replyToTableName(epr));
}
public static String replyToTableName(JDBCEpr epr) throws URISyntaxException
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -33,11 +33,13 @@
public DefaultJmsReplyToEpr(JMSEpr epr)
throws URISyntaxException
{
- super( epr.getDestinationType()
+ super( epr.getVersion()
+ ,epr.getDestinationType()
,replyDestinationName(epr)
,epr.getConnectionFactory()
,epr.getJndiEnvironment()
,replySelector(epr)
+ ,epr.getPersistent()
);
}
private static String replyDestinationName(JMSEpr toEpr)
Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,229 +0,0 @@
-package org.jboss.internal.soa.esb.addressing.helpers;
-
-/*
- * 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,
- * @author mark.little at jboss.com
- */
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public abstract class CallHelper
-{
-
- public static Element toXML(Call call, Document doc, Element header)
- throws MarshalException
- {
- AssertArgument.isNotNull(call, "call");
- AssertArgument.isNotNull(doc, "doc");
- AssertArgument.isNotNull(header, "header");
-
- header.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
- + XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI);
-
- if (call.getTo() != null)
- {
- final Element toElement = doc.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI, XMLUtil.TO_TAG);
- toElement.setPrefix(XMLUtil.WSA_PREFIX);
- EPRHelper.toXML(call.getTo(), doc, header, toElement, true);
- header.appendChild(toElement);
- }
-
- if (call.getFrom() != null)
- {
- final Element fromElement = doc.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI, XMLUtil.FROM_TAG);
- fromElement.setPrefix(XMLUtil.WSA_PREFIX);
- EPRHelper.toXML(call.getFrom(), doc, header, fromElement, false);
- header.appendChild(fromElement);
- }
-
- if (call.getReplyTo() != null)
- {
- final Element replyToElement = doc.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI, XMLUtil.REPLY_TO_TAG);
- replyToElement.setPrefix(XMLUtil.WSA_PREFIX);
- EPRHelper.toXML(call.getReplyTo(), doc, header, replyToElement,
- false);
- header.appendChild(replyToElement);
- }
-
- if (call.getRelatesTo() != null)
- {
- final Element relatesToElement = doc.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI, XMLUtil.RELATES_TO_TAG);
- relatesToElement.setPrefix(XMLUtil.WSA_PREFIX);
- relatesToElement.setTextContent(call.getRelatesTo().toString());
- header.appendChild(relatesToElement);
- }
-
- if (call.getFaultTo() != null)
- {
- final Element faultToElement = doc.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI, XMLUtil.FAULT_TO_TAG);
- faultToElement.setPrefix(XMLUtil.WSA_PREFIX);
- EPRHelper.toXML(call.getFaultTo(), doc, header, faultToElement,
- false);
- header.appendChild(faultToElement);
- }
-
- if (call.getAction() != null)
- {
- final Element actionElement = doc.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI, XMLUtil.ACTION_TAG);
- actionElement.setPrefix(XMLUtil.WSA_PREFIX);
- actionElement.setTextContent(call.getAction().toString());
- header.appendChild(actionElement);
- }
-
- if (call.getMessageID() != null)
- {
- final Element messageIDElement = doc.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI, XMLUtil.MESSAGE_IDENTIFIER_TAG);
- messageIDElement.setPrefix(XMLUtil.WSA_PREFIX);
- messageIDElement.setTextContent(call.getMessageID().toString());
- header.appendChild(messageIDElement);
- }
-
- return header;
- }
-
- public static Call fromXML(Element header) throws UnmarshalException
- {
- AssertArgument.isNotNull(header, "header");
-
- Call call = new Call();
- NodeList nl = header.getChildNodes();
-
- final List<Node> extensions = new ArrayList<Node>() ;
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node n = nl.item(i);
- if (!(n instanceof Element))
- {
- continue ;
- }
- if (XMLUtil.WSA_NAMESPACE_URI.equals(n.getNamespaceURI()))
- {
- final String name = n.getLocalName() ;
- if (XMLUtil.TO_TAG.equals(name))
- {
- call.setTo(EPRHelper.fromXML((Element) header, true));
- }
- else if (XMLUtil.FROM_TAG.equals(name))
- {
- call.setFrom(EPRHelper.fromXML((Element) n, false));
- }
- else if (XMLUtil.REPLY_TO_TAG.equals(name))
- {
- call.setReplyTo(EPRHelper.fromXML((Element) n, false));
- }
- else if (XMLUtil.RELATES_TO_TAG.equals(name))
- {
- try
- {
- call.setRelatesTo(new URI(n.getTextContent()));
- }
- catch (URISyntaxException e)
- {
- throw new UnmarshalException("'" + XMLUtil.RELATES_TO_TAG
- + "' must be a valid URI", e);
- }
- catch (Exception ex)
- {
- throw new UnmarshalException("'" + XMLUtil.RELATES_TO_TAG
- + "' has invalid content", ex);
- }
- }
- else if (XMLUtil.FAULT_TO_TAG.equals(name))
- {
- call.setFaultTo(EPRHelper.fromXML((Element) n, false));
- }
- else if (XMLUtil.ACTION_TAG.equals(name))
- {
- try
- {
- call.setAction(new URI(n.getTextContent()));
- }
- catch (URISyntaxException e)
- {
- throw new UnmarshalException("'" + XMLUtil.ACTION_TAG
- + "' must be a valid URI", e);
- }
- catch (Exception ex)
- {
- throw new UnmarshalException("'" + XMLUtil.ACTION_TAG
- + "' has invalid content", ex);
- }
- }
- else if (XMLUtil.MESSAGE_IDENTIFIER_TAG.equals(name))
- {
- try
- {
- call.setMessageID(new URI(n.getTextContent()));
- }
- catch (URISyntaxException e)
- {
- throw new UnmarshalException("'"
- + XMLUtil.MESSAGE_IDENTIFIER_TAG
- + "' must be a valid URI", e);
- }
- catch (Exception ex)
- {
- throw new UnmarshalException("'" + XMLUtil.MESSAGE_IDENTIFIER_TAG
- + "' has invalid content", ex);
- }
- }
- else
- {
- extensions.add(n) ;
- }
- }
- else
- {
- extensions.add(n) ;
- }
- }
-
- if (extensions.size() > 0)
- {
- final PortReference to = call.getTo().getAddr() ;
- for(Node node:extensions)
- {
- to.addExtension(node.getLocalName(), node.getPrefix(), node.getNamespaceURI(), node.getTextContent()) ;
- }
- }
- return call;
- }
-
-}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,9 +21,9 @@
* @author mark.little at jboss.com
*/
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
import org.jboss.soa.esb.MarshalException;
import org.jboss.soa.esb.UnmarshalException;
import org.jboss.soa.esb.addressing.EPR;
@@ -31,118 +31,39 @@
import org.jboss.soa.esb.addressing.XMLUtil;
import org.jboss.soa.esb.addressing.PortReference.Extension;
import org.jboss.soa.esb.addressing.eprs.*;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import java.io.StringReader;
import java.io.StringWriter;
import java.util.List;
public class EPRHelper
{
public static final String EPR_TYPE = "type";
+
+ private static final QName HEADER = new QName("header") ;
- /**
- * Serialize the EPR to an XML representation.
- *
- * @param epr
- * @param doc
- * @param header
- * @return
- */
- public static final Element toXML(EPR epr, Document doc, Element header,
- Element packElement) throws MarshalException
- {
- return toXML(epr, doc, header, packElement, false);
- }
+ public static void toXML(final XMLStreamWriter out, final QName name,
+ final EPR epr)
+ throws XMLStreamException
+ {
+ setSpecificEPR(epr) ;
+ PortReferenceHelper.toXML(out, name, epr.getAddr()) ;
+ }
+ public static EPR fromXML(XMLStreamReader in)
+ throws XMLStreamException
+ {
+ final PortReference portReference = PortReferenceHelper.fromXML(in) ;
+ return getSpecificEPR(new EPR(portReference)) ;
+ }
+
/**
- * Serialize the EPR to an XML representation. Specify whether this is a To
- * node in the Call.
- *
- * @param epr
- * @param doc
- * @param header
- * @return
- */
-
- public static final Element toXML(EPR epr, Document doc, Element header,
- Element packElement, boolean to) throws MarshalException
- {
- AssertArgument.isNotNull(epr, "epr");
-
- // TODO
- // The EPR type really should be doing this itself.
-
- setSpecificEPR(epr);
- PortReferenceHelper.toXML(header, doc, packElement, epr.getAddr(), to);
-
- return header;
- }
-
- /**
- * Deserialize the EPR from an XML representation.
- *
- * @param header
- * @return
- */
-
- public static final EPR fromXML(Element header) throws UnmarshalException
- {
- return fromXML(header, false);
- }
-
- /**
- * Deserialize the EPR from an XML representation. Specify whether this is a
- * To node in the Call.
- *
- * @param header
- * @return
- */
-
- public static final EPR fromXML(Element header, boolean to)
- throws UnmarshalException
- {
- AssertArgument.isNotNull(header, "header");
-
- if (to)
- {
- NodeList children = header.getChildNodes();
-
- for (int i = 0; i < children.getLength(); i++)
- {
- Node n = children.item(i);
-
- if (n instanceof Element)
- {
- Element el = (Element) n;
- String prefix = el.getPrefix();
- String tag = el.getLocalName();
-
- if ((prefix != null) && (prefix.equals(XMLUtil.WSA_PREFIX)))
- {
- if ((tag != null) && (tag.equals(XMLUtil.TO_TAG)))
- {
- return getSpecificEPR(new EPR(PortReferenceHelper
- .fromXML(el, true)), header);
- }
- }
- }
- }
- }
-
- return getSpecificEPR(new EPR(PortReferenceHelper.fromXML(header, to)));
- }
-
- /**
* Create a string version of the XML representation for this EPR. If the
* EPR is a specific type (e.g., JMSEpr) then that type information will
* also be encoded.
@@ -154,7 +75,7 @@
public static final String toXMLString(EPR epr) throws MarshalException
{
- return toXMLString(epr, false, XMLUtil.FROM_TAG);
+ return toXMLString(epr, XMLUtil.QNAME_FROM_TAG);
}
/**
@@ -167,62 +88,33 @@
* @throws MarshalException
*/
- public static final String toXMLString(EPR epr, boolean to, String tag) throws MarshalException
+ public static final String toXMLString(EPR epr, QName name) throws MarshalException
{
AssertArgument.isNotNull(epr, "epr");
- AssertArgument.isNotNull(tag, "tag");
+ AssertArgument.isNotNull(name, "name");
try
{
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
-
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
- Element portReferenceElement = doc.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI, tag);
-
- setSpecificEPR(epr);
-
- if (to)
- {
- Element header = doc.createElement("header");
- doc.appendChild(header);
- header.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
- + XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI);
- toXML(epr, doc, header, portReferenceElement, to);
- header.appendChild(portReferenceElement);
- }
- else
- {
- portReferenceElement.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
- + XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI);
-
- doc.appendChild(portReferenceElement);
- toXML(epr, doc, portReferenceElement, portReferenceElement, to);
- }
-
- StringWriter sWriter = new StringWriter();
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
-
- XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
- xmlS.asDOMSerializer();
- xmlS.serialize(doc);
-
- return sWriter.toString();
+ final StringWriter writer = new StringWriter() ;
+ final XMLStreamWriter out = XMLHelper.getXMLStreamWriter(writer) ;
+
+ if (XMLUtil.QNAME_TO_TAG.equals(name))
+ {
+ final String origURI = StreamHelper.writeStartElement(out, HEADER) ;
+ toXML(out, name, epr) ;
+ StreamHelper.writeEndElement(out, HEADER.getPrefix(), origURI) ;
+ }
+ else
+ {
+ toXML(out, name, epr) ;
+ }
+ out.flush() ;
+ return writer.toString() ;
}
- catch (ParserConfigurationException ex)
+ catch (XMLStreamException xmlse)
{
- throw new MarshalException("Failed to construct DOM Document Builder.", ex);
+ throw new MarshalException("Failed to serialise EPR.", xmlse);
}
- catch (IOException ex)
- {
- throw new MarshalException("Error during DOM to String serialisation.", ex);
- }
}
/**
@@ -237,49 +129,24 @@
public static final EPR fromXMLString(String xml) throws UnmarshalException
{
- return fromXMLString(xml, false);
- }
-
- /**
- * Get the EPR from the string representation. If the EPR was a specific
- * type (e.g., JMSEpr) then it will be returned as an instance of the
- * appropriate class. Specify whether this is a To node in the Call.
- *
- * @param xml
- * @return
- * @throws UnmarshalException
- */
-
- public static final EPR fromXMLString(String xml, boolean to) throws UnmarshalException
- {
AssertArgument.isNotNull(xml, "xml");
try
{
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
-
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.parse(new ByteArrayInputStream(xml
- .getBytes()));
- Element rootElement = (Element) doc.getDocumentElement();
-
- return fromXML(rootElement, to);
+ final StringReader reader = new StringReader(xml) ;
+ final XMLStreamReader in = XMLHelper.getXMLStreamReader(reader) ;
+ StreamHelper.skipToStartElement(in) ;
+ if (HEADER.equals(in.getName()))
+ {
+ StreamHelper.skipToNextStartElement(in) ;
+ }
+
+ return fromXML(in) ;
}
- catch (SAXException ex)
+ catch (final XMLStreamException xmlse)
{
- throw new UnmarshalException("Unable to parse EPR XML.", ex);
+ throw new UnmarshalException("Unable to parse EPR XML.", xmlse);
}
- catch (IOException ex)
- {
- throw new UnmarshalException("Unable to read EPR XML stream.", ex);
- }
- catch (ParserConfigurationException ex)
- {
- throw new UnmarshalException("Failed to construct DOM Document Builder.", ex);
- }
}
private final static void setSpecificEPR(EPR epr)
@@ -318,7 +185,7 @@
}
}
- private final static EPR getSpecificEPR(EPR epr)
+ public final static EPR getSpecificEPR(EPR epr)
{
String eprType = epr.getAddr().getExtensionValue(EPR_TYPE);
@@ -353,66 +220,6 @@
}
}
- /**
- * Because of WS-A rules, if this was a To node then all of the elements
- * within the EPR are now at top-level in the header and not easily
- * obtained. We need to ask each EPR type to reconstitute itself.
- *
- * @param epr
- * @param header
- * @return
- */
-
- private final static EPR getSpecificEPR(EPR epr, Element header)
- {
- NodeList children = header.getChildNodes();
- String eprType = null;
-
- for (int i = 0; i < children.getLength(); i++)
- {
- String prefix = children.item(i).getPrefix();
- String tag = children.item(i).getLocalName();
-
- if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
- {
- if ((tag != null) && (tag.equals(EPR_TYPE)))
- {
- eprType = children.item(i).getTextContent();
- }
- }
- }
-
- if (eprType != null)
- {
- /*
- * Do not re-order.
- */
-
- if (eprType.equals(EmailEpr.type().toString()))
- return new EmailEpr(epr, header);
- else if (eprType.equals(SFTPEpr.type().toString()))
- return new SFTPEpr(epr, header);
- else if (eprType.equals(HTTPEpr.type().toString()))
- return new HTTPEpr(epr, header);
- else if (eprType.equals(JDBCEpr.type().toString()))
- return new JDBCEpr(epr, header);
- else if (eprType.equals(HibernateEpr.type().toString()))
- return new HibernateEpr(epr, header);
- else if (eprType.equals(JMSEpr.type().toString()))
- return new JMSEpr(epr, header);
- else if (eprType.equals(FTPEpr.type().toString()))
- return new FTPEpr(epr, header);
- else if (eprType.equals(FileEpr.type().toString()))
- return new FileEpr(epr, header);
- else if (eprType.equals(LogicalEPR.type().toString()))
- return new LogicalEPR(epr, header);
- else
- return epr;
- } else {
- return epr;
- }
- }
-
/**
* Create a copy of the EPR, including the specified extensions.
* @param epr The current EPR.
@@ -437,5 +244,4 @@
}
return copyEPR ;
}
-
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -27,21 +27,24 @@
package org.jboss.internal.soa.esb.addressing.helpers;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
+import java.util.List;
+import java.util.Map.Entry;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.jboss.internal.soa.esb.util.stax.ElementContent;
+import org.jboss.internal.soa.esb.util.stax.QNameHelper;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+import org.jboss.internal.soa.esb.util.stax.TextElement;
import org.jboss.soa.esb.addressing.PortReference;
import org.jboss.soa.esb.addressing.XMLUtil;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
+import org.jboss.soa.esb.addressing.PortReference.Extension;
/*
* This should pack the PortReference into an ERP.
@@ -53,307 +56,234 @@
public class PortReferenceHelper
{
- /**
- * WS-Addressing is broken in that the To field is a URI, even if the From
- * field was an EPR! You have to use the EPR bits separately. So, the
- * toField is used to indicate whether we are packing this address as a To
- * field (when we need to treat it differently) or as an EPR.
- */
-
- /** ************************************************** */
- public static void toXML(org.w3c.dom.Element header,
- org.w3c.dom.Document document,
- org.w3c.dom.Element portReferenceElement,
- PortReference portReference, boolean toField)
- throws MarshalException
+ public static void toXML(final XMLStreamWriter out, final QName name,
+ final PortReference portReference)
+ throws XMLStreamException
{
- try
- {
- if (!toField)
- {
- Element addressElement = document.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI, XMLUtil.ADDRESS_TAG);
- addressElement.setPrefix(XMLUtil.WSA_PREFIX);
- addressElement.appendChild(document
- .createTextNode(portReference.getAddress()));
- portReferenceElement.appendChild(addressElement);
- }
- else
- {
- portReferenceElement.appendChild(document
- .createTextNode(portReference.getAddress()));
- }
-
- Iterator extensions = portReference.getExtensions();
- Element referenceProperties = null;
-
- while (extensions.hasNext())
- {
- PortReference.Extension extension = (PortReference.Extension) extensions
- .next();
-
- /*
- * WS-Addressing is broken in that the To field is a URI, even
- * if the From field was an EPR! You have to use the EPR bits
- * separately. Doh!
- */
-
- if (!toField)
- {
- if (referenceProperties == null)
- {
- referenceProperties = document.createElementNS(
- XMLUtil.WSA_NAMESPACE_URI,
- XMLUtil.REFERENCE_PROPERTIES_TAG);
- referenceProperties.setPrefix(XMLUtil.WSA_PREFIX);
- portReferenceElement.appendChild(referenceProperties);
- }
- }
- else
- referenceProperties = header;
-
- extensionToXML(referenceProperties, document, extension);
- }
- }
- catch (Exception exception)
- {
- exception.printStackTrace();
- throw new MarshalException("Marshal failure: " + exception);
- }
+ if (XMLUtil.QNAME_TO_TAG.equals(name))
+ {
+ writeToXML(out, name, portReference) ;
+ }
+ else
+ {
+ writeXML(out, name, portReference) ;
+ }
}
-
- /** **************************** */
- public static PortReference fromXML(
- org.w3c.dom.Element portReferenceElement, boolean toField)
- throws UnmarshalException
+
+ private static void writeToXML(final XMLStreamWriter out, final QName name, final PortReference portReference)
+ throws XMLStreamException
{
- PortReference portReference = new PortReference();
-
- if (toField)
- {
- portReference.setAddress(portReferenceElement.getTextContent());
- }
-
- org.w3c.dom.NodeList elements = portReferenceElement.getChildNodes();
-
- for (int i = 0; i < elements.getLength(); i++)
- {
- final Object extensionObject = elements.item(i);
-
- if (extensionObject instanceof Element)
- {
- int parentNodeType = PortReference.Extension.NEITHER;
- Element extensionElement = (Element) extensionObject;
- NodeList children = extensionElement.getChildNodes();
- String parentName = extensionElement.getNodeName();
- boolean haveChildren = false;
-
- if (parentName.equals(XMLUtil.REFERENCE_PROPERTIES_TAG))
- parentNodeType = PortReference.Extension.REFERENCE_PROPERTIES;
- else
- {
- if (parentName.equals(XMLUtil.REFERENCE_PARAMETERS_TAG))
- parentNodeType = PortReference.Extension.REFERENCE_PARAMETERS;
- else
- {
- if (!toField
- && parentName.equals(XMLUtil.WSA_PREFIX + ":"
- + XMLUtil.ADDRESS_TAG))
- {
- portReference.setAddress(extensionElement
- .getTextContent());
- }
- }
- }
-
- final int numChildren = children.getLength();
-
- for (int count = 0; count < numChildren; count++)
- {
- final Object childObject = children.item(count);
-
- if (childObject instanceof Element)
- {
- Element childElement = (Element) childObject;
-
- portReference
- .addExtension(childrenFromXML(childElement));
- haveChildren = true;
- }
- }
-
- if (!haveChildren && !parentName.equals(XMLUtil.WSA_PREFIX + ":"+ XMLUtil.ADDRESS_TAG))
- {
- PortReference.Extension ext = new PortReference.Extension(
- extensionElement.getNodeName(), null, null,
- extensionElement.getNodeValue(), parentNodeType);
-
- portReference.addExtension(ext);
-
- final NamedNodeMap attrs = extensionElement.getAttributes();
- final int numAttrs = attrs.getLength();
- if (numAttrs > 0)
- {
- final HashMap<ArjunaName, String> p = new HashMap<ArjunaName, String>();
- for (int count = 0; count < numAttrs; count++)
- {
- final Attr attr = (Attr) attrs.item(count);
- if (!"http://www.w3.org/2000/xmlns/".equals(attr
- .getNamespaceURI()))
- {
- final ArjunaName name = generateName(attr);
- p.put(name, attr.getValue());
- }
- }
-
- ext.addAttributes(p);
- }
- }
- }
- }
-
- return portReference;
+ final TextElement toElement = new TextElement(portReference.getAddress()) ;
+ StreamHelper.writeElement(out, name, toElement) ;
+
+ writeExtensions(out, portReference) ;
}
-
- private final static PortReference.Extension childrenFromXML(
- Element childRoot)
+
+ private static void writeXML(final XMLStreamWriter out, final QName name, final PortReference portReference)
+ throws XMLStreamException
{
- final NodeList children = childRoot.getChildNodes();
- final int numChildNodes = children.getLength();
-
- final PortReference.Extension extension;
- if (numChildNodes > 0)
- {
- Object childObject = children.item(0);
- if (childObject instanceof Element)
- {
- extension = new PortReference.Extension(
- childRoot.getNodeName(), childRoot.getPrefix(),
- childRoot.getNamespaceURI());
-
- for (int count = 1; count < numChildNodes; count++)
- {
- extension.addChild(childrenFromXML((Element) childObject));
- childObject = children.item(count);
- }
- }
- else
- {
- extension = new PortReference.Extension(
- childRoot.getNodeName(), childRoot.getPrefix(),
- childRoot.getNamespaceURI(), ((Node) childObject)
- .getNodeValue());
- }
- }
- else
- {
- extension = new PortReference.Extension(childRoot.getNodeName(),
- childRoot.getPrefix(), childRoot.getNamespaceURI(),
- childRoot.getNodeValue());
- }
-
- final NamedNodeMap attrs = childRoot.getAttributes();
- final int numAttrs = attrs.getLength();
- if (numAttrs > 0)
- {
- final HashMap<ArjunaName, String> p = new HashMap<ArjunaName, String>();
- for (int count = 0; count < numAttrs; count++)
- {
- final Attr attr = (Attr) attrs.item(count);
- if (!"http://www.w3.org/2000/xmlns/".equals(attr
- .getNamespaceURI()))
- {
- final ArjunaName name = generateName(attr);
- p.put(name, attr.getValue());
- }
- }
-
- extension.addAttributes(p);
- }
- return extension;
+ final String origURI = StreamHelper.writeStartElement(out, name) ;
+
+ final TextElement addressElement = new TextElement(portReference.getAddress()) ;
+ StreamHelper.writeElement(out, XMLUtil.QNAME_ADDRESS_TAG, addressElement) ;
+
+ if (portReference.getAllExtensions().size() > 0)
+ {
+ final String origReferenceURI = StreamHelper.writeStartElement(out, XMLUtil.QNAME_REFERENCE_PROPERTIES_TAG) ;
+ writeExtensions(out, portReference) ;
+ StreamHelper.writeEndElement(out, XMLUtil.QNAME_REFERENCE_PROPERTIES_TAG.getPrefix(), origReferenceURI) ;
+ }
+
+ StreamHelper.writeEndElement(out, name.getPrefix(), origURI) ;
}
-
- private final static Element extensionToXML(Element packInto,
- org.w3c.dom.Document document, PortReference.Extension toPack)
- throws MarshalException
+
+ private static void writeExtensions(final XMLStreamWriter out, final PortReference portReference)
+ throws XMLStreamException
+ {
+ for(Extension extension: portReference.getAllExtensions())
+ {
+ writeExtension(out, extension) ;
+ }
+ }
+
+ private static void writeExtension(final XMLStreamWriter out, final Extension extension)
+ throws XMLStreamException
{
- final String uri = toPack.getURI();
- final Element element;
- if (uri == null)
- {
- element = document.createElement(toPack.getTag());
- }
- else
- {
- final String prefix = toPack.getPrefix();
- element = document.createElementNS(uri, toPack.getTag());
- element.setPrefix(prefix);
- element.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
- + toPack.getPrefix(), uri);
- }
- packInto.appendChild(element);
+ final String uri = QNameHelper.getNormalisedValue(extension.getURI()) ;
+ final String prefix = QNameHelper.getNormalisedValue(extension.getPrefix()) ;
+ final QName name = new QName(uri, extension.getTag(), prefix) ;
+ final String origURI = StreamHelper.writeStartElement(out, name) ;
+
+ final HashMap attributes = extension.getAttributes() ;
+ if (attributes != null)
+ {
+ final Iterator entryIter = attributes.entrySet().iterator() ;
+ while(entryIter.hasNext())
+ {
+ final Entry entry = (Entry)entryIter.next() ;
+ final ArjunaName arjunaName = (ArjunaName)entry.getKey() ;
+ final String value = (String)entry.getValue() ;
+
+ final String attributeURI = QNameHelper.getNormalisedValue(arjunaName.getURI()) ;
+ final String atributePrefix = QNameHelper.getNormalisedValue(arjunaName.getPrefix()) ;
+ final QName attributeName = new QName(uri, arjunaName.getLocalName(), prefix) ;
+
+ StreamHelper.writeAttribute(out, attributeName, value) ;
+ }
+ }
+
+ final TextElement value = new TextElement(extension.getValue()) ;
+ value.writeContent(out) ;
+
+ StreamHelper.writeEndElement(out, name.getPrefix(), origURI) ;
- if (toPack.getValue() != null)
- {
- final Text text = document.createTextNode(toPack.getValue());
- element.appendChild(text);
- }
+ final List children = extension.getChildren() ;
+ if (children != null)
+ {
+ final Iterator childIter = extension.getChildren().iterator() ;
+ while(childIter.hasNext())
+ {
+ writeExtension(out, (Extension)childIter.next()) ;
+ }
+ }
+ }
- LinkedList extensions = toPack.getChildren();
-
- if (extensions != null)
- {
- for (int i = 0; i < extensions.size(); i++)
- {
- PortReference.Extension ext = (PortReference.Extension) extensions
- .get(i);
-
- extensionToXML(element, document, ext);
- }
- }
-
- HashMap attrs = toPack.getAttributes();
-
- if (attrs != null)
- {
- Iterator names = attrs.entrySet().iterator();
-
- while (names.hasNext())
- {
- Map.Entry entry = (Map.Entry) names.next();
- ArjunaName name = (ArjunaName) entry.getKey();
- final String value = (String) entry.getValue();
- final String attrURI = name.getURI();
- if (attrURI != null)
- {
- element.setAttributeNS(attrURI, name.getQualifiedName(),
- value);
- }
- else
- {
- element.setAttribute(name.getQualifiedName(), value);
- }
- }
- }
-
- return element;
+ /** **************************** */
+ public static PortReference fromXML(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ final boolean toField = XMLUtil.QNAME_TO_TAG.equals(in.getName()) ;
+ if (toField)
+ {
+ return readToXML(in) ;
+ }
+ else
+ {
+ return readXML(in) ;
+ }
}
-
- /**
- * Generate a name based on the attribute.
- *
- * @param attr
- * The current attribute.
- * @return The name
- */
- private static ArjunaName generateName(final Attr attr)
+
+ private static PortReference readToXML(final XMLStreamReader in)
+ throws XMLStreamException
{
- final String localName = attr.getNodeName();
- final String uri = attr.getNamespaceURI();
- final String prefix = attr.getPrefix();
-
- return new ArjunaName(uri, prefix, localName);
+ final PortReference portReference = new PortReference() ;
+ final TextElement toElement = new TextElement(in) ;
+ portReference.setAddress(toElement.getText()) ;
+ return portReference ;
}
+
+ private static PortReference readXML(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ final PortReferenceImpl portReferenceImpl = new PortReferenceImpl(in) ;
+ return portReferenceImpl.getPortReference() ;
+ }
+
+ private static class PortReferenceImpl extends ElementContent
+ {
+ private final PortReference portReference = new PortReference() ;
+
+ PortReferenceImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
+ PortReference getPortReference()
+ {
+ return portReference ;
+ }
+
+ @Override
+ protected void putElement(XMLStreamReader in, QName elementName)
+ throws XMLStreamException
+ {
+ if (XMLUtil.QNAME_ADDRESS_TAG.equals(elementName))
+ {
+ final TextElement address = new TextElement(in) ;
+ portReference.setAddress(address.getText()) ;
+ }
+ else if (XMLUtil.QNAME_REFERENCE_PROPERTIES_TAG.equals(elementName))
+ {
+ final ReferencePropertiesImpl referenceProperties = new ReferencePropertiesImpl(in) ;
+ portReference.addExtensions(referenceProperties.getExtensions()) ;
+ }
+ else
+ {
+ throw new XMLStreamException("Unrecognised element name: " + elementName) ;
+ }
+ }
+ }
+
+ private static class ReferencePropertiesImpl extends ElementContent
+ {
+ private List<Extension> extensions = new ArrayList<Extension>() ;
+
+ ReferencePropertiesImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
+ List<Extension> getExtensions()
+ {
+ return extensions ;
+ }
+
+ @Override
+ protected void putElement(XMLStreamReader in, QName elementName)
+ throws XMLStreamException
+ {
+ final ExtensionImpl extension = new ExtensionImpl(in) ;
+ extensions.add(extension.getExtension()) ;
+ }
+ }
+
+ private static class ExtensionImpl extends ElementContent
+ {
+ private final List<Extension> extensions = new ArrayList<Extension>() ;
+ private final HashMap<ArjunaName, String> attributes = new HashMap<ArjunaName, String>() ;
+ private final Extension extension ;
+ private String value ;
+
+ ExtensionImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ final QName name = in.getName() ;
+ parse(in) ;
+ extension = new Extension(name.getLocalPart(), name.getPrefix(),
+ name.getNamespaceURI(), value) ;
+ }
+
+ Extension getExtension()
+ {
+ return extension ;
+ }
+
+ @Override
+ protected void putAttribute(XMLStreamReader in, QName attributeName,
+ String attributeValue) throws XMLStreamException
+ {
+ final ArjunaName name = new ArjunaName(attributeName.getNamespaceURI(),
+ attributeName.getPrefix(), attributeName.getLocalPart()) ;
+ attributes.put(name, attributeValue) ;
+ }
+
+ @Override
+ protected void putValue(XMLStreamReader in, String value)
+ throws XMLStreamException
+ {
+ this.value = value ;
+ }
+
+ @Override
+ protected void putElement(XMLStreamReader in, QName elementName)
+ throws XMLStreamException
+ {
+ final ExtensionImpl extension = new ExtensionImpl(in) ;
+ extensions.add(extension.getExtension()) ;
+ }
+ }
private static class ArjunaName
{
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -46,9 +46,13 @@
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;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.couriers.CourierTimeoutException;
import org.jboss.soa.esb.helpers.KeyValuePair;
@@ -140,8 +144,12 @@
}
public Session getJmsSession(final int acknowledgeMode) throws CourierException {
+ reset();
+
if(jmsSession == null) {
synchronized(this) {
+ checkTransaction();
+
if(jmsSession == null) {
String sType;
@@ -185,7 +193,7 @@
if (null == message) {
return false;
}
-
+
if (_messageProducer == null) {
try {
createMessageProducer();
@@ -231,7 +239,9 @@
if (null == message) {
return false;
}
-
+
+ reset();
+
if (_messageProducer == null) {
try {
createMessageProducer();
@@ -248,7 +258,13 @@
message.setStringProperty(key, kvp.getValue());
}
}
+
+ checkTransaction();
+
sendMessage(message);
+ if ( jmsSession.getTransacted() && !transactional )
+ jmsSession.commit();
+
return true;
}
catch (JMSException e) {
@@ -313,6 +329,10 @@
private void createMessageProducer() throws CourierException, NamingContextException {
Context oJndiCtx = null;
+ reset();
+
+ checkTransaction();
+
if (_messageProducer == null) {
synchronized(this) {
if (_messageProducer == null) {
@@ -353,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);
@@ -373,14 +393,26 @@
} // ________________________________
private JmsConnectionPool getConnectionPool() throws ConnectionException {
- if(jmsConnectionPool == null) {
+ reset();
+
+ if (jmsConnectionPool == null) {
synchronized(this) {
+ try
+ {
+ checkTransaction();
+ }
+ catch (CourierException ex)
+ {
+ throw new ConnectionException(ex);
+ }
+
if(jmsConnectionPool == null) {
String sFactoryClass;
String sType;
Properties properties;
String username;
String password;
+ boolean transacted;
try {
sFactoryClass = _epr.getConnectionFactory();
@@ -388,6 +420,7 @@
properties = _epr.getJndiEnvironment();
username = _epr.getJMSSecurityPrincipal();
password = _epr.getJMSSecurityCredential();
+ transacted = _epr.getTransacted();
} catch (URISyntaxException e) {
throw new ConnectionException("Unexpected exception while getting JMS connection pool.", e);
}
@@ -396,7 +429,29 @@
sFactoryClass = "ConnectionFactory";
}
- jmsConnectionPool = JmsConnectionPoolContainer.getPool(properties, sFactoryClass, sType, username, password);
+ /*
+ * Needs to be a one-shot instance if 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!
}
}
}
@@ -404,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);
@@ -429,6 +534,8 @@
javax.jms.Message jmsMessage = null;
while (null != _messageConsumer) {
+ checkTransaction();
+
try {
jmsMessage = _messageConsumer.receive(millis);
break;
@@ -487,6 +594,8 @@
private void createMessageConsumer() throws CourierException, ConfigurationException, MalformedEPRException, NamingContextException {
Context oJndiCtx = null;
+ reset();
+
if (_messageConsumer == null) {
synchronized(this) {
if (_messageConsumer == null) {
@@ -545,7 +654,6 @@
}
} // ________________________________
-
long _sleepForRetries = 3000; // milliseconds
protected boolean _isReceiver;
@@ -566,6 +674,8 @@
protected volatile JmsConnectionPool jmsConnectionPool;
+ private boolean transactional = false;
+
/**
* Strategy for setting JMSProperties
*/
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -38,6 +38,8 @@
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.addressing.MalformedEPRException;
import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.couriers.CourierTimeoutException;
import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
@@ -103,15 +105,17 @@
}
catch (Exception e)
{
- _logger.info("Unable to release connection");
- _logger.debug("Unable to release connection", e);
+ e.printStackTrace();
+ _logger.info("Unable to release connection", e);
}
}
} // ________________________________
/**
- * package the ESB message in a java.io.Serializable, and write it
+ * package the ESB message in a java.io.Serializable, and write it.
+ * Delivery occurs within its own transaction if there is no
+ * global transaction active.
*
* @param message
* Message - the message to deliverAsync
@@ -119,6 +123,7 @@
* @throws CourierException -
* if problems were encountered
*/
+
public boolean deliver(Message message) throws CourierException
{
if (_isReceiver)
@@ -142,6 +147,30 @@
throw new CourierException("Problems with message header ",e);
}
+ 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.
+ */
+
+ if (transactional && !isActive)
+ {
+ throw new CourierException("Associated transaction is no longer active!");
+ }
+ }
+ catch (TransactionStrategyException ex)
+ {
+ throw new CourierException(ex);
+ }
+
if (null == _conn)
{
try
@@ -166,7 +195,10 @@
PS.setLong(iCol++, System.currentTimeMillis());
_conn.execUpdWait(PS, 3);
- _conn.commit();
+
+ if (!transactional)
+ _conn.commit();
+
return true;
}
catch (SQLException e)
@@ -175,6 +207,7 @@
{
try
{
+ if (!transactional)
_conn.rollback();
}
catch (Exception roll)
@@ -199,57 +232,104 @@
Message result = null;
long limit = System.currentTimeMillis()
+ ((millis < 100) ? 100 : millis);
+
do
{
try
- {
- ResultSet RS = getRowList();
- while (null != RS && RS.next())
+ {
+ 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)
{
- String messageId = RS.getString(1);
- if (null == (result = tryToPickup(messageId)))
- continue;
-
- /*
- * If this is fault message, then throw an exception with the contents. With the
- * exception of user-defined exceptions, faults will have nothing in the body, properties etc.
- */
-
- if (Type.isFaultMessage(result))
- Factory.createExceptionFromFault(result);
-
- return result;
+ throw new CourierException("Associated transaction is no longer active!");
}
- }
+ }
+ catch (TransactionStrategyException ex)
+ {
+ _logger.error("Could not determine transaction association!", ex);
+
+ throw new CourierException("Could not determine transaction association!");
+ }
+
+ ResultSet RS = null;
+
+ try
+ {
+ RS = getRowList();
+
+ while (null != RS && RS.next())
+ {
+ String messageId = RS.getString(1);
+
+ if (null == (result = tryToPickup(messageId)))
+ continue;
+
+ /*
+ * If this is fault message, then throw an exception with the contents. With the
+ * exception of user-defined exceptions, faults will have nothing in the body, properties etc.
+ */
+
+ if (Type.isFaultMessage(result))
+ Factory.createExceptionFromFault(result);
+
+ return result;
+ }
+ }
catch (SQLException e)
{
- _logger.debug("SQL Exception during pickup", e);
- return null;
+ _logger.debug("SQL Exception during pickup", e);
+ return null;
}
- finally
- {
- // Added to make sure we release transactions from all paths
- if (_conn != null)
- {
- try
- {
- _conn.rollback() ;
- }
- catch (final SQLException sqle) {} //ignore
- }
- }
- try
- {
- long lSleep = limit - System.currentTimeMillis();
- if (_pollLatency < lSleep)
- lSleep = _pollLatency;
- if (lSleep > 0)
- Thread.sleep(lSleep);
- }
- catch (InterruptedException e)
- {
- return null;
- }
+ finally
+ {
+ try
+ {
+ if (RS != null)
+ RS.close();
+ }
+ catch (final SQLException ex)
+ {
+ _logger.warn("SQLException during close of ResultSet.", ex);
+ }
+
+ // Added to make sure we release transactions from all paths
+ if (_conn != null)
+ {
+ try
+ {
+ if (!transactional)
+ _conn.rollback() ;
+ }
+ catch (final SQLException sqle) {} //ignore
+ }
+ }
+
+ try
+ {
+ long lSleep = limit - System.currentTimeMillis();
+ if (_pollLatency < lSleep)
+ lSleep = _pollLatency;
+ if (lSleep > 0)
+ Thread.sleep(lSleep);
+ }
+ catch (InterruptedException e)
+ {
+ return null;
+ }
} while (System.currentTimeMillis() <= limit);
return null;
} // ________________________________
@@ -265,9 +345,12 @@
while (_conn != null)
{
+ ResultSet RS = null;
+
try
{
- ResultSet RS = _conn.execQueryWait(select4UpdateStatement(), 3);
+ RS = _conn.execQueryWait(select4UpdateStatement(), 3);
+
while (RS.next())
{
Exception eBad = null;
@@ -308,10 +391,22 @@
{
throw new CourierException(e);
}
- catch (Exception e)
+ catch (Exception ex)
{
- jdbcConnectRetry(e);
+ jdbcConnectRetry(ex);
}
+ finally
+ {
+ try
+ {
+ if (RS != null)
+ RS.close();
+ }
+ catch (final Exception ex)
+ {
+ _logger.warn("Could not close ResultSet.", ex);
+ }
+ }
}
return null;
} // ________________________________
@@ -321,8 +416,9 @@
int iParm = 1;
deleteStatement().setString(iParm++, messageId);
_conn.execUpdWait(deleteStatement(), 3);
- _conn.commit();
-
+
+ if (!transactional)
+ _conn.commit();
}
private void changeStatus(String messageId, State to) throws SQLException
@@ -331,8 +427,9 @@
updateStatusStatement().setString(iParm++, to.getColumnValue());
updateStatusStatement().setString(iParm++, messageId);
_conn.execUpdWait(updateStatusStatement(), 3);
- _conn.commit();
-
+
+ if (!transactional)
+ _conn.commit();
}
private ResultSet getRowList() throws CourierException
@@ -356,6 +453,9 @@
}
catch (Exception e)
{
+ _logger.debug("Problem encountered while executing query.", e);
+ e.printStackTrace();
+
jdbcConnectRetry(e);
}
}
@@ -366,8 +466,8 @@
private void jdbcConnectRetry(Exception exc)
{
_logger.debug("DB problem, will try to reconnect", exc);
- if (null != _conn)
- _conn.release();
+
+ cleanup();
_conn = null;
_prepDelete = _prepGetList = _prepInsert = _prepSel4Upd = _prepUpdateStatus = null;
@@ -391,7 +491,7 @@
}
} // ________________________________
- private JdbcCleanConn getConn() throws SQLException, MalformedEPRException
+ private JdbcCleanConn getConn() throws SQLException, MalformedEPRException, NamingException
{
if (null == _conn)
{
@@ -407,10 +507,12 @@
initContext = new InitialContext();
DS = (DataSource) initContext.lookup(_epr.getDatasource());
} catch (NamingException e) {
- _logger.error("", e);
+ _logger.error("Problem resolving DataSource through JNDI", e);
+
+ throw e; // it'll get wrapped later anyway!
}
}
- _conn = new JdbcCleanConn(DS);
+ _conn = new JdbcCleanConn(DS, transactional);
}
catch (URISyntaxException ex)
{
@@ -420,10 +522,10 @@
return _conn;
} // ________________________________
- protected PreparedStatement listStatement()
+ protected PreparedStatement listStatement() throws SQLException
{
if (null == _prepGetList)
-
+ {
try
{
String[] columns =
@@ -439,11 +541,18 @@
.append("'").append(" order by 2");
_prepGetList = getConn().prepareStatement(sb.toString());
}
+ catch (SQLException ex)
+ {
+ throw ex;
+ }
catch (Exception e)
{
+ e.printStackTrace();
_logger.debug("Unable to prepare SQL statement", e);
- return null;
+ throw new SQLException("Problem encountered when trying to created PreparedStatement: "+e);
}
+ }
+
return _prepGetList;
} // ________________________________
@@ -589,6 +698,8 @@
protected PreparedStatement _prepUpdateStatus;
protected PreparedStatement _prepInsert;
protected PreparedStatement _prepDelete;
+
+ private boolean transactional = false;
protected static Logger _logger = Logger.getLogger(SqlTableCourier.class);
-}
+}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -37,6 +37,10 @@
void setExistsSql(String existsSql)
;
+ boolean getUseEOL() ;
+
+ void setUseEOL(boolean useEOL) ;
+
String getSqlFiles()
;
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2Database.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/H2DatabaseMBean.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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) ;
+}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,71 @@
+/*
+ * 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,
+ */
+
+package org.jboss.internal.soa.esb.message.format;
+
+/**
+ * Exception thrown for errors occurring during deferred deserialisation of values.
+ *
+ * @author <a href='kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+
+public class DeferredDeserialisationException extends RuntimeException
+{
+ /**
+ * The serial version UID for this exception.
+ */
+ private static final long serialVersionUID = -8941603736543453117L;
+
+ /**
+ * Construct a default deferred deserialisation exception.
+ */
+ public DeferredDeserialisationException()
+ {
+ super() ;
+ }
+
+ /**
+ * Construct a deferred deserialisation exception.
+ * @param message The message associated with the exception.
+ */
+ public DeferredDeserialisationException(final String message)
+ {
+ super(message) ;
+ }
+
+ /**
+ * Construct a deferred deserialisation exception.
+ * @param cause The origianl cause of the exception.
+ */
+ public DeferredDeserialisationException(final Throwable cause)
+ {
+ super(cause);
+ }
+
+ /**
+ * Construct a deferred deserialisation exception.
+ * @param message The message associated with the exception.
+ * @param cause The origianl cause of the exception.
+ */
+ public DeferredDeserialisationException(final String message, final Throwable cause)
+ {
+ super(message, cause) ;
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,10 +21,11 @@
package org.jboss.internal.soa.esb.message.format.serialized;
+import java.io.IOException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Hashtable;
-import java.util.Map;
import org.jboss.soa.esb.message.Attachment;
@@ -41,19 +42,23 @@
public Object get(String name)
{
- return _table.get(name);
+ return SerializedValueImpl.unwrap(_table.get(name));
}
public Object put(String name, Object value)
{
if (value instanceof Serializable)
- return _table.put(name,(Serializable)value);
+ {
+ final Serializable wrapped = SerializedValueImpl.wrap((Serializable)value) ;
+ final Serializable previous = _table.put(name, wrapped) ;
+ return SerializedValueImpl.unwrap(previous);
+ }
throw new IllegalArgumentException("value must be Serializable");
}
public Object remove(String name)
{
- return _table.remove(name);
+ return SerializedValueImpl.unwrap(_table.remove(name));
}
public String[] getNames()
@@ -63,25 +68,29 @@
public Object itemAt(int index) throws IndexOutOfBoundsException
{
- return _list.get(index);
+ return SerializedValueImpl.unwrap(_list.get(index));
}
public Object removeItemAt(int index) throws IndexOutOfBoundsException
{
- return _list.remove(index);
+ return SerializedValueImpl.unwrap(_list.remove(index));
}
public Object replaceItemAt(int index, Object value) throws IndexOutOfBoundsException
{
if (value instanceof Serializable)
- return _list.set(index,(Serializable)value);
+ {
+ final Serializable wrapped = SerializedValueImpl.wrap((Serializable)value) ;
+ final Serializable previous = _list.set(index, wrapped) ;
+ return SerializedValueImpl.unwrap(previous);
+ }
throw new IllegalArgumentException("value must be Serializable");
}
public void addItem(Object value)
{
if (value instanceof Serializable)
- _list.add((Serializable)value);
+ _list.add(SerializedValueImpl.wrap((Serializable)value)) ;
else
throw new IllegalArgumentException("value must be Serializable");
}
@@ -89,7 +98,7 @@
public void addItemAt(int index, Object value) throws IndexOutOfBoundsException
{
if (value instanceof Serializable)
- _list.add(index,(Serializable)value);
+ _list.add(index, SerializedValueImpl.wrap((Serializable)value));
else
throw new IllegalArgumentException("value must be Serializable");
}
@@ -112,44 +121,14 @@
.toString()+" ]";
}
- @Override
- public boolean equals(Object arg)
- {
- if (! (arg instanceof Attachment))
- return false;
- Attachment other = (Attachment)arg;
+ private void readObject(final ObjectInputStream stream)
+ throws IOException, ClassNotFoundException
+ {
+ stream.defaultReadObject() ;
+ SerializedValueImpl.wrapList(_list) ;
+ SerializedValueImpl.wrapMap(_table) ;
+ }
- if (other.getNamedCount() != _table.size())
- return false;
- for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
- {
- Object val = other.get(oCurr.getKey());
- if (null==oCurr.getValue())
- if (null==val)
- continue;
- else
- return false;
- if (!oCurr.getValue().equals(val))
- return false;
- }
-
- if (other.getUnnamedCount() != _list.size())
- return false;
- int index = 0;
- for (Serializable oCurr : _list)
- {
- Object val = other.itemAt(index++);
- if (null==oCurr)
- if (null==val)
- continue;
- else
- return false;
- if (!oCurr.equals(val))
- return false;
- }
- return true;
- }
-
- ArrayList<Serializable> _list = new ArrayList<Serializable>();
- Hashtable<String,Serializable> _table = new Hashtable<String,Serializable>();
+ private final ArrayList<Serializable> _list = new ArrayList<Serializable>();
+ private final Hashtable<String, Serializable> _table = new Hashtable<String,Serializable>();
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,7 +1,9 @@
package org.jboss.internal.soa.esb.message.format.serialized;
import java.io.Serializable;
+import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.Map;
import java.util.Set;
import org.jboss.internal.soa.esb.assertion.AssertArgument;
@@ -75,10 +77,7 @@
if (value instanceof Serializable)
{
- synchronized (_objects)
- {
- _objects.put(name, (Serializable) value);
- }
+ _objects.put(name, SerializedValueImpl.wrap((Serializable) value));
}
else
throw new IllegalArgumentException("Object must be Serializable.");
@@ -93,32 +92,23 @@
{
AssertArgument.isNotNull(name, "name");
- synchronized (_objects)
- {
- return _objects.get(name);
- }
+ return SerializedValueImpl.unwrap(_objects.get(name));
}
public String[] getNames()
{
- Set<String> keys = _objects.keySet();
-
- if (keys != null)
- {
- String[] toReturn = new String[keys.size()];
-
- return keys.toArray(toReturn);
- }
- else
- return null;
+ final Set<String> keys = _objects.keySet() ;
+ return keys.toArray(new String[0]) ;
}
+ public Enumeration<String> getEnumeratedNames()
+ {
+ return _objects.keys() ;
+ }
+
public Object remove(String name)
{
- synchronized (_objects)
- {
- return _objects.remove(name);
- }
+ return SerializedValueImpl.unwrap(_objects.remove(name));
}
public void replace(Body b)
@@ -159,36 +149,30 @@
if (content != null)
toReturn += "byte[]: " + Util.format(new String(content));
- if (_objects != null)
- {
- if (content != null)
- toReturn += ", ";
+ if (content != null)
+ toReturn += ", ";
- toReturn += "objects: " + _objects.toString();
- }
+ toReturn += "objects: " + _objects.toString();
return toReturn + " ]";
}
- public boolean equals(Object o)
- {
- if (o instanceof BodyImpl)
- {
- BodyImpl toCompare = (BodyImpl) o;
-
- return _objects.equals(toCompare._objects);
- }
- else
- return false;
- }
-
// copy constructor.
protected BodyImpl(BodyImpl orig)
{
- _objects = orig._objects;
+ _objects = new Hashtable<String, Serializable>(orig._objects);
}
+
+ protected void initialiseMap(final Map<String, Serializable> payload)
+ {
+ synchronized(_objects)
+ {
+ _objects.clear() ;
+ _objects.putAll(payload) ;
+ SerializedValueImpl.wrapMap(_objects) ;
+ }
+ }
- protected Hashtable<String, Serializable> _objects;
-
+ private Hashtable<String, Serializable> _objects;
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,28 +21,15 @@
* @author mark.little at jboss.com
*/
-import java.io.ByteArrayInputStream;
import java.io.IOException;
-import java.io.InputStream;
import java.io.Serializable;
-import java.io.StringWriter;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
-import org.jboss.internal.soa.esb.addressing.helpers.CallHelper;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.internal.soa.esb.message.format.xml.CallImpl;
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.message.Header;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
/**
* The message header. Contains such things as routing information.
*/
@@ -51,8 +38,6 @@
{
private static final long serialVersionUID = 0x0;
- public static final String HEADER_TAG = "Header";
-
public HeaderImpl ()
{
_call = new Call();
@@ -92,39 +77,14 @@
{
try
{
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
- Element header = doc.createElement(HEADER_TAG);
-
- doc.appendChild(header);
-
- header = CallHelper.toXML(_call, doc, header);
-
- StringWriter sWriter = new StringWriter();
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
- XMLSerializer xmlS = new XMLSerializer(sWriter, format);
- xmlS.asDOMSerializer();
- xmlS.serialize(doc);
-
- out.writeObject(sWriter.toString());
+ out.writeObject(CallImpl.toXML(_call)) ;
}
- catch (MarshalException ex)
+ catch (final XMLStreamException xmlse)
{
- ex.printStackTrace();
-
- throw new IOException(ex.toString());
+ final IOException ioe = new IOException("Caught XMLStreamException serialising Call") ;
+ ioe.initCause(xmlse) ;
+ throw ioe ;
}
- catch (ParserConfigurationException ex)
- {
- ex.printStackTrace();
-
- throw new IOException(ex.toString());
- }
}
}
@@ -132,37 +92,15 @@
{
try
{
- String header = (String) in.readObject();
- InputStream inStream = new ByteArrayInputStream(header.getBytes());
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.parse(inStream);
-
- Element headerElement = doc.getDocumentElement();
-
- _call = CallHelper.fromXML(headerElement);
+ final String header = (String) in.readObject();
+ _call = CallImpl.fromXML(header) ;
}
- catch (UnmarshalException ex)
+ catch (final XMLStreamException xmlse)
{
- ex.printStackTrace();
-
- throw new IOException(ex.toString());
+ final IOException ioe = new IOException("Caught XMLStreamException deserialising Call") ;
+ ioe.initCause(xmlse) ;
+ throw ioe ;
}
- catch (ParserConfigurationException ex)
- {
- ex.printStackTrace();
-
- throw new IOException(ex.toString());
- }
- catch (SAXException ex)
- {
- ex.printStackTrace();
-
- throw new IOException(ex.toString());
- }
}
private Call _call;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -22,7 +22,6 @@
import java.io.Serializable;
import java.util.Hashtable;
-import java.util.Map;
import org.jboss.soa.esb.message.Properties;
@@ -32,7 +31,7 @@
public Object getProperty(String name)
{
- return _table.get(name);
+ return SerializedValueImpl.unwrap(_table.get(name));
}
public Object getProperty(String name, Object defaultVal)
@@ -44,21 +43,25 @@
public Object setProperty(String name, Object value)
{
if (value instanceof Serializable)
- return _table.put(name, (Serializable) value);
+ {
+ final Serializable wrapped = SerializedValueImpl.wrap((Serializable)value) ;
+ final Serializable previous = _table.put(name, wrapped) ;
+ return SerializedValueImpl.unwrap(previous);
+ }
else
throw new IllegalArgumentException("Value must be serializable");
}
public Object remove(String name)
{
- return _table.remove(name);
+ return SerializedValueImpl.unwrap(_table.remove(name));
}
public int size() {return _table.size(); }
public String[] getNames()
{
- return _table.keySet().toArray(new String[_table.size()]);
+ return _table.keySet().toArray(new String[0]);
}
public String toString()
@@ -66,27 +69,5 @@
return "properties: [ "+_table.toString()+" ]";
}
- @Override
- public boolean equals(Object arg)
- {
- if (! (arg instanceof Properties))
- return false;
- Properties other = (Properties)arg;
- if (other.size() != _table.size())
- return false;
- for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
- {
- Object val = other.getProperty(oCurr.getKey());
- if (null==oCurr.getValue())
- if (null==val)
- continue;
- else
- return false;
- if (!oCurr.getValue().equals(val))
- return false;
- }
- return true;
- }
-
- Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
+ private Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,252 @@
+/*
+ * 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,
+ */
+
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.jboss.internal.soa.esb.message.format.DeferredDeserialisationException;
+import org.jboss.soa.esb.util.ContextObjectInputStream;
+
+/**
+ * Wrapper class for serialised values, supporting JIT deserialisation.
+ *
+ * @author <a href='kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+
+public class SerializedValueImpl implements Serializable
+{
+ /**
+ * The serial version UID for this class.
+ */
+ private static final long serialVersionUID = -5354588126152655437L;
+
+ /**
+ * The transient value.
+ */
+ private transient Serializable value ;
+
+ /**
+ * The serialised form.
+ */
+ private byte[] serialisedForm ;
+
+ /**
+ * Construct the serialised value wrapper for the specific value.
+ * @param value The serializable value.
+ */
+ private SerializedValueImpl(final Serializable value)
+ {
+ this.value = value ;
+ }
+
+ /**
+ * Get the wrapped value.
+ * @return The wrapped value.
+ */
+ public Serializable getValue()
+ {
+ if ((value == null) && (serialisedForm != null))
+ {
+ final ByteArrayInputStream bais = new ByteArrayInputStream(serialisedForm) ;
+ final ObjectInputStream ois ;
+ try
+ {
+ ois = new ContextObjectInputStream(bais) ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new DeferredDeserialisationException("Error creating object input stream", ioe) ;
+ }
+
+ try
+ {
+ value = (Serializable)ois.readObject() ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new DeferredDeserialisationException("Error reading object input stream", ioe) ;
+ }
+ catch (final ClassNotFoundException cnfe)
+ {
+ throw new DeferredDeserialisationException("Error constructing object value", cnfe) ;
+ }
+ serialisedForm = null ;
+ }
+ return value ;
+ }
+
+ /**
+ * Handle the serialisation.
+ * @param stream The object output stream.
+ * @throws IOException For errors during serialisation.
+ */
+ private void writeObject(final ObjectOutputStream stream)
+ throws IOException
+ {
+ if (value != null)
+ {
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream() ;
+ final ObjectOutputStream oos = new ObjectOutputStream(baos) ;
+ oos.writeObject(value) ;
+ serialisedForm = baos.toByteArray() ;
+ }
+ stream.defaultWriteObject() ;
+ }
+
+ /**
+ * Return a string representation of this object.
+ * @return the string representation of the value or a deferred identifier.
+ */
+ public String toString()
+ {
+ if (value != null)
+ {
+ return value.toString() ;
+ }
+ else
+ {
+ return "Deferred serialized value: " + Integer.toHexString(System.identityHashCode(this)) ;
+ }
+ }
+
+ /**
+ * Create a wrapper for the specific value.
+ * @param value The value to wrap.
+ * @return a wrapped value or the value it serialisation is safe.
+ */
+ public static Serializable wrap(final Serializable value)
+ {
+ if (value != null)
+ {
+ final Class<?> componentType = getComponentType(value.getClass()) ;
+
+ if ((componentType != Boolean.class) &&
+ (componentType != Boolean.TYPE) &&
+ (componentType != Byte.class) &&
+ (componentType != Byte.TYPE) &&
+ (componentType != Short.class) &&
+ (componentType != Short.TYPE) &&
+ (componentType != Character.class) &&
+ (componentType != Character.TYPE) &&
+ (componentType != Integer.class) &&
+ (componentType != Integer.TYPE) &&
+ (componentType != Long.class) &&
+ (componentType != Long.TYPE) &&
+ (componentType != Float.class) &&
+ (componentType != Float.TYPE) &&
+ (componentType != Double.class) &&
+ (componentType != Double.TYPE) &&
+ (componentType != String.class) &&
+ (componentType != SerializedValueImpl.class))
+ {
+ return new SerializedValueImpl(value) ;
+ }
+ }
+ return value ;
+ }
+
+ /**
+ * Unwrap the object, returning the value.
+ * @param wrapped The wrapped value.
+ * @return the unwrapped object.
+ */
+ public static Serializable unwrap(final Serializable value)
+ {
+ if (value instanceof SerializedValueImpl)
+ {
+ return ((SerializedValueImpl)value).getValue() ;
+ }
+ return value ;
+ }
+
+ /**
+ * Wrap the entries in the specified list.
+ * @param list The list to be wrapped.
+ */
+ public static void wrapList(final List<Serializable> list)
+ {
+ final int listSize = list.size() ;
+ for(int count = 0 ; count < listSize ; count++)
+ {
+ final Serializable current = list.get(count) ;
+ final Serializable wrapped = SerializedValueImpl.wrap(current) ;
+ if (current != wrapped)
+ {
+ list.set(count, wrapped) ;
+ }
+ }
+ }
+
+ /**
+ * Wrap the values in the specified map.
+ * @param map The map to be wrapped.
+ */
+ public static <K> void wrapMap(final Map<K, Serializable> map)
+ {
+ if (map.size() > 0)
+ {
+ Hashtable<K, Serializable> wrappedMap = null ;
+ for(Entry<K, Serializable> entry: map.entrySet())
+ {
+ final Serializable current = entry.getValue() ;
+ final Serializable wrapped = SerializedValueImpl.wrap(current) ;
+ if (current != wrapped)
+ {
+ if (wrappedMap == null)
+ {
+ wrappedMap = new Hashtable<K, Serializable>() ;
+ }
+ wrappedMap.put(entry.getKey(), wrapped) ;
+ }
+ }
+ if (wrappedMap != null)
+ {
+ map.putAll(wrappedMap) ;
+ }
+ }
+ }
+
+ /**
+ * Get the component type for this class.
+ * @param clazz The class to check.
+ * @return The component type for the class.
+ */
+ private static Class<?> getComponentType(final Class<?> clazz)
+ {
+ if (clazz.isArray())
+ {
+ return getComponentType(clazz.getComponentType()) ;
+ }
+ else
+ {
+ return clazz ;
+ }
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/MapBodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/MapBodyImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/MapBodyImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -2,7 +2,6 @@
import java.io.Serializable;
import java.util.Enumeration;
-import java.util.Hashtable;
import java.util.Map;
import org.jboss.internal.soa.esb.message.format.serialized.BodyImpl;
@@ -49,9 +48,7 @@
public void setMap (Map<String, Serializable> payload)
{
- super._objects = new Hashtable<String, Serializable>();
-
- super._objects.putAll(payload);
+ initialiseMap(payload) ;
}
public boolean getBoolean (String name) throws InvalidPayloadException
@@ -164,7 +161,7 @@
public Enumeration<String> getMapNames ()
{
- return super._objects.keys();
+ return getEnumeratedNames();
}
public boolean itemExists (String name)
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,21 +21,20 @@
package org.jboss.internal.soa.esb.message.format.xml;
-import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Hashtable;
-import java.util.Map;
+import java.util.Map.Entry;
-import org.jboss.internal.soa.esb.util.Encoding;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.jboss.internal.soa.esb.util.stax.ElementContent;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+import org.jboss.internal.soa.esb.util.stax.TextElement;
import org.jboss.soa.esb.message.Attachment;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
* Messages may contain attachments that do not appear in the main payload body.
@@ -44,70 +43,76 @@
* @author Mark Little
*/
-public class AttachmentImpl implements Attachment, java.io.Serializable
+public class AttachmentImpl extends ElementContent implements Attachment
{
- public static final String ATTACHMENT_TAG = "Attachment";
- public static final String NAME_ATTR = "name";
- public static final String NAMED_TAG = "Named";
- public static final String UNNAMED_TAG = "UnNamed";
-
- private static final long serialVersionUID = 0x0;
-
+ /**
+ * Default constructor.
+ */
+ public AttachmentImpl()
+ {
+ }
+
+ /**
+ * Construct the attachments from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public AttachmentImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
public Object get(String name)
{
- return _table.get(name);
+ return unwrap(_table.get(name));
}
public Object put(String name, Object value)
{
- if (value instanceof Serializable)
- return _table.put(name, (Serializable) value);
- throw new IllegalArgumentException("value must be Serializable");
- }
+ assertValidAttachment(value);
+ return unwrap(_table.put(name, new SerializedValueImpl((Serializable) value)));
+ }
- public Object remove(String name)
+ public Object remove(String name)
{
- return _table.remove(name);
+ return unwrap(_table.remove(name));
}
public String[] getNames()
{
- return _table.keySet().toArray(new String[_table.size()]);
+ return _table.keySet().toArray(new String[0]);
}
public Object itemAt(int index) throws IndexOutOfBoundsException
{
- return _list.get(index);
+ return unwrap(_list.get(index));
}
public Object removeItemAt(int index) throws IndexOutOfBoundsException
{
- return _list.remove(index);
+ return unwrap(_list.remove(index));
}
public Object replaceItemAt(int index, Object value)
throws IndexOutOfBoundsException
{
- if (value instanceof Serializable)
- return _list.set(index, (Serializable) value);
- throw new IllegalArgumentException("value must be Serializable");
+ assertValidAttachment(value);
+ return unwrap(_list.set(index, new SerializedValueImpl((Serializable) value)));
}
public void addItem(Object value)
{
- if (value instanceof Serializable)
- _list.add((Serializable) value);
- else
- throw new IllegalArgumentException("value must be Serializable");
+ assertValidAttachment(value);
+ _list.add(new SerializedValueImpl((Serializable) value));
}
public void addItemAt(int index, Object value)
throws IndexOutOfBoundsException
{
- if (value instanceof Serializable)
- _list.add(index, (Serializable) value);
- else
- throw new IllegalArgumentException("value must be Serializable");
+ assertValidAttachment(value);
+ _list.add(index, new SerializedValueImpl((Serializable) value));
}
public int getNamedCount()
@@ -128,164 +133,72 @@
}
/**
- * toXML(elem) - Will build a child element with appropriate values and
- * append it to arg0
- *
- * @param elem
- * Element - where to add 'this' as a child node
- * @return Element - 'this' as the added Element, or <null> if no
- * properties in table and nothing was appended to arg0
- * @see XMLUtil.ATTACHMENT_TAG
- */
- public Element toXML(Element elem) throws MarshalException
- {
- if (_table.size() < 1 && _list.size() < 1)
- return null;
-
- Document doc = elem.getOwnerDocument();
- Element thisElement = doc.createElement(ATTACHMENT_TAG);
-
- try
- {
- listToXml(doc, thisElement);
- tableToXml(doc, thisElement);
- }
- catch (IOException ex)
- {
- throw new MarshalException(ex);
- }
-
- elem.appendChild(thisElement);
- return thisElement;
- }
-
- private void tableToXml(Document doc, Element elem) throws IOException
- {
- for (Map.Entry<String, Serializable> oCurr : _table.entrySet())
- {
- Element named = doc.createElement(NAMED_TAG);
- named.setAttribute(NAME_ATTR, oCurr.getKey());
- named.appendChild(doc.createCDATASection(Encoding.encodeObject(oCurr
- .getValue())));
- elem.appendChild(named);
- }
- }
-
- private void listToXml(Document doc, Element elem) throws IOException
- {
- for (Serializable oCurr : _list)
- {
- Element anonymous = doc.createElement(UNNAMED_TAG);
- anonymous.appendChild(doc.createCDATASection(Encoding
- .encodeObject(oCurr)));
- elem.appendChild(anonymous);
- }
- }
-
- /**
- * fromXml(elem) - Populate properties found in appropriate child element
- *
- * @see XMLUtil.ATTACHMENT_TAG
- * @param elem -
- * Element where to look for child nodes
- */
- public void fromXML(Element elem) throws UnmarshalException
- {
- _table.clear();
- _list.clear();
-
- NodeList NL = elem.getElementsByTagName(ATTACHMENT_TAG);
- for (int i1 = 0; i1 < NL.getLength(); i1++)
- {
- Node oCurr = NL.item(i1);
- if ((oCurr instanceof Element))
- {
- try
- {
- listFromXml((Element) oCurr);
- tableFromXml((Element) oCurr);
- }
- catch (IOException ex)
- {
- throw new UnmarshalException(ex);
- }
- catch (ClassNotFoundException ex)
- {
- throw new UnmarshalException(ex);
- }
- }
- }
- }
-
- private void listFromXml(Element elem) throws IOException, ClassNotFoundException
- {
- NodeList anonymous = elem.getElementsByTagName(UNNAMED_TAG);
- for (int i1 = 0; i1 < anonymous.getLength(); i1++)
- {
- Node oCurr = anonymous.item(i1);
- if (oCurr instanceof Element)
- {
- CDATASection cdata = (CDATASection) oCurr.getFirstChild();
- Object value = Encoding.decodeToObject(cdata.getWholeText());
- _list.add((Serializable) value);
- }
- }
- }
-
- private void tableFromXml(Element elem) throws IOException, ClassNotFoundException
- {
- NodeList named = elem.getElementsByTagName(NAMED_TAG);
- for (int i1 = 0; i1 < named.getLength(); i1++)
- {
- Node oCurr = named.item(i1);
- if (oCurr instanceof Element)
- {
- CDATASection cdata = (CDATASection) oCurr.getFirstChild();
- String name = ((Element) oCurr).getAttribute(NAME_ATTR);
- Object value = Encoding.decodeToObject(cdata.getWholeText());
- _table.put(name, (Serializable) value);
- }
- }
- }
-
+ * Write the child content of the element.
+ * @param out The output stream.
+ * @throws XMLStreamException For errors during output.
+ */
@Override
- public boolean equals(Object arg)
+ protected void writeChildContent(XMLStreamWriter out)
+ throws XMLStreamException
{
- if (! (arg instanceof Attachment))
- return false;
- Attachment other = (Attachment)arg;
-
- if (other.getNamedCount() != _table.size())
- return false;
- for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
- {
- Object val = other.get(oCurr.getKey());
- if (null==oCurr.getValue())
- if (null==val)
- continue;
- else
- return false;
- if (!oCurr.getValue().equals(val))
- return false;
- }
-
- if (other.getUnnamedCount() != _list.size())
- return false;
- int index = 0;
- for (Serializable oCurr : _list)
- {
- Object val = other.itemAt(index++);
- if (null==oCurr)
- if (null==val)
- continue;
- else
- return false;
- if (!oCurr.equals(val))
- return false;
- }
- return true;
+ for (SerializedValueImpl value : _list)
+ {
+ final TextElement unnamed = new TextElement(value.getSerialisedForm()) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_UNNAMED, unnamed) ;
+ }
+
+ for (Entry<String, SerializedValueImpl> entry : _table.entrySet())
+ {
+ final TextElement named = new TextElement(entry.getValue().getSerialisedForm()) ;
+ final String origNamedURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_NAMED) ;
+ StreamHelper.writeAttribute(out, XMLUtil.ESB_QNAME_ATTRIBUTE_ATTACHMENT_NAMED_NAME, entry.getKey()) ;
+ named.writeContent(out) ;
+ StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_NAMED.getPrefix(), origNamedURI) ;
+ }
}
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ protected void putElement(final XMLStreamReader in,
+ final QName elementName)
+ throws XMLStreamException
+ {
+ if (XMLUtil.ESB_QNAME_ATTACHMENT_UNNAMED.equals(elementName))
+ {
+ final TextElement unnamed = new TextElement(in) ;
+ final SerializedValueImpl value = new SerializedValueImpl(unnamed.getText());
+ _list.add(value);
+ }
+ else if (XMLUtil.ESB_QNAME_ATTACHMENT_NAMED.equals(elementName))
+ {
+ final String name = StreamHelper.getAttributeValue(in, XMLUtil.ESB_QNAME_ATTRIBUTE_ATTACHMENT_NAMED_NAME) ;
+ final TextElement valueElement = new TextElement(in) ;
+ final SerializedValueImpl value = new SerializedValueImpl(valueElement.getText()) ;
+ _table.put(name, value) ;
+ }
+ else
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
+ }
+
+ private void assertValidAttachment(Object attachment) {
+ if(attachment == null) {
+ throw new IllegalArgumentException("Cannot set null object as a message attachment. Attachment objects must be non-null and Serializable.");
+ } else if(!(attachment instanceof Serializable)) {
+ throw new IllegalArgumentException("Cannot set an Object of type '" + attachment.getClass().getName() + "' as a message attachment. Attachment objects must be Serializable.");
+ }
+ }
- ArrayList<Serializable> _list = new ArrayList<Serializable>();
- Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
+ private Object unwrap(final SerializedValueImpl value)
+ {
+ return (value == null ? null : value.getValue()) ;
+ }
+
+ private ArrayList<SerializedValueImpl> _list = new ArrayList<SerializedValueImpl>();
+ private Hashtable<String, SerializedValueImpl> _table = new Hashtable<String, SerializedValueImpl>();
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,21 +1,27 @@
package org.jboss.internal.soa.esb.message.format.xml;
+import java.io.Serializable;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.Map;
import java.util.Set;
+import java.util.Map.Entry;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.internal.soa.esb.message.format.xml.marshal.MarshalUnmarshalManager;
+import org.jboss.internal.soa.esb.message.format.xml.marshal.MarshalValueImpl;
import org.jboss.internal.soa.esb.util.Encoding;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.internal.soa.esb.util.stax.ElementContent;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+import org.jboss.internal.soa.esb.util.stax.TextElement;
import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.body.content.BytesBody;
import org.jboss.soa.esb.util.Util;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
/*
* JBoss, Home of Professional Open Source
@@ -47,35 +53,24 @@
* classes.
*/
-public class BodyImpl implements Body
+public class BodyImpl extends ElementContent implements Body
{
- public static final String BODY_TAG = "Body";
-
- public static final String BYTES_TAG = "Bytes";
-
- public static final String CONTENT_TAG = "Content";
-
- public static final String KEY_TAG = "Key";
-
- public static final String VALUE_TAG = "Value";
-
public BodyImpl()
{
- _objects = new Hashtable<String, Object>();
}
+
+ /**
+ * Construct a body from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public BodyImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
- public boolean equals(Object o)
- {
- if (o instanceof BodyImpl)
- {
- BodyImpl toCompare = (BodyImpl) o;
-
- return _objects.equals(toCompare._objects);
- }
- else
- return false;
- }
-
public void add(Object value)
{
add(Body.DEFAULT_LOCATION, value);
@@ -86,10 +81,7 @@
AssertArgument.isNotNull(value, "value");
AssertArgument.isNotNull(name, "name");
- synchronized (_objects)
- {
- _objects.put(name, value);
- }
+ _objects.put(name, new MarshalValueImpl(value));
}
public Object get()
@@ -101,172 +93,108 @@
{
AssertArgument.isNotNull(name, "name");
- synchronized (_objects)
- {
- return _objects.get(name);
- }
+ return unwrap(_objects.get(name));
}
public String[] getNames()
{
Set<String> keys = _objects.keySet();
-
- if (keys != null)
- {
- String[] toReturn = new String[keys.size()];
-
- return keys.toArray(toReturn);
- }
- else
- return null;
+ return keys.toArray(new String[0]) ;
}
+
+ public Enumeration<String> getEnumeratedNames()
+ {
+ return _objects.keys() ;
+ }
public Object remove(String name)
{
- synchronized (_objects)
- {
- return _objects.remove(name);
- }
+ return unwrap(_objects.remove(name));
}
- public Element toXML(Element envelope) throws MarshalException
+ /**
+ * Write the child content of the element.
+ * @param out The output stream.
+ * @throws XMLStreamException For errors during output.
+ */
+ @Override
+ protected void writeChildContent(XMLStreamWriter out)
+ throws XMLStreamException
{
- Document doc = envelope.getOwnerDocument();
- Element bodyElement = doc.createElement(BODY_TAG);
-
- envelope.appendChild(bodyElement);
-
- /*
- * Keep separate byte array section for now, in case anyone is looking
- * for it within the XML (e.g., roll-your-own CBR).
- */
-
- byte[] content = getByteArray();
-
- if (content != null)
- {
- Element byteElement = doc.createElement(BYTES_TAG);
-
- byteElement.appendChild(doc.createCDATASection(Encoding
- .encodeBytes(content)));
-
- bodyElement.appendChild(byteElement);
- }
-
- /*
- * This would normally be handled by an external adapter.
- */
-
- Enumeration<String> keys = _objects.keys();
-
- while (keys.hasMoreElements())
- {
- String key = keys.nextElement();
- Object value = _objects.get(key);
-
- Element objElement = doc.createElement(CONTENT_TAG);
- Element keyElement = doc.createElement(KEY_TAG);
- Element valueElement = doc.createElement(VALUE_TAG);
-
- keyElement.appendChild(doc.createCDATASection(Encoding
- .encodeBytes(key.getBytes())));
-
- objElement.appendChild(keyElement);
- objElement.appendChild(valueElement);
-
- if (MarshalUnmarshalManager.getInstance().marshal(valueElement,
- value))
- {
- bodyElement.appendChild(objElement);
- }
- else
- throw new MarshalException("Cannot pack object " + key);
- }
-
- return bodyElement;
+ /*
+ * Keep separate byte array section for now, in case anyone is looking
+ * for it within the XML (e.g., roll-your-own CBR).
+ */
+ final byte[] content = getByteArray() ;
+ if (content != null)
+ {
+ final TextElement bytesContent = new TextElement(Encoding.encodeBytes(content)) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_BODY_BYTES_CONTENT, bytesContent) ;
+ }
+
+ // These should be handled by a proper element content
+ for(Entry<String, MarshalValueImpl> entry: _objects.entrySet())
+ {
+ final String origContentURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT) ;
+
+ final TextElement key = new TextElement(Encoding.encodeBytes(entry.getKey().getBytes())) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT_KEY, key) ;
+
+ final String origValueURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT_VALUE) ;
+ if (!MarshalUnmarshalManager.getInstance().marshal(out, entry.getValue()))
+ {
+ throw new XMLStreamException("Cannot pack object:" + entry.getKey()) ;
+ }
+ StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT_VALUE.getPrefix(), origValueURI) ;
+
+ StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT.getPrefix(), origContentURI) ;
+ }
}
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ */
+ @Override
+ protected void putElement(final XMLStreamReader in, final QName elementName)
+ throws XMLStreamException
+ {
+ if (XMLUtil.ESB_QNAME_BODY_CONTENT.equals(elementName))
+ {
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_BODY_CONTENT_KEY) ;
+ final TextElement keyElement = new TextElement(in) ;
+ final String key = new String(Encoding.decodeToBytes(keyElement.getText())) ;
- public void fromXML(Element envelope) throws UnmarshalException
- {
- NodeList nl = envelope.getChildNodes();
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_BODY_CONTENT_VALUE) ;
+ final MarshalValueImpl value = MarshalUnmarshalManager.getInstance().unmarshal(in) ;
+ StreamHelper.checkParentFinished(in) ;
+ StreamHelper.checkParentFinished(in) ;
+
+ if (value == null)
+ throw new XMLStreamException("Cannot unpack object: " + key) ;
+ else
+ _objects.put(key, value) ;
+ }
+ else if (XMLUtil.ESB_QNAME_BODY_BYTES_CONTENT.equals(elementName))
+ {
+ final TextElement textElement = new TextElement(in) ;
+ final String value = textElement.getText();
+ if (value != null)
+ {
+ setByteArray(Encoding.decodeToBytes(value)) ;
+ }
+ else
+ {
+ setByteArray(new byte[0]) ;
+ }
+ }
+ else
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
+ }
- for (int i = 0; i < nl.getLength(); i++)
- {
- /*
- * TODO
- *
- * In the past, bugs in certain Dom implementations mean that
- * getElementsByName did not always work. Still the case? Plus this
- * way is quicker.
- */
-
- if (nl.item(i).getNodeName().equals(BODY_TAG))
- {
- NodeList children = nl.item(i).getChildNodes();
-
- for (int j = 0; j < children.getLength(); j++)
- {
- Object xxx = children.item(j);
-
- if (!(xxx instanceof Element))
- continue;
-
- Element node = (Element) xxx;
-
- if (node.getNodeName().equals(BYTES_TAG))
- {
- CDATASection cdata = (CDATASection) node
- .getFirstChild();
-
- // support empty byte (null files etc.)
-
- if (cdata != null)
- setByteArray(Encoding.decodeToBytes(cdata.getWholeText()));
- else
- setByteArray(new byte[0]);
- }
- else
- {
- if (node.getNodeName().equals(CONTENT_TAG))
- {
- final NodeList childList = node.getChildNodes();
-
- String key = null;
- Object value = null;
-
- for (int k = 0; k < childList.getLength(); k++)
- {
- if (childList.item(k).getNodeName().equals(
- VALUE_TAG))
- value = MarshalUnmarshalManager
- .getInstance()
- .unmarshal(
- (Element) childList.item(k));
-
- if (childList.item(k).getNodeName().equals(
- KEY_TAG))
- {
- CDATASection cdata = (CDATASection) childList
- .item(k).getFirstChild();
-
- key = new String(Encoding.decodeToBytes(cdata
- .getWholeText()));
- }
- }
-
- if (value == null)
- throw new UnmarshalException(
- "Cannot unpack object "
- + node.getNodeName());
- else
- _objects.put(key, value);
- }
- }
- }
- }
- }
- }
-
public void setByteArray(byte[] content)
{
add(BytesBody.BYTES_LOCATION, content);
@@ -343,6 +271,22 @@
_objects = copy._objects;
}
- protected Hashtable<String, Object> _objects;
-
+ private Object unwrap(final MarshalValueImpl value)
+ {
+ return (value == null ? null : value.getValue()) ;
+ }
+
+ protected void initialiseMap(final Map<String, Serializable> payload)
+ {
+ synchronized(_objects)
+ {
+ _objects.clear() ;
+ for(Entry<String, Serializable> entry: payload.entrySet())
+ {
+ _objects.put(entry.getKey(), new MarshalValueImpl(entry.getValue())) ;
+ }
+ }
+ }
+
+ private Hashtable<String, MarshalValueImpl> _objects = new Hashtable<String, MarshalValueImpl>();
}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,229 @@
+package org.jboss.internal.soa.esb.message.format.xml;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
+import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.util.stax.ElementContent;
+import org.jboss.internal.soa.esb.util.stax.NamedElement;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+import org.jboss.internal.soa.esb.util.stax.TextElement;
+import org.jboss.internal.soa.esb.util.stax.URIElement;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.jboss.soa.esb.message.Context;
+/*
+ * 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,
+ */
+
+public class CallImpl extends ElementContent implements Context
+{
+ /**
+ * The call object associated with this type.
+ */
+ private final Call call ;
+ /**
+ * Extensions discovered while parsing.
+ */
+ private List<NamedElement> extensions = new ArrayList<NamedElement>() ;
+
+ /**
+ * Default constructor for the call.
+ */
+ public CallImpl(final Call call)
+ {
+ this.call = call ;
+ }
+
+ /**
+ * Construct a context from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public CallImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ this.call = new Call() ;
+ parse(in) ;
+
+ if (extensions.size() > 0)
+ {
+ final EPR origEPR = call.getTo() ;
+ final PortReference to = origEPR.getAddr() ;
+ for(NamedElement element: extensions)
+ {
+ final QName name = element.getName() ;
+ final TextElement content = (TextElement)element.getElementContent() ;
+ to.addExtension(name.getLocalPart(), name.getPrefix(), name.getNamespaceURI(), content.getText()) ;
+ }
+
+ call.setTo(EPRHelper.getSpecificEPR(origEPR)) ;
+ }
+ }
+
+ /**
+ * Return the call object.
+ * @return The call object.
+ */
+ public Call getCall()
+ {
+ return call ;
+ }
+
+ /**
+ * Write the child content of the element.
+ * @param out The output stream.
+ * @throws XMLStreamException For errors during output.
+ */
+ @Override
+ protected void writeChildContent(XMLStreamWriter out)
+ throws XMLStreamException
+ {
+ StreamHelper.writeNamespace(out, XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI) ;
+
+ if (call.getTo() != null)
+ {
+ EPRHelper.toXML(out, XMLUtil.QNAME_TO_TAG, call.getTo());
+ }
+
+ if (call.getFrom() != null)
+ {
+ EPRHelper.toXML(out, XMLUtil.QNAME_FROM_TAG, call.getFrom());
+ }
+
+ if (call.getReplyTo() != null)
+ {
+ EPRHelper.toXML(out, XMLUtil.QNAME_REPLY_TO_TAG, call.getReplyTo());
+ }
+
+ if (call.getRelatesTo() != null)
+ {
+ final URIElement actionElement = new URIElement(call.getRelatesTo()) ;
+ StreamHelper.writeElement(out, XMLUtil.QNAME_RELATES_TO_TAG, actionElement) ;
+ }
+
+ if (call.getFaultTo() != null)
+ {
+ EPRHelper.toXML(out, XMLUtil.QNAME_FAULT_TO_TAG, call.getFaultTo());
+ }
+
+ if (call.getAction() != null)
+ {
+ final URIElement actionElement = new URIElement(call.getAction()) ;
+ StreamHelper.writeElement(out, XMLUtil.QNAME_ACTION_TAG, actionElement) ;
+ }
+
+ if (call.getMessageID() != null)
+ {
+ final URIElement messageIdElement = new URIElement(call.getMessageID()) ;
+ StreamHelper.writeElement(out, XMLUtil.QNAME_MESSAGE_IDENTIFIER_TAG, messageIdElement) ;
+ }
+ }
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ */
+ protected void putElement(final XMLStreamReader in, final QName elementName)
+ throws XMLStreamException
+ {
+ if (XMLUtil.WSA_NAMESPACE_URI.equals(elementName.getNamespaceURI()))
+ {
+ final String name = elementName.getLocalPart() ;
+ if (XMLUtil.TO_TAG.equals(name))
+ {
+ call.setTo(EPRHelper.fromXML(in));
+ }
+ else if (XMLUtil.FROM_TAG.equals(name))
+ {
+ call.setFrom(EPRHelper.fromXML(in));
+ }
+ else if (XMLUtil.REPLY_TO_TAG.equals(name))
+ {
+ call.setReplyTo(EPRHelper.fromXML(in));
+ }
+ else if (XMLUtil.RELATES_TO_TAG.equals(name))
+ {
+ final URIElement relatesTo = new URIElement(in) ;
+ call.setRelatesTo(relatesTo.getValue()) ;
+ }
+ else if (XMLUtil.FAULT_TO_TAG.equals(name))
+ {
+ call.setFaultTo(EPRHelper.fromXML(in));
+ }
+ else if (XMLUtil.ACTION_TAG.equals(name))
+ {
+ final URIElement action = new URIElement(in) ;
+ call.setAction(action.getValue()) ;
+ }
+ else if (XMLUtil.MESSAGE_IDENTIFIER_TAG.equals(name))
+ {
+ final URIElement messageIdentifier = new URIElement(in) ;
+ call.setMessageID(messageIdentifier.getValue()) ;
+ }
+ else
+ {
+ final TextElement content = new TextElement(in) ;
+ extensions.add(new NamedElement(elementName, content)) ;
+ }
+ }
+ else
+ {
+ final TextElement content = new TextElement(in) ;
+ extensions.add(new NamedElement(elementName, content)) ;
+ }
+ }
+
+ public static String toXML(final Call call)
+ throws XMLStreamException
+ {
+ final CallImpl callImpl = new CallImpl(call) ;
+ final StringWriter writer = new StringWriter() ;
+ final XMLStreamWriter out = XMLHelper.getXMLStreamWriter(writer) ;
+ final QName name = org.jboss.internal.soa.esb.message.format.xml.XMLUtil.ESB_QNAME_HEADER ;
+ final String origURI = StreamHelper.writeStartElement(out, name) ;
+ callImpl.writeContent(out) ;
+ StreamHelper.writeEndElement(out, name.getPrefix(), origURI) ;
+ out.flush();
+ return writer.toString() ;
+ }
+
+ public static Call fromXML(final String content)
+ throws XMLStreamException
+ {
+ final StringReader reader = new StringReader(content) ;
+ final XMLStreamReader in = XMLHelper.getXMLStreamReader(reader) ;
+ StreamHelper.checkNextStartTag(in,
+ org.jboss.internal.soa.esb.message.format.xml.XMLUtil.ESB_QNAME_HEADER) ;
+ final CallImpl callImpl = new CallImpl(in) ;
+ return callImpl.getCall() ;
+ }
+}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,10 +1,11 @@
package org.jboss.internal.soa.esb.message.format.xml;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.jboss.internal.soa.esb.util.stax.ElementContent;
import org.jboss.soa.esb.message.Context;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
/*
* JBoss, Home of Professional Open Source
@@ -27,26 +28,40 @@
* @author mark.little at jboss.com
*/
-public class ContextImpl implements Context
+public class ContextImpl extends ElementContent implements Context
{
- public static final String CONTEXT_TAG = "Context";
+ /**
+ * Default constructor for the context.
+ */
+ public ContextImpl()
+ {
+ }
- public String toString ()
- {
- return "context: [ ]";
- }
-
- public Element toXML (Element envelope) throws MarshalException
- {
- Document doc = envelope.getOwnerDocument();
- Element contextElement = doc.createElement(CONTEXT_TAG);
-
- envelope.appendChild(contextElement);
-
- return contextElement;
- }
-
- public void fromXML (Element envelope) throws UnmarshalException
- {
- }
+ /**
+ * Construct a context from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public ContextImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
+ public String toString ()
+ {
+ return "context: [ ]";
+ }
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ */
+ protected void putElement(final XMLStreamReader in, final QName elementName)
+ throws XMLStreamException
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -2,10 +2,7 @@
import java.net.URI;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
import org.jboss.soa.esb.message.Fault;
-import org.w3c.dom.Element;
/*
* JBoss, Home of Professional Open Source
@@ -88,16 +85,7 @@
else
return "fault: [ "+((code != null) ? code : "null")+", "+((reason != null) ? reason : "null")+", "+((cause != null) ? cause : "null")+" ]";
}
-
- public Element toXML(Element envelope) throws MarshalException
- {
- return envelope;
- }
- public void fromXML (Element envelope) throws UnmarshalException
- {
- }
-
FaultImpl (BodyImpl body)
{
_body = body;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,29 +21,39 @@
* @author mark.little at jboss.com
*/
-import org.jboss.internal.soa.esb.addressing.helpers.CallHelper;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.jboss.internal.soa.esb.util.stax.ElementContent;
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.message.Header;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
* The message header. Contains such things as routing information.
*/
-public class HeaderImpl implements Header
+public class HeaderImpl extends ElementContent implements Header
{
- public static final String HEADER_TAG = "Header";
-
public HeaderImpl ()
{
_call = new Call();
}
+ /**
+ * Construct a header from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public HeaderImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ final CallImpl callImpl = new CallImpl(in) ;
+ _call = callImpl.getCall() ;
+ }
+
// TODO add other setters/getters for artibitrary attributes
public Call getCall ()
@@ -67,44 +77,27 @@
return "header: [ ]";
}
- public Element toXML (Element envelope) throws MarshalException
+ /**
+ * Write the child content of the element.
+ * @param out The output stream.
+ * @throws XMLStreamException For errors during output.
+ */
+ @Override
+ protected void writeChildContent(XMLStreamWriter out)
+ throws XMLStreamException
{
- Document doc = envelope.getOwnerDocument();
-
- // TODO remove MAGIC strings!!
-
- Element headerElement = doc.createElement(HEADER_TAG);
-
- envelope.appendChild(headerElement);
-
- if (_call != null)
- return CallHelper.toXML(_call, doc, headerElement);
- else
- return headerElement;
+ if (_call != null)
+ {
+ final CallImpl callImpl = new CallImpl(_call) ;
+ callImpl.writeContent(out) ;
+ }
}
- public void fromXML (Element envelope) throws UnmarshalException
+ @Override
+ protected void putElement(XMLStreamReader in, QName elementName)
+ throws XMLStreamException
{
- _call = new Call();
-
- NodeList nl = envelope.getChildNodes();
- Element headerElement = null;
-
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node n = nl.item(i);
-
- if (n.getNodeName().equals(HEADER_TAG))
- {
- headerElement = (Element) n;
- break;
- }
- }
-
- // TODO error handling!!
-
- if (headerElement != null)
- _call = CallHelper.fromXML(headerElement);
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
}
private Call _call;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -22,9 +22,13 @@
import java.net.URI;
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.jboss.internal.soa.esb.util.stax.ElementContent;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
import org.jboss.soa.esb.message.Attachment;
import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Context;
@@ -35,10 +39,6 @@
import org.jboss.soa.esb.message.body.content.Payload;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
* This is the basic internal core message abstraction. A message consists of
@@ -62,12 +62,8 @@
*
*/
-public class MessageImpl implements Message
+public class MessageImpl extends ElementContent implements Message
{
- private static final long serialVersionUID = 0x0;
-
- public static final String ENVELOPE_TAG = "Envelope";
-
public MessageImpl()
{
_theHeader = new HeaderImpl();
@@ -77,7 +73,31 @@
_theAttachment = new AttachmentImpl();
_theProperties = new PropertiesImpl();
}
+
+ /**
+ * Construct a message from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public MessageImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ this() ;
+ parse(in) ;
+
+ // Replace the body
+ final String payloadType = Payload.bodyType(this);
+ if ((payloadType != null)
+ && (!payloadType.equals(Payload.RAW_BODY)))
+ {
+ _theBody = (BodyImpl) MessageFactory.getInstance()
+ .createBodyType(this, payloadType);
+ }
+ _theFault = new FaultImpl(_theBody) ;
+ }
+
/**
* @return get the header component of the message.
*/
@@ -153,98 +173,55 @@
// to/from XML here, rather than on individual elements
- public Document toXML(Document doc) throws MarshalException
+ /**
+ * Write the child content of the element.
+ * @param out The output stream.
+ * @throws XMLStreamException For errors during output.
+ */
+ public void writeChildContent(final XMLStreamWriter out)
+ throws XMLStreamException
{
- try
- {
- // TODO remove magic strings!
-
- Element envelope = doc.createElement(ENVELOPE_TAG);
-
- doc.appendChild(envelope);
-
- _theHeader.toXML(envelope);
- _theContext.toXML(envelope);
- _theBody.toXML(envelope);
- _theFault.toXML(envelope);
- _theAttachment.toXML(envelope);
- _theProperties.toXML(envelope);
-
- return doc;
- }
- catch (MarshalException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- LOGGER.warn("MessageImpl.toXML caught unexpected exception:", ex);
-
- throw new MarshalException(ex);
- }
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_HEADER, _theHeader) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_CONTEXT, _theContext) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_BODY, _theBody) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_ATTACHMENT, _theAttachment) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_PROPERTIES, _theProperties) ;
}
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ */
+ protected void putElement(final XMLStreamReader in, final QName elementName)
+ throws XMLStreamException
+ {
+ if (XMLUtil.ESB_QNAME_HEADER.equals(elementName))
+ {
+ _theHeader = new HeaderImpl(in) ;
+ }
+ else if (XMLUtil.ESB_QNAME_CONTEXT.equals(elementName))
+ {
+ _theContext = new ContextImpl(in) ;
+ }
+ else if (XMLUtil.ESB_QNAME_BODY.equals(elementName))
+ {
+ _theBody = new BodyImpl(in) ;
+ }
+ else if (XMLUtil.ESB_QNAME_ATTACHMENT.equals(elementName))
+ {
+ _theAttachment = new AttachmentImpl(in) ;
+ }
+ else if (XMLUtil.ESB_QNAME_PROPERTIES.equals(elementName))
+ {
+ _theProperties = new PropertiesImpl(in) ;
+ }
+ else
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
+ }
- public void fromXML(Document doc) throws UnmarshalException
- {
- try
- {
- NodeList nl = doc.getChildNodes();
- Element envelope = null;
-
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node n = nl.item(i);
-
- if (n.getNodeName().equals(ENVELOPE_TAG))
- {
- envelope = (Element) n;
- break;
- }
- }
-
- _theHeader.fromXML(envelope);
- _theContext.fromXML(envelope);
- _theBody.fromXML(envelope);
- _theFault.fromXML(envelope);
- _theAttachment.fromXML(envelope);
- _theProperties.fromXML(envelope);
-
- /*
- * Disclaimer: You are not expected to understand this (tm). Best
- * way of achieving this without changing any of the public
- * interfaces that may already exist.
- *
- * TODO: change public interfaces in subsequent major revision.
- */
-
- String payloadType = Payload.bodyType(this);
-
- if ((payloadType != null)
- && (!payloadType.equals(Payload.RAW_BODY)))
- {
- try
- {
- _theBody = (BodyImpl) MessageFactory.getInstance()
- .createBodyType(this, payloadType);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
- }
- catch (UnmarshalException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- LOGGER.warn("MessageImpl.fromXML caught unexpected exception:", ex);
-
- throw new UnmarshalException(ex);
- }
- }
-
// should be a capability on the base interface, but no changes for 4.2
// ...
@@ -267,9 +244,4 @@
private AttachmentImpl _theAttachment;
private PropertiesImpl _theProperties;
-
- /**
- * The logger for this class.
- */
- private static final Logger LOGGER = Logger.getLogger(MessageImpl.class);
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -20,35 +20,46 @@
*/
package org.jboss.internal.soa.esb.message.format.xml;
-import java.io.IOException;
import java.io.Serializable;
import java.util.Hashtable;
-import java.util.Map;
+import java.util.Map.Entry;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.internal.soa.esb.util.Encoding;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.internal.soa.esb.util.stax.ElementContent;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+import org.jboss.internal.soa.esb.util.stax.TextElement;
import org.jboss.soa.esb.message.Properties;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-public class PropertiesImpl implements Properties
+public class PropertiesImpl extends ElementContent implements Properties
{
- public static final String PROPERTIES_TAG = "Properties";
+ /**
+ * The default constructor
+ */
+ public PropertiesImpl()
+ {
+ }
+
+ /**
+ * Construct a set of properties from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public PropertiesImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
- public static final String PROPERTY_TAG = "Property";
-
- public static final String KEY_TAG = "Key";
-
- public static final String VALUE_TAG = "Value";
-
public Object getProperty(String name)
{
- return _table.get(name);
+ return unwrap(_table.get(name));
}
public Object getProperty(String name, Object defaultVal)
@@ -66,12 +77,12 @@
throw new IllegalArgumentException("Value of property '" + name + "' must implement " + Serializable.class.getName() + ". Value is of type " + value.getClass().getName());
}
- return _table.put(name, (Serializable) value);
+ return unwrap(_table.put(name, new SerializedValueImpl((Serializable)value)));
}
public Object remove(String name)
{
- return _table.remove(name);
+ return unwrap(_table.remove(name));
}
public int size()
@@ -81,164 +92,74 @@
public String[] getNames()
{
- return _table.keySet().toArray(new String[_table.size()]);
+ return _table.keySet().toArray(new String[0]);
}
- /**
- * toXML(elem) - Will build a child element with appropriate values and
- * append it to arg0
- *
- * @param elem
- * Element - where to add 'this' as a child node
- * @return Element - 'this' as the added Element, or <null> if no
- * properties in table and nothing was appended to arg0
- */
- public Element toXML(Element elem) throws MarshalException
+ /**
+ * Write the child content of the element.
+ * @param out The output stream.
+ * @throws XMLStreamException For errors during output.
+ */
+ @Override
+ protected void writeChildContent(XMLStreamWriter out)
+ throws XMLStreamException
{
- if (_table.size() < 1)
- return null;
-
- Document doc = elem.getOwnerDocument();
- Element thisElement = doc.createElement(PROPERTIES_TAG);
-
- boolean bAdd = false;
- for (Map.Entry<String, Serializable> oCurr : _table.entrySet())
- {
- Element oProp = doc.createElement(PROPERTY_TAG);
- Element keyElement = doc.createElement(KEY_TAG);
- Element valueElement = doc.createElement(VALUE_TAG);
-
- keyElement.appendChild(doc.createCDATASection(Encoding.encodeBytes(oCurr.getKey().getBytes())));
- oProp.appendChild(keyElement);
-
- try
- {
- valueElement.appendChild(doc.createCDATASection(Encoding.encodeObject(oCurr.getValue())));
- }
- catch (IOException ex)
- {
- throw new MarshalException(ex);
- }
-
- oProp.appendChild(valueElement);
-
- thisElement.appendChild(oProp);
- bAdd = true;
- }
- if (bAdd)
- {
- elem.appendChild(thisElement);
- return thisElement;
- }
- else
- return null;
+ for (Entry<String, SerializedValueImpl> entry: _table.entrySet())
+ {
+ final String origPropertyURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_PROPERTY) ;
+
+ final TextElement keyElement = new TextElement(Encoding.encodeBytes(entry.getKey().getBytes())) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_PROPERTY_KEY, keyElement) ;
+
+ final String value = entry.getValue().getSerialisedForm() ;
+ final TextElement valueElement = new TextElement(value) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_PROPERTY_VALUE, valueElement) ;
+
+ StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_PROPERTY.getPrefix(), origPropertyURI) ;
+ }
}
-
- /**
- * fromXml(elem) - Populate properties found in appropriate child element
- *
- * @see XMLUtil.PROPERTIES_TAG
- * @param elem -
- * Element where to look for child nodes
- */
- public void fromXML(Element elem) throws UnmarshalException
- {
- _table.clear();
-
- /*
- * There should be only one!
- */
-
- NodeList NL = elem.getElementsByTagName(PROPERTIES_TAG);
-
- if (NL.getLength() > 1)
- throw new UnmarshalException("More "+PROPERTIES_TAG+" than we expected!");
-
- if (NL.getLength() == 1)
- NL = NL.item(0).getChildNodes();
-
- for (int i1 = 0; i1 < NL.getLength(); i1++)
- {
- Node oCurr = NL.item(i1);
-
- if (!(oCurr instanceof Element))
- continue;
-
- if (oCurr.getNodeName().equals(PROPERTY_TAG))
- {
- NodeList props = oCurr.getChildNodes();
- String key = null;
- Object value = null;
-
- for (int i2 = 0; i2 < props.getLength(); i2++)
- {
- Node oProp = props.item(i2);
-
- if (oProp instanceof Element)
- {
- if (oProp.getNodeName().equals(VALUE_TAG))
- {
- CDATASection cdata = (CDATASection) oProp.getFirstChild();
-
- try
- {
- value = Encoding.decodeToObject(cdata.getWholeText());
- }
- catch (ClassNotFoundException ex)
- {
- throw new UnmarshalException(ex);
- }
- catch (IOException ex)
- {
- throw new UnmarshalException(ex);
- }
- }
- else
- {
- if (oProp.getNodeName().equals(KEY_TAG))
- {
- CDATASection cdata = (CDATASection) oProp.getFirstChild();
- key = new String(Encoding.decodeToBytes(cdata.getWholeText()));
- }
- }
- }
- }
-
- if ((key != null) && (value != null))
- _table.put(key, (Serializable) value);
- else
- throw new UnmarshalException("Could not get tuple for "+oCurr.getNodeName());
- }
- }
- }
-
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ @Override
+ protected void putElement(final XMLStreamReader in,
+ final QName elementName)
+ throws XMLStreamException
+ {
+ if (XMLUtil.ESB_QNAME_PROPERTY.equals(elementName))
+ {
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_PROPERTY_KEY) ;
+ final TextElement keyElement = new TextElement(in) ;
+ final String key = new String(Encoding.decodeToBytes(keyElement.getText())) ;
+
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_PROPERTY_VALUE) ;
+ final TextElement valueElement = new TextElement(in) ;
+ final SerializedValueImpl value = new SerializedValueImpl(valueElement.getText()) ;
+
+ StreamHelper.checkParentFinished(in) ;
+
+ _table.put(key, value) ;
+ }
+ else
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
+ }
+
public String toString()
{
return "properties: [ "+_table.toString()+" ]";
}
- @Override
- public boolean equals(Object arg)
+ private Object unwrap(final SerializedValueImpl value)
{
- if (!(arg instanceof Properties))
- return false;
- Properties other = (Properties) arg;
- if (other.size() != _table.size())
- return false;
- for (Map.Entry<String, Serializable> oCurr : _table.entrySet())
- {
- Object val = other.getProperty(oCurr.getKey());
- if (null == oCurr.getValue())
- if (null == val)
- continue;
- else
- return false;
- if (!oCurr.getValue().equals(val))
- return false;
- }
- return true;
+ return (value == null ? null : value.getValue()) ;
}
+
+ private Hashtable<String, SerializedValueImpl> _table = new Hashtable<String, SerializedValueImpl>();
- Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
-
}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,125 @@
+/*
+ * 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,
+ */
+
+package org.jboss.internal.soa.esb.message.format.xml;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.jboss.internal.soa.esb.message.format.DeferredDeserialisationException;
+import org.jboss.internal.soa.esb.util.Encoding;
+
+/**
+ * Wrapper class for serialised values, supporting JIT deserialisation.
+ *
+ * @author <a href='kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+
+public class SerializedValueImpl
+{
+ /**
+ * The value.
+ */
+ private Serializable value ;
+
+ /**
+ * The serialised form.
+ */
+ private String serialisedForm ;
+
+ /**
+ * Construct the serialised value wrapper for the specific value.
+ * @param value The serializable value.
+ */
+ public SerializedValueImpl(final Serializable value)
+ {
+ this.value = value ;
+ }
+
+ /**
+ * Construct the serialised value wrapper for the specific serialised form.
+ * @param serialisedForm The serialised form.
+ */
+ public SerializedValueImpl(final String serialisedForm)
+ {
+ this.serialisedForm = serialisedForm ;
+ }
+
+ /**
+ * Get the wrapped value.
+ * @return The wrapped value.
+ */
+ public Serializable getValue()
+ {
+ if ((value == null) && (serialisedForm != null))
+ {
+ try
+ {
+ value = Encoding.decodeToObject(serialisedForm) ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new DeferredDeserialisationException("Error reading object input stream", ioe) ;
+ }
+ catch (final ClassNotFoundException cnfe)
+ {
+ throw new DeferredDeserialisationException("Error constructing object value", cnfe) ;
+ }
+ }
+ serialisedForm = null ;
+ return value ;
+ }
+
+ /**
+ * Get the serialised form.
+ * @return The serialised form.
+ */
+ public String getSerialisedForm()
+ {
+ if ((serialisedForm == null) && (value != null))
+ {
+ try
+ {
+ serialisedForm = Encoding.encodeObject(value) ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new DeferredDeserialisationException("Error writing object input stream", ioe) ;
+ }
+ }
+ return serialisedForm ;
+ }
+
+ /**
+ * Return a string representation of this object.
+ * @return the string representation of the value or a deferred identifier.
+ */
+ public String toString()
+ {
+ if (value != null)
+ {
+ return value.toString() ;
+ }
+ else
+ {
+ return "Deferred serialized value: " + Integer.toHexString(System.identityHashCode(this)) ;
+ }
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -27,8 +27,157 @@
package org.jboss.internal.soa.esb.message.format.xml;
+import javax.xml.namespace.QName;
+
public class XMLUtil
{
public static final String ESB_PREFIX = "jbesb";
public static final String ESB_NAMESPACE_URI = "http://www.jboss.org/ws/2006/09/esb";
+
+ // Element names
+ /**
+ * The name of the envelope element.
+ */
+ public static final String ESB_ELEMENT_ENVELOPE = "Envelope";
+ /**
+ * The qualified name of the envelope element.
+ */
+ public static final QName ESB_QNAME_ENVELOPE = new QName(ESB_ELEMENT_ENVELOPE) ;
+ /**
+ * The name of the header element.
+ */
+ public static final String ESB_ELEMENT_HEADER = "Header" ;
+ /**
+ * The qualified name of the header element.
+ */
+ public static final QName ESB_QNAME_HEADER = new QName(ESB_ELEMENT_HEADER) ;
+ /**
+ * The name of the context element.
+ */
+ public static final String ESB_ELEMENT_CONTEXT = "Context" ;
+ /**
+ * The qualified name of the context element.
+ */
+ public static final QName ESB_QNAME_CONTEXT = new QName(ESB_ELEMENT_CONTEXT) ;
+ /**
+ * The name of the body element.
+ */
+ public static final String ESB_ELEMENT_BODY = "Body" ;
+ /**
+ * The qualified name of the body element.
+ */
+ public static final QName ESB_QNAME_BODY = new QName(ESB_ELEMENT_BODY) ;
+ /**
+ * The name of the body bytes content element.
+ */
+ public static final String ESB_ELEMENT_BODY_BYTES_CONTENT = "Bytes" ;
+ /**
+ * The qualified name of the body bytes content element.
+ */
+ public static final QName ESB_QNAME_BODY_BYTES_CONTENT = new QName(ESB_ELEMENT_BODY_BYTES_CONTENT) ;
+ /**
+ * The name of the body content element.
+ */
+ public static final String ESB_ELEMENT_BODY_CONTENT = "Content" ;
+ /**
+ * The qualified name of the body content element.
+ */
+ public static final QName ESB_QNAME_BODY_CONTENT = new QName(ESB_ELEMENT_BODY_CONTENT) ;
+ /**
+ * The name of the body content key element.
+ */
+ public static final String ESB_ELEMENT_BODY_CONTENT_KEY = "Key" ;
+ /**
+ * The qualified name of the body content key element.
+ */
+ public static final QName ESB_QNAME_BODY_CONTENT_KEY = new QName(ESB_ELEMENT_BODY_CONTENT_KEY) ;
+ /**
+ * The name of the body content value element.
+ */
+ public static final String ESB_ELEMENT_BODY_CONTENT_VALUE = "Value" ;
+ /**
+ * The qualified name of the body content value element.
+ */
+ public static final QName ESB_QNAME_BODY_CONTENT_VALUE = new QName(ESB_ELEMENT_BODY_CONTENT_VALUE) ;
+ /**
+ * The name of the marshal element.
+ */
+ public static final String ESB_ELEMENT_BODY_CONTENT_MARSHAL = "marshalunmarshal" ;
+ /**
+ * The qualified name of the marshal element.
+ */
+ public static final QName ESB_QNAME_BODY_CONTENT_MARSHAL = new QName(ESB_ELEMENT_BODY_CONTENT_MARSHAL) ;
+ /**
+ * The name of the marshal type element.
+ */
+ public static final String ESB_ELEMENT_BODY_CONTENT_MARSHAL_TYPE = "plugin-type" ;
+ /**
+ * The qualified name of the marshal type element.
+ */
+ public static final QName ESB_QNAME_BODY_CONTENT_MARSHAL_TYPE = new QName(ESB_ELEMENT_BODY_CONTENT_MARSHAL_TYPE) ;
+ /**
+ * The name of the attachment element.
+ */
+ public static final String ESB_ELEMENT_ATTACHMENT = "Attachment" ;
+ /**
+ * The qualified name of the attachment element.
+ */
+ public static final QName ESB_QNAME_ATTACHMENT = new QName(ESB_ELEMENT_ATTACHMENT) ;
+ /**
+ * The name of the unnamed attachment element.
+ */
+ public static final String ESB_ELEMENT_ATTACHMENT_UNNAMED = "UnNamed" ;
+ /**
+ * The qualified name of the unnamed attachment element.
+ */
+ public static final QName ESB_QNAME_ATTACHMENT_UNNAMED = new QName(ESB_ELEMENT_ATTACHMENT_UNNAMED) ;
+ /**
+ * The name of the named attachment element.
+ */
+ public static final String ESB_ELEMENT_ATTACHMENT_NAMED = "Named" ;
+ /**
+ * The qualified name of the named attachment element.
+ */
+ public static final QName ESB_QNAME_ATTACHMENT_NAMED = new QName(ESB_ELEMENT_ATTACHMENT_NAMED) ;
+ /**
+ * The name of the properties element.
+ */
+ public static final String ESB_ELEMENT_PROPERTIES = "Properties" ;
+ /**
+ * The qualified name of the properties element.
+ */
+ public static final QName ESB_QNAME_PROPERTIES = new QName(ESB_ELEMENT_PROPERTIES) ;
+ /**
+ * The name of the property element.
+ */
+ public static final String ESB_ELEMENT_PROPERTY = "Property" ;
+ /**
+ * The qualified name of the property element.
+ */
+ public static final QName ESB_QNAME_PROPERTY = new QName(ESB_ELEMENT_PROPERTY) ;
+ /**
+ * The name of the property key element.
+ */
+ public static final String ESB_ELEMENT_PROPERTY_KEY = "Key" ;
+ /**
+ * The qualified name of the property key element.
+ */
+ public static final QName ESB_QNAME_PROPERTY_KEY = new QName(ESB_ELEMENT_PROPERTY_KEY) ;
+ /**
+ * The name of the property value element.
+ */
+ public static final String ESB_ELEMENT_PROPERTY_VALUE = "Value" ;
+ /**
+ * The qualified name of the property value element.
+ */
+ public static final QName ESB_QNAME_PROPERTY_VALUE = new QName(ESB_ELEMENT_PROPERTY_VALUE) ;
+
+ /**
+ * The name attribute of the named attachment element.
+ */
+ public static final String ESB_ATTRIBUTE_ATTACHMENT_NAMED_NAME = "name" ;
+ /**
+ * The qualified name of the property value element.
+ */
+ public static final QName ESB_QNAME_ATTRIBUTE_ATTACHMENT_NAMED_NAME = new QName(ESB_ATTRIBUTE_ATTACHMENT_NAMED_NAME) ;
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/MapBodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/MapBodyImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/MapBodyImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -38,8 +38,6 @@
public class MapBodyImpl extends BodyImpl implements MapBody
{
- private static final long serialVersionUID = 0xdeadbeef;
-
public MapBodyImpl (BodyImpl b)
{
super(b);
@@ -49,9 +47,7 @@
public void setMap (Map<String, Serializable> payload)
{
- super._objects = new Hashtable<String, Object>();
-
- super._objects.putAll(payload);
+ initialiseMap(payload) ;
}
public boolean getBoolean (String name) throws InvalidPayloadException
@@ -164,7 +160,7 @@
public Enumeration<String> getMapNames ()
{
- return super._objects.keys();
+ return getEnumeratedNames();
}
public boolean itemExists (String name)
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/ObjectBodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/ObjectBodyImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/ObjectBodyImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -34,8 +34,6 @@
public class ObjectBodyImpl extends BodyImpl implements ObjectBody
{
- private static final long serialVersionUID = 0xdeadbeef;
-
public static final String ELEMENT_NAME = "org.jboss.soa.esb.message.body.object.content";
public ObjectBodyImpl (BodyImpl body)
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/TextBodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/TextBodyImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/TextBodyImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -34,8 +34,6 @@
{
public static final String ELEMENT_NAME = "org.jboss.soa.esb.message.payload.text";
- private static final long serialVersionUID = 0xdeadbeef;
-
public TextBodyImpl (BodyImpl b)
{
super(b);
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -4,12 +4,20 @@
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Properties;
+import java.util.Map.Entry;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.jboss.internal.soa.esb.message.format.xml.XMLUtil;
+import org.jboss.internal.soa.esb.util.stax.ElementContent;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+import org.jboss.internal.soa.esb.util.stax.URIElement;
import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
import org.jboss.soa.esb.common.ModulePropertyManager;
import org.jboss.soa.esb.util.ClassUtil;
-import org.w3c.dom.Element;
/*
* JBoss, Home of Professional Open Source
@@ -105,24 +113,49 @@
/**
* Pack the provided object into the document.
*
- * @param doc the XML document.
+ * @param out the XML stream writer.
* @param param the object to pack.
*
* @return <code>true</code> if the object was packed, <code>false</code> otherwise.
* @throws MarshalException thrown if there is a problem packing.
*/
- public boolean marshal (Element doc, Object param) throws MarshalException
+ public boolean marshal (XMLStreamWriter out, MarshalValueImpl param) throws XMLStreamException
{
- if ((doc == null) || (param == null))
+ if ((out == null) || (param == null))
throw new IllegalArgumentException();
- Enumeration<URI> keys = _plugins.keys();
+ final String serialisedForm = param.getMarshalledForm() ;
+ if (serialisedForm != null)
+ {
+ final MarshalImpl marshal = new MarshalImpl(param.getMarshalledType(), serialisedForm) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT_MARSHAL, marshal) ;
+ return true ;
+ }
- while (keys.hasMoreElements())
+ final Object obj = param.getValue() ;
+ for(Entry<URI, MarshalUnmarshalPlugin> entry: _plugins.entrySet())
{
- if (_plugins.get(keys.nextElement()).marshal(doc, param))
- return true;
+ final MarshalUnmarshalPlugin plugin = entry.getValue() ;
+ if (plugin.canPack(obj))
+ {
+ final String value ;
+ try
+ {
+ value = plugin.marshal(obj) ;
+ }
+ catch (final MarshalException me)
+ {
+ throw new XMLStreamException(me) ;
+ }
+ param.setMarshalledForm(value) ;
+ param.setMarshalledType(plugin.type()) ;
+
+ final MarshalImpl marshal = new MarshalImpl(entry.getKey(), value) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT_MARSHAL, marshal) ;
+
+ return true ;
+ }
}
return false;
@@ -131,31 +164,91 @@
/**
* Unpack the object from the document.
*
- * @param doc the document.
+ * @param in the XML Stream reader.
*
* @return the object, or <code>null</code> if this implementation cannot deal with the
* format.
- * @throws UnmarshalException thrown if there is a problem unpacking.
+ * @throws XMLStreamException thrown if there is a problem unpacking.
*/
- public Object unmarshal (Element doc) throws UnmarshalException
+ public MarshalValueImpl unmarshal (XMLStreamReader in) throws XMLStreamException
{
- if (doc == null)
- throw new IllegalArgumentException();
-
- Enumeration<URI> keys = _plugins.keys();
-
- while (keys.hasMoreElements())
- {
- Object result = _plugins.get(keys.nextElement()).unmarshal(doc);
-
- if (result != null)
- return result;
- }
-
- return null;
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_BODY_CONTENT_MARSHAL) ;
+ final MarshalImpl marshal = new MarshalImpl(in) ;
+ StreamHelper.checkEndTag(in, XMLUtil.ESB_QNAME_BODY_CONTENT_MARSHAL) ;
+
+ final MarshalUnmarshalPlugin plugin = _plugins.get(marshal.getType()) ;
+ if (plugin == null)
+ {
+ throw new XMLStreamException("Unrecognised marshal type: " + marshal.getType()) ;
+ }
+
+ return new MarshalValueImpl(marshal.getType(), marshal.getContent()) ;
}
+ MarshalUnmarshalPlugin getPlugin(final URI type)
+ {
+ return _plugins.get(type) ;
+ }
+
+ private static class MarshalImpl extends ElementContent
+ {
+ private URI type ;
+ private String content ;
+
+ MarshalImpl(final URI type, final String content)
+ {
+ this.type = type ;
+ this.content = content ;
+ }
+
+ MarshalImpl(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ super.parse(in) ;
+ }
+
+ URI getType()
+ {
+ return type ;
+ }
+
+ String getContent()
+ {
+ return content ;
+ }
+
+ @Override
+ protected void putElement(XMLStreamReader in, QName elementName)
+ throws XMLStreamException
+ {
+ if (XMLUtil.ESB_QNAME_BODY_CONTENT_MARSHAL_TYPE.equals(elementName))
+ {
+ final URIElement typeURI = new URIElement(in) ;
+ type = typeURI.getValue() ;
+ }
+ else
+ {
+ throw new XMLStreamException("Unrecognised element: " + elementName) ;
+ }
+ }
+
+ @Override
+ protected void putValue(XMLStreamReader in, String value)
+ throws XMLStreamException
+ {
+ content = value ;
+ }
+
+ @Override
+ protected void writeChildContent(XMLStreamWriter out)
+ throws XMLStreamException
+ {
+ final URIElement typeURI = new URIElement(type) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT_MARSHAL_TYPE, typeURI) ;
+ out.writeCharacters(content) ;
+ }
+ }
private Hashtable<URI,MarshalUnmarshalPlugin> _plugins = new Hashtable<URI,MarshalUnmarshalPlugin>();
private static final MarshalUnmarshalManager _instance = new MarshalUnmarshalManager();
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -4,7 +4,6 @@
import org.jboss.soa.esb.MarshalException;
import org.jboss.soa.esb.UnmarshalException;
-import org.w3c.dom.Element;
/*
* JBoss, Home of Professional Open Source
@@ -41,32 +40,35 @@
{
public static final String MARSHAL_UNMARSHAL_PLUGIN = "org.jboss.soa.esb.message.format.xml.plugin";
- public static final String tagName = "marshalunmarshal";
- public static final String pluginType = "plugin-type";
-
+ /**
+ * Can the plugin pack the specified object?
+ * @param value The object to pack.
+ * @return true if the object can be packed, false otherwise.
+ */
+ public boolean canPack(final Object value) ;
+
/**
* Pack the provided object into the document.
*
- * @param doc the XML document.
* @param param the object to pack.
+ * @return the packed version of the object.
*
- * @return <code>true</code> if the object was packed, <code>false</code> otherwise.
* @throws MarshalException thrown if there is a problem packing.
*/
- public boolean marshal (Element doc, Object param) throws MarshalException;
+ public String marshal (Object param) throws MarshalException ;
/**
* Unpack the object from the document.
*
- * @param doc the document.
+ * @param content the object content.
*
* @return the object, or <code>null</code> if this implementation cannot deal with the
* format.
* @throws UnmarshalException thrown if there is a problem unpacking.
*/
- public Object unmarshal (Element doc) throws UnmarshalException;
+ public Object unmarshal (final String content) throws UnmarshalException;
/**
* @return the unique name for this plugin.
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,147 @@
+/*
+ * 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,
+ */
+
+package org.jboss.internal.soa.esb.message.format.xml.marshal;
+
+import java.net.URI;
+
+import org.jboss.internal.soa.esb.message.format.DeferredDeserialisationException;
+import org.jboss.soa.esb.UnmarshalException;
+
+/**
+ * Wrapper class for marshalled values, supporting JIT deserialisation.
+ *
+ * @author <a href='kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+
+public class MarshalValueImpl
+{
+ /**
+ * The value.
+ */
+ private Object value ;
+
+ /**
+ * The marshalled form.
+ */
+ private String marshalledForm ;
+ /**
+ * The plugin type.
+ */
+ private URI type ;
+
+ /**
+ * Construct the marshalled value wrapper for the specific value.
+ * @param value The serializable value.
+ */
+ public MarshalValueImpl(final Object value)
+ {
+ this.value = value ;
+ }
+
+ /**
+ * Construct the marshalled value wrapper for the specific marshalled form.
+ * @param type The plugin type.
+ * @param marshalledForm The marshalled form.
+ */
+ public MarshalValueImpl(final URI type, final String marshalledForm)
+ {
+ this.type = type ;
+ this.marshalledForm = marshalledForm ;
+ }
+
+ /**
+ * Get the wrapped value.
+ * @return The wrapped value.
+ */
+ public Object getValue()
+ {
+ if ((value == null) && (marshalledForm != null))
+ {
+ final MarshalUnmarshalPlugin plugin = MarshalUnmarshalManager.getInstance().getPlugin(type) ;
+ if (plugin == null)
+ {
+ throw new DeferredDeserialisationException("Could not locate plugin for type: " + type) ;
+ }
+ try
+ {
+ value = plugin.unmarshal(marshalledForm) ;
+ }
+ catch (final UnmarshalException ue)
+ {
+ throw new DeferredDeserialisationException("Error constructing object value", ue) ;
+ }
+ }
+ marshalledForm = null ;
+ return value ;
+ }
+
+ /**
+ * Get the marshalled type.
+ * @return The marshalled type.
+ */
+ URI getMarshalledType()
+ {
+ return type ;
+ }
+
+ /**
+ * Set the marshalled type.
+ * @param type The marshalled type.
+ */
+ void setMarshalledType(final URI type)
+ {
+ this.type = type ;
+ }
+
+ /**
+ * Get the marshalled form.
+ * @return The marshalled form.
+ */
+ String getMarshalledForm()
+ {
+ return marshalledForm ;
+ }
+
+ /**
+ * Set the marshalled form.
+ * @return The marshalled form.
+ */
+ void setMarshalledForm(final String marshalledForm)
+ {
+ this.marshalledForm = marshalledForm ;
+ }
+
+ /**
+ * Return a string representation of this object.
+ * @return the string representation of the value or a deferred identifier.
+ */
+ public String toString()
+ {
+ if (value != null)
+ {
+ return value.toString() ;
+ }
+ else
+ {
+ return "Deferred serialized value: " + Integer.toHexString(System.identityHashCode(this)) ;
+ }
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,5 +1,6 @@
package org.jboss.internal.soa.esb.message.format.xml.marshal;
+import java.io.IOException;
import java.io.Serializable;
import java.net.URI;
import java.net.URISyntaxException;
@@ -7,10 +8,6 @@
import org.jboss.internal.soa.esb.util.Encoding;
import org.jboss.soa.esb.MarshalException;
import org.jboss.soa.esb.UnmarshalException;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/*
* JBoss, Home of Professional Open Source
@@ -46,7 +43,6 @@
public class SerializedMarshalUnmarshalPlugin implements MarshalUnmarshalPlugin
{
-
public SerializedMarshalUnmarshalPlugin()
{
try
@@ -60,105 +56,67 @@
}
/**
- * Pack the provided object into the document.
- *
- * @param doc
- * the XML document.
- * @param param
- * the object to pack.
- *
- * @return <code>true</code> if the object was packed, <code>false</code>
- * otherwise.
- * @throws MarshalException
- * thrown if there is a problem packing.
+ * Can the plugin pack the specified object?
+ * @param value The object to pack.
+ * @return true if the object can be packed, false otherwise.
*/
-
- public boolean marshal(Element doc, Object param) throws MarshalException
+ public boolean canPack(final Object value)
+ {
+ return (value instanceof Serializable) ;
+ }
+
+ /**
+ * Pack the provided object into the document.
+ *
+ * @param param the object to pack.
+ * @return the packed version of the object.
+ *
+ * @throws MarshalException thrown if there is a problem packing.
+ */
+ public String marshal (Object param)
+ throws MarshalException
{
- if (param instanceof Serializable)
- {
- // we can deal with this type!
-
- try
- {
- Element nodeElement = doc.getOwnerDocument().createElement(
- MarshalUnmarshalPlugin.tagName);
-
- Element pluginType = doc.getOwnerDocument().createElement(
- MarshalUnmarshalPlugin.pluginType);
- pluginType.appendChild(doc.getOwnerDocument().createTextNode(
- type().toString()));
- nodeElement.appendChild(pluginType);
-
- nodeElement.appendChild(doc.getOwnerDocument()
- .createCDATASection(
- Encoding.encodeObject((Serializable) param)));
-
- doc.appendChild(nodeElement);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
-
- throw new MarshalException(ex);
- }
-
- return true;
- }
- else
- return false;
+ if (param instanceof Serializable)
+ {
+ try
+ {
+ return Encoding.encodeObject((Serializable)param) ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new MarshalException("Failed to encode value", ioe) ;
+ }
+ }
+ else
+ {
+ throw new MarshalException("Invalid value type for marshaling plugin:" + param.getClass().getName()) ;
+ }
}
- /**
- * Unpack the object from the document.
- *
- * @param doc
- * the document.
- *
- * @return the object, or <code>null</code> if this implementation cannot
- * deal with the format.
- * @throws UnmarshalException
- * thrown if there is a problem unpacking.
- */
-
- public Object unmarshal(Element doc) throws UnmarshalException
+ /**
+ * Unpack the object from the document.
+ *
+ * @param content the object content.
+ *
+ * @return the object, or <code>null</code> if this implementation cannot deal with the
+ * format.
+ * @throws UnmarshalException thrown if there is a problem unpacking.
+ */
+ public Object unmarshal (final String content)
+ throws UnmarshalException
{
- try
- {
- NodeList nl = doc.getChildNodes();
-
- for (int i = 0; i < nl.getLength(); i++)
- {
- if (nl.item(i).getNodeName().equals(MarshalUnmarshalPlugin.tagName))
- {
- NodeList childList = nl.item(i).getChildNodes();
-
- for (int j = 0; j < childList.getLength(); j++)
- {
- Node el = childList.item(j);
-
- if (el.getNodeName().equals(
- MarshalUnmarshalPlugin.pluginType))
- {
- if (el.getTextContent().equals(type().toString()))
- {
- CDATASection cdata = (CDATASection) childList
- .item(j + 1);
-
- return Encoding.decodeToObject(cdata
- .getWholeText());
- }
- }
- }
- }
- }
-
- return null;
- }
- catch (Exception ex)
- {
- throw new UnmarshalException(ex);
- }
+ try
+ {
+ return Encoding.decodeToObject(content) ;
+ }
+ catch (final ClassNotFoundException cnfe)
+ {
+ throw new UnmarshalException("Failed to decode value", cnfe) ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new UnmarshalException("Failed to decode value", ioe) ;
+ }
}
/**
@@ -171,5 +129,4 @@
}
private URI _type = null;
-
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -44,6 +44,8 @@
import org.jboss.soa.esb.addressing.eprs.JMSEpr;
import org.jboss.soa.esb.common.Environment;
import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
import org.jboss.soa.esb.helpers.NamingContextException;
import org.jboss.soa.esb.helpers.NamingContextPool;
@@ -78,8 +80,9 @@
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;
@@ -123,7 +126,7 @@
throws NamingException, JMSException, ConnectionException, NamingContextException
{
String destinationType = poolKey.get(JMSEpr.DESTINATION_TYPE_TAG);
-
+
//Setup a connection if we don't have one
if (jmsConnection==null) {
JmsConnectionPoolContainer.addToPool(poolKey, this);
@@ -133,8 +136,10 @@
try {
String connectionFactoryString = poolKey.get(JMSEpr.CONNECTION_FACTORY_TAG);
Object factoryConnection=null;
- try {
- 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));
@@ -153,29 +158,24 @@
jmsConnection = useJMSSecurity ? factory.createTopicConnection(username,password): factory.createTopicConnection();
}
- jmsConnection.setExceptionListener(new ExceptionListener() {
- public void onException(JMSException arg0)
- {
- removeSessionPool() ;
- }
- }) ;
+ addExceptionListener();
+
jmsConnection.start();
} finally {
NamingContextPool.releaseNamingContext(jndiContext) ;
}
}
+ final boolean transacted = Boolean.valueOf(poolKey.get(JMSEpr.TRANSACTED_TAG));
//Create a new Session
ArrayList<Session> freeSessions = freeSessionsMap.get( acknowledgeMode );
-
+
if (JMSEpr.QUEUE_TYPE.equals(destinationType)) {
- logger.debug("Creating a new Queue session.");
- QueueSession session = ((QueueConnection)jmsConnection).createQueueSession(false,acknowledgeMode);
+ QueueSession session = ((QueueConnection)jmsConnection).createQueueSession(transacted,acknowledgeMode);
freeSessions.add(session);
} else if (JMSEpr.TOPIC_TYPE.equals(destinationType)) {
- logger.debug("Creating a new Topic session.");
- TopicSession session = ((TopicConnection) jmsConnection).createTopicSession(false,acknowledgeMode);
+ TopicSession session = ((TopicConnection) jmsConnection).createTopicSession(transacted,acknowledgeMode);
freeSessions.add(session);
} else {
throw new ConnectionException("Unknown destination type");
@@ -281,7 +281,9 @@
try
{
ArrayList<Session> sessions = freeSessionsMap.get(sessionToClose.getAcknowledgeMode());
- sessions.add(sessionToClose);
+ if ( sessions != null )
+ sessions.add(sessionToClose);
+
releaseSession(sessionToClose) ;
} catch (JMSException e)
{
@@ -298,7 +300,8 @@
try
{
ArrayList<Session> inUseSessions = inUseSessionsMap.get(sessionToClose.getAcknowledgeMode());
- inUseSessions.remove(sessionToClose);
+ if ( inUseSessions != null )
+ inUseSessions.remove(sessionToClose);
notifyAll() ;
} catch (JMSException e)
{
@@ -373,6 +376,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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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.
*
@@ -66,13 +68,17 @@
*/
public static JmsConnectionPool getPool(JMSEpr jmsEpr) throws ConnectionException, URISyntaxException
{
- return getPool(jmsEpr.getJndiEnvironment()
- , jmsEpr.getConnectionFactory(), jmsEpr.getDestinationType(), jmsEpr.getJMSSecurityPrincipal(), jmsEpr.getJMSSecurityCredential());
+ return getPool(jmsEpr.getJndiEnvironment(),
+ jmsEpr.getConnectionFactory(),
+ jmsEpr.getDestinationType(),
+ jmsEpr.getJMSSecurityPrincipal(),
+ jmsEpr.getJMSSecurityCredential(),
+ jmsEpr.getTransacted());
}
/**
* 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>
@@ -81,8 +87,16 @@
public static JmsConnectionPool getPool(Properties enviroment, String connectionFactory, String destinationType)
throws ConnectionException
{
- return getPool(enviroment, connectionFactory, destinationType, null, null);
+ return getPool(enviroment, connectionFactory, destinationType, null, null, false);
}
+ public static JmsConnectionPool getPool(Properties enviroment, String connectionFactory, String destinationType,
+ final String username, final String password)
+ throws ConnectionException
+ {
+ return getPool( enviroment, connectionFactory, destinationType, username, password, false );
+
+ }
+
/**
* Returns the pool given the identifiers for the JMS provider.
*
@@ -91,20 +105,24 @@
* @param destinationType - destinationType(Queue or Topic) for which a JMSConnectionPool should be retreived
* @param username - username that should be used to create the JMS Connection
* @param password - password that should be used to create the JMS Connection
+ * @param transacted - should the JMS Session be transacted
* @return <code>JmsConnectionPool</code>
* @throws ConnectionException
*/
public static JmsConnectionPool getPool(Properties enviroment, String connectionFactory, String destinationType,
- final String username, final String password)
+ final String username, final String password, final boolean transacted)
throws ConnectionException
{
- Map<String,String> poolKey = createPoolKey(enviroment, connectionFactory, destinationType, username, password);
+ Map<String,String> poolKey = createPoolKey(enviroment, connectionFactory, destinationType, username, password, transacted);
final Map<Map<String, String>, JmsConnectionPool> poolMap = getMap() ;
+
if (poolMap.containsKey(poolKey)) {
return poolMap.get(poolKey);
} else {
JmsConnectionPool pool = new JmsConnectionPool(poolKey);
+
poolMap.put(poolKey, pool);
+
return pool;
}
}
@@ -118,7 +136,7 @@
*/
public static Map<String, String> createPoolKey(Properties environment, String connectionFactory, String destinationType)
{
- return createPoolKey( environment, connectionFactory, destinationType, null, null );
+ return createPoolKey( environment, connectionFactory, destinationType, null, null, false );
}
/**
* Creates a poolKey using the identifying parameters
@@ -131,7 +149,7 @@
* @return
*/
public static Map<String, String> createPoolKey(Properties environment, String connectionFactory, String destinationType,
- final String username, final String password)
+ final String username, final String password, final boolean transacted)
{
Map<String,String> poolKey = new HashMap<String,String>();
if (environment!=null) {
@@ -147,6 +165,9 @@
if (connectionFactory!=null) poolKey.put(JMSEpr.CONNECTION_FACTORY_TAG, connectionFactory);
if (destinationType!=null) poolKey.put(JMSEpr.DESTINATION_TYPE_TAG, destinationType);
+
+ poolKey.put(JMSEpr.TRANSACTED_TAG, String.valueOf(transacted));
+
return poolKey;
}
/**
@@ -248,4 +269,4 @@
}
}
}
-}
+}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa)
Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPool.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/xa/XaJmsConnectionPoolContainer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ElementContent.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ElementContent.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ElementContent.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -44,6 +44,7 @@
/**
* Write the attributes of the element.
* @param out The output stream.
+ * @throws XMLStreamException For errors during output.
*/
protected void writeAttributes(final XMLStreamWriter out)
throws XMLStreamException
@@ -53,6 +54,7 @@
/**
* Write the child content of the element.
* @param out The output stream.
+ * @throws XMLStreamException For errors during output.
*/
protected void writeChildContent(final XMLStreamWriter out)
throws XMLStreamException
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,68 @@
+/*
+ * 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 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.util.stax;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Utility class to wrap an element and its name.
+ * @author kevin
+ */
+public class NamedElement
+{
+ /**
+ * The element name of the any element.
+ */
+ private final QName name ;
+ /**
+ * The any element content.
+ */
+ private final ElementContent elementContent ;
+
+ /**
+ * Construct the any element utility class.
+ * @param name The name of the element.
+ * @param elementContent The contents of the element.
+ */
+ public NamedElement(final QName name, final ElementContent elementContent)
+ {
+ this.name = name ;
+ this.elementContent = elementContent ;
+ }
+
+ /**
+ * Get the element name.
+ * @return The element name.
+ */
+ public QName getName()
+ {
+ return name ;
+ }
+
+ /**
+ * Get the element content.
+ * @return The element content.
+ */
+ public ElementContent getElementContent()
+ {
+ return elementContent ;
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ParsingSupport.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ParsingSupport.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ParsingSupport.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -43,7 +43,6 @@
/**
* Parse the contents of this element from the input stream.
* @param in The input stream.
- * @message com.arjuna.webservices.stax.ParsingSupport_1 [com.arjuna.webservices.stax.ParsingSupport_1] -
*/
protected final void parse(final XMLStreamReader in)
throws XMLStreamException
@@ -67,11 +66,10 @@
case XMLStreamConstants.START_ELEMENT:
final QName startElementName = in.getName() ;
putElement(in, startElementName) ;
- in.require(XMLStreamConstants.END_ELEMENT, startElementName.getNamespaceURI(),
- startElementName.getLocalPart()) ;
+ StreamHelper.checkEndTag(in, startElementName) ;
break ;
case XMLStreamConstants.END_ELEMENT:
- in.require(type, name.getNamespaceURI(), name.getLocalPart()) ;
+ StreamHelper.checkEndTag(in, name) ;
finished = true ;
break ;
case XMLStreamConstants.CDATA:
@@ -101,6 +99,7 @@
* Set the text value of this element.
* @param in The current input stream.
* @param value The text value of this element.
+ * @throws XMLStreamException For errors during parsing.
*/
protected void putValue(final XMLStreamReader in, final String value)
throws XMLStreamException
@@ -112,6 +111,7 @@
* @param in The current input stream.
* @param attributeName The qualified attribute name.
* @param attributeValue The qualified attribute value.
+ * @throws XMLStreamException For errors during parsing.
*/
protected void putAttribute(final XMLStreamReader in,
final QName attributeName, final String attributeValue)
@@ -123,6 +123,7 @@
* Add the element.
* @param in The current input stream.
* @param elementName The qualified element name.
+ * @throws XMLStreamException For errors during parsing.
*/
protected abstract void putElement(final XMLStreamReader in,
final QName elementName)
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/StreamHelper.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/StreamHelper.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/StreamHelper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -196,7 +196,6 @@
}
else
{
- // KEV must handle clashes with default namespace
writeAttribute(out, attributeName, QNameHelper.toQualifiedName(origPrefix, attributeValue.getLocalPart())) ;
}
}
@@ -222,7 +221,6 @@
}
else
{
- // KEV must handle clashes with default namespace
final String prefix = QNameHelper.getNormalisedValue(attributeName.getPrefix()) ;
writeNamespace(out, prefix, namespaceURI) ;
out.writeAttribute(namespaceURI, localName, attributeValue) ;
@@ -257,7 +255,6 @@
}
else
{
- // KEV must handle clashes with default namespace
out.writeCharacters(QNameHelper.toQualifiedName(origPrefix, qName.getLocalPart())) ;
}
}
@@ -340,6 +337,19 @@
}
/**
+ * Check the end tag is as expected.
+ * @param streamReader The stream reader.
+ * @param expected The expected qualified name.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public static void checkEndTag(final XMLStreamReader streamReader, final QName expected)
+ throws XMLStreamException
+ {
+ streamReader.require(XMLStreamConstants.END_ELEMENT,
+ expected.getNamespaceURI(), expected.getLocalPart()) ;
+ }
+
+ /**
* Compare the element tag with the expected qualified name.
* @param streamReader The current stream reader.
* @param expected The expected qualified name.
@@ -366,4 +376,15 @@
{
return (streamReader.nextTag() == XMLStreamConstants.END_ELEMENT) ;
}
+
+ /**
+ * Get the value of the specified attribute.
+ * @param streamReader The current XML stream reader.
+ * @param name The name of the attribute.
+ * @return The value of the attribute.
+ */
+ public static String getAttributeValue(final XMLStreamReader streamReader, final QName name)
+ {
+ return streamReader.getAttributeValue(name.getNamespaceURI(), name.getLocalPart()) ;
+ }
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/TextElement.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/TextElement.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/TextElement.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -69,6 +69,7 @@
* Set the text value of this element.
* @param in The current input stream.
* @param value The text value of this element.
+ * @throws XMLStreamException For errors during parsing.
*/
protected void putValue(final XMLStreamReader in, final String value)
throws XMLStreamException
@@ -80,6 +81,7 @@
* Add the element.
* @param in The current input stream.
* @param elementName The qualified element name.
+ * @throws XMLStreamException For errors during parsing.
*/
protected void putElement(final XMLStreamReader in,
final QName elementName)
@@ -91,10 +93,14 @@
/**
* Write the child content of the element.
* @param out The output stream.
+ * @throws XMLStreamException For errors during output.
*/
protected void writeChildContent(final XMLStreamWriter out)
throws XMLStreamException
{
- out.writeCharacters(text) ;
+ if (text != null)
+ {
+ out.writeCharacters(text) ;
+ }
}
}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,144 @@
+/*
+ * 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 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.util.stax;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+
+/*
+ * xs:anyURI
+ */
+/**
+ * Representation of a URI
+ * @author kevin
+ */
+public class URIElement extends ElementContent
+{
+ /**
+ * The URI value of this element.
+ */
+ private URI value ;
+
+ /**
+ * Default constructor.
+ */
+ public URIElement()
+ {
+ }
+
+ /**
+ * Create the URI with a specific value.
+ * @param value The URI value.
+ */
+ public URIElement(final URI value)
+ {
+ setValue(value) ;
+ }
+
+ /**
+ * Construct the attributed uri from the input stream.
+ * @param in The input stream.
+ * @throws XMLStreamException for errors during reading.
+ */
+ public URIElement(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
+ /**
+ * Set the text value of this element.
+ * @param in The current input stream.
+ * @param value The text value.
+ */
+ protected void putValue(final XMLStreamReader in, final String value)
+ throws XMLStreamException
+ {
+ final URI uriValue ;
+ try
+ {
+ uriValue = new URI(value) ;
+ }
+ catch (final URISyntaxException urise)
+ {
+ throw new XMLStreamException("Failed to parse URI: " + value, urise) ;
+ }
+ setValue(uriValue) ;
+ }
+
+ /**
+ * Set the URI value of this element.
+ * @param value The URI value of the element.
+ */
+ public void setValue(final URI value)
+ {
+ this.value = value ;
+ }
+
+ /**
+ * Get the URI value of this element.
+ * @return The URI value of the element or null if not set.
+ */
+ public URI getValue()
+ {
+ return value ;
+ }
+
+ /**
+ * Write the child content of the element.
+ * @param out The output stream.
+ */
+ protected void writeChildContent(final XMLStreamWriter out)
+ throws XMLStreamException
+ {
+ if (value != null)
+ {
+ out.writeCharacters(value.toString()) ;
+ }
+ }
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ */
+ protected void putElement(final XMLStreamReader in,
+ final QName elementName)
+ throws XMLStreamException
+ {
+ // Ignore elements.
+ }
+
+ /**
+ * Is the configuration of this element valid?
+ * @return true if valid, false otherwise.
+ */
+ public boolean isValid()
+ {
+ return (value != null) && super.isValid() ;
+ }
+}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,157 @@
+/*
+ * 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.actions;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+/**
+ * Aggregation Details.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class AggregationDetails {
+
+ private String seriesUuid;
+ private int messageNumber = -1;
+ private int seriesSize = -1;
+ private long seriesTimestamp = -1;
+ private String splitId;
+
+ public AggregationDetails(String seriesUuid, int messageNumber, int seriesSize, long seriesTimestamp) {
+ AssertArgument.isNotNullAndNotEmpty(seriesUuid, "seriesUuid");
+ if(messageNumber < 1) {
+ throw new IllegalArgumentException("Invalid AggregatorDetails. messageNumber < 1");
+ }
+ if(seriesSize < messageNumber) {
+ throw new IllegalArgumentException("Invalid AggregatorDetails. seriesSize < messageNumber");
+ }
+ if(seriesTimestamp < 1) {
+ throw new IllegalArgumentException("Invalid AggregatorDetails. timestamp < 1");
+ }
+
+ this.seriesUuid = seriesUuid;
+ this.messageNumber = messageNumber;
+ this.seriesSize = seriesSize;
+ this.seriesTimestamp = seriesTimestamp;
+ }
+
+ public AggregationDetails(String aggregatorTag) {
+ AssertArgument.isNotNullAndNotEmpty(aggregatorTag, "aggregatorTag");
+ String[] tokens = aggregatorTag.split(":");
+
+ if(tokens.length < 4) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. Must have 4 tokens (colon separated).");
+ }
+
+ this.seriesUuid = tokens[0];
+ if(this.seriesUuid == null || this.seriesUuid.trim().equals("")) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag: seriesUuid is blank.");
+ }
+ try {
+ this.messageNumber = Integer.parseInt(tokens[1]);
+ if(messageNumber < 1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. messageNumber < 1");
+ }
+ this.seriesSize = Integer.parseInt(tokens[2]);
+ if(seriesSize < messageNumber) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. seriesSize < messageNumber");
+ }
+ this.seriesTimestamp = Long.parseLong(tokens[3]);
+ if(seriesTimestamp < 1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. timestamp < 1");
+ }
+ if(tokens.length == 5) {
+ splitId = tokens[4];
+ }
+ } catch(NumberFormatException e) {
+ if(this.messageNumber == -1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. 'messageNumber' must be an int.");
+ } else if(this.seriesSize == -1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. 'seriesSize' must be an int.");
+ } else if(this.seriesTimestamp == -1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. 'timestamp' must be an long.");
+ }
+ }
+ }
+
+ public String getSeriesUuid() {
+ return seriesUuid;
+ }
+
+ public int getSeriesSize() {
+ return seriesSize;
+ }
+
+ public int getMessageNumber() {
+ return messageNumber;
+ }
+
+ public long getSeriesTimestamp() {
+ return seriesTimestamp;
+ }
+
+ public String getSplitId() {
+ return splitId;
+ }
+
+ public void setSplitId(String splitId) {
+ this.splitId = splitId;
+ }
+
+ public boolean equals(Object obj) {
+ if (!(obj instanceof AggregationDetails)) {
+ // also covers null
+ return false;
+ } else if (obj == this) {
+ return true;
+ } else {
+ return toString().equals(obj.toString());
+ }
+ }
+
+ public int hashCode() {
+ return toString().hashCode();
+ }
+
+ public String toString() {
+ assertDetailsSet();
+ if(splitId == null) {
+ return seriesUuid + ":" + messageNumber + ":" + seriesSize + ":" + seriesTimestamp;
+ } else {
+ return seriesUuid + ":" + messageNumber + ":" + seriesSize + ":" + seriesTimestamp + ":" + splitId;
+ }
+ }
+
+ private void assertDetailsSet() {
+ if(seriesUuid == null || seriesUuid.trim().equals("")) {
+ throw new IllegalStateException("AggregationDetails not set: 'seriesUuid' is null or empty.");
+ }
+ if(messageNumber == -1) {
+ throw new IllegalStateException("AggregationDetails not set: 'messageNumber' is not set.");
+ }
+ if(seriesSize == -1) {
+ throw new IllegalStateException("AggregationDetails not set: 'seriesSize' is not set.");
+ }
+ if(seriesTimestamp == -1) {
+ throw new IllegalStateException("AggregationDetails not set: 'timestamp' is not set.");
+ }
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -27,29 +27,28 @@
*/
package org.jboss.soa.esb.actions;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import static org.jboss.soa.esb.client.ServiceInvoker.DEAD_LETTER_SERVICE_NAME;
+import static org.jboss.soa.esb.client.ServiceInvoker.INTERNAL_SERVICE_CATEGORY;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.Util;
+
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Date;
+import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
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.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-
/**
* Simple Aggregator. The aggregator relies on 'aggregatorTags'. To puzzle the individual
* back together. The aggregatorTag is set in the MessageRouter.deliverAsync() method. The aggregator
@@ -70,26 +69,39 @@
public final static String AGGEGRATOR_TAG = "aggregatorTag";
public final static String SPLITTER_TIME_STAMP = "splitterTimeStamp";
- private ConcurrentHashMap<String,ConcurrentHashMap< String, Message > > _aggregatedMessageMap
- = new ConcurrentHashMap< String, ConcurrentHashMap< String, Message > >();
+ private Map<String, Map< Integer, Message > > aggregatedMessageMap
+ = new ConcurrentHashMap< String, Map< Integer, Message > >(); // can probably change this to a vanilla Map now
private TimeoutChecker _timeoutChecker=null;
- private ArrayList<String> _notified = new ArrayList<String>();
protected ConfigTree config;
private Logger logger = Logger.getLogger(Aggregator.class);
private Long timeoutInMillies=null;
- private String serviceName;
- private String serviceCategoryName;
- private Registry registry;
-
- private Aggregator(){}
+ private Set<String> receivedSplits = new HashSet<String>();
+ private String splitId;
+ private Aggregator(){}
+
public Aggregator(ConfigTree config) throws ConfigurationException, RegistryException
- {
+ {
+ this.config = config;
+ String timeoutAttr = config.getAttribute("timeoutInMillies", null);
- this.config = config;
- checkMyParms();
- registry = RegistryFactory.getRegistry();
+ if (timeoutAttr != null)
+ {
+ try
+ {
+ timeoutInMillies = Long.valueOf(timeoutAttr);
+ }
+ catch (NumberFormatException ex)
+ {
+ logger.error("Invalid value for timeoutInMillies: "+timeoutAttr);
+
+ throw new ConfigurationException(ex);
+ }
+ }
+
+ logger.debug("Aggregator config: timeoutInMillies=" + timeoutInMillies);
+ splitId = config.getAttribute("splitId");
}
/**
@@ -107,13 +119,17 @@
_timeoutChecker.start();
}
- /**
- * Destroy the action instance.
- * <p/>
- * This method is called prior to the release of the action instance. All
- * resources associated with this action instance should be released as the
- * instance will no longer be used.
- */
+ public Map<String, Map<Integer, Message>> getAggregatedMessageMap() {
+ return aggregatedMessageMap;
+ }
+
+ /**
+ * Destroy the action instance.
+ * <p/>
+ * This method is called prior to the release of the action instance. All
+ * resources associated with this action instance should be released as the
+ * instance will no longer be used.
+ */
public void destroy()
throws ActionLifecycleException
{
@@ -134,82 +150,138 @@
@SuppressWarnings("unchecked")
public Message process(Message message) throws ActionProcessingException
{
- ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
-
- if (aggregatorTags!=null && aggregatorTags.size()>0) {
- String aggregatorTag = (String) aggregatorTags.get(aggregatorTags.size()-1);
- //Removing the last tags and setting them as "the one in current use"
- if (aggregatorTags.size()>1) {
- aggregatorTags.remove(aggregatorTags.size()-1);
- message.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
- } else {
- message.getProperties().remove(Aggregator.AGGEGRATOR_TAG);
+ List<String> aggregatorTags = getAggregatorTags(message);
+
+ if (aggregatorTags != null && aggregatorTags.size() > 0) {
+ String aggregatorTag = aggregatorTags.get(aggregatorTags.size()-1);
+ AggregationDetails aggrDetails = new AggregationDetails(aggregatorTag);
+
+ assertAggregationDetailsOK(aggrDetails);
+
+ // Set the timestamp on the message... used by the TimeoutChecker...
+ message.getProperties().setProperty(SPLITTER_TIME_STAMP, aggrDetails.getSeriesTimestamp());
+
+ synchronized (aggregatedMessageMap)
+ {
+ Map<Integer, Message> messageMap = aggregatedMessageMap.get(aggrDetails.getSeriesUuid());
+ if (isTimedOut(aggrDetails.getSeriesTimestamp())) {
+ if (messageMap != null) {
+ //add the message in if we don't already have it
+ if (!messageMap.containsKey(aggrDetails.getMessageNumber())) {
+ messageMap.put(aggrDetails.getMessageNumber(), message);
+ }
+ //Just going to send out what we have this far, which will remove this key
+ //so subsequent messages with this uuId will be ignored
+ message = createAggregateMessage(aggrDetails.getSeriesUuid(), messageMap);
+ } else {
+ logger.debug("Ignoring this message since we are already timedout on this message.");
+ //ignoring this message
+ message = null;
+ }
+ } else {
+ //Get the messageMap with this uuId, or create it if not found
+ if (messageMap == null) {
+ messageMap = new ConcurrentHashMap<Integer, Message>();
+ aggregatedMessageMap.put(aggrDetails.getSeriesUuid(), messageMap);
+ }
+ if (messageMap.containsKey(aggrDetails.getMessageNumber())) {
+ logger.warn("Received duplicate message, ignoring it but this should not happen.");
+ } else {
+ messageMap.put(aggrDetails.getMessageNumber(), message);
+ }
+ if (messageMap.size() == aggrDetails.getSeriesSize()) {
+ message = createAggregateMessage(aggrDetails.getSeriesUuid(), messageMap);
+ } else {
+ message = null;
+ }
+ }
}
- String[] tag = aggregatorTag.split(":");
- String uuId = tag[0];
- String messageNumber = tag[1];
- int totalNumberOfMessages = Integer.valueOf(tag[2]).intValue();
- Long splitterTimeStamp = Long.valueOf(tag[3]);
- message.getProperties().setProperty(SPLITTER_TIME_STAMP, splitterTimeStamp);
+ } else {
+ // Just aggregate the single message...
+ message = createAggregateMessage(message);
+ }
+
+ return message;
+ }
- if (isTimedOut(message)) {
- if (_aggregatedMessageMap.containsKey(uuId)) {
- ConcurrentHashMap<String, Message> messageMap = _aggregatedMessageMap.get(uuId);
- //add the message in if we don't already have it
- if (!messageMap.containsKey(uuId)) {
- messageMap.put(messageNumber, message);
- }
- //Just going to send out what we have this far, which will remove this key
- //so subsequent messages with this uuId will be ignored
- message = createAggregateMessage(uuId, _aggregatedMessageMap.get(uuId));
- } else {
- logger.debug("Ignoring this message since we are already timedout on this message.");
- //ignoring this message
- message = null;
- }
- } else {
- ConcurrentHashMap<String, Message> messageMap=null;
- //Get the messageMap with this uuId, or create it if not found
- if (_aggregatedMessageMap.containsKey(uuId)) {
- messageMap = _aggregatedMessageMap.get(uuId);
- } else {
- messageMap = new ConcurrentHashMap<String, Message>();
- }
- if (messageMap.containsKey(messageNumber)) {
- logger.warn("Received duplicate message, ignoring it but this should not happen.");
- } else {
- messageMap.put(messageNumber, message);
- _aggregatedMessageMap.put(uuId, messageMap);
- }
- if (messageMap.size()==totalNumberOfMessages) {
- message = createAggregateMessage(uuId, messageMap);
- } else {
- message = null;
- }
+ private void assertAggregationDetailsOK(AggregationDetails aggrDetails) throws ActionProcessingException {
+ if(splitId != null) {
+ if(!splitId.equals(aggrDetails.getSplitId())) {
+ throw new ActionProcessingException("Invalid aggregation config on aggregator '" + config.getAttribute("action") + "' . " +
+ "This aggregator is configured " +
+ "to only aggregate message with an aggregation 'spliId' of '" + splitId + "'. " +
+ "The splitId on the received message is '" + aggrDetails.getSplitId() + "'. " +
+ "A nested aggregation point may be missing, or may have been bypassed.");
}
} else {
- throw new ActionProcessingException("Could not find an aggregator tag, so this message can not be aggregated.");
+ // log a warning if this aggregator starts receiving messages with
+ // different splitIds. This would suggest an error in the nested split configuration.
+ if(!receivedSplits.contains(aggrDetails.getSplitId())) {
+ receivedSplits.add(aggrDetails.getSplitId());
+ }
+
+ if(receivedSplits.size() > 1) {
+ logger.warn("Aggregator action '" + config.getAttribute("action") + "' has received " +
+ "split messages from more multiple 'splitId' sources: " + receivedSplits + "\n" +
+ "You may need to configure an intermediate/nested aggregator at " +
+ "some point in the message flow.");
+ }
+
}
- return message;
- }
- /**
- * Obtains the timeoutInMillies to a number
- *
- * @throws ConfigurationException
- */
- private void checkMyParms() throws ConfigurationException
- {
- timeoutInMillies = Long.valueOf(config.getAttribute("timeoutInMillies"));
- logger.debug("Aggregator config: timeoutInMillies=" + timeoutInMillies);
- serviceName = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
- serviceCategoryName = config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
}
+ public static List<String> getAggregatorTags(Message message) {
+ return (List<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
+ }
+
+ public static void setAggregatorTags(Message message, List<String> tags) {
+ if(tags != null) {
+ message.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, tags);
+ } else {
+ message.getProperties().remove(Aggregator.AGGEGRATOR_TAG);
+ }
+ }
+
+ public static AggregationDetails getAggregatorDetails(Message message, int tagIndex) throws ActionProcessingException {
+ List<String> tags = getAggregatorTags(message);
+
+ if(tags == null || tags.isEmpty()) {
+ return null;
+ } else {
+ return new AggregationDetails(tags.get(tagIndex));
+ }
+ }
+
public static void decorate(Message message) {
}
/**
+ * Aggregates a single message into an aggregated message.
+ * <p/>
+ * This method is called for messages that are recived without aggregation tags.
+ *
+ * @param message
+ * @return the aggregated message
+ */
+ @SuppressWarnings("unchecked")
+ public Message createAggregateMessage(Message message) throws ActionProcessingException {
+ // Create an aggregated message
+ Message aggregatedMessage = MessageFactory.getInstance().getMessage();
+
+ setAggregatorTags(message, null);
+ try {
+ aggregatedMessage.getAttachment().addItem(Util.serialize(message));
+ } catch (ParserConfigurationException e) {
+ throw new ActionProcessingException("Message attachment serialization failure", e);
+ } catch (IOException e) {
+ throw new ActionProcessingException("Message attachment serialization failure", e);
+ }
+
+ return aggregatedMessage;
+ }
+
+ /**
* Aggregates the messages into 1 new message with an attachment for each message.
*
* @param uuId
@@ -217,45 +289,69 @@
* @return the aggregated message
*/
@SuppressWarnings("unchecked")
- private Message createAggregateMessage(String uuId, ConcurrentHashMap<String, Message> messageMap)
- {
- //Create an aggregated message
+ public Message createAggregateMessage(String uuId, Map<Integer, Message> messageMap) throws ActionProcessingException {
+ // Create an aggregated message
Message aggregatedMessage = MessageFactory.getInstance().getMessage();
- boolean isFirstTime=true;
- for (Message message : messageMap.values()) {
- //Push additional AggregatorTags onto the new message, so we can aggregate in case of nested splits.
- //Only need to get it from the first message, should be the same for the others.
- if (isFirstTime) {
- ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
- if (aggregatorTags!=null && aggregatorTags.size()>0) {
- aggregatedMessage.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
- }
- isFirstTime=false;
+
+ //Push additional AggregatorTags onto the new message, so we can aggregate in case of nested splits.
+ //Only need to get it from the first message, should be the same for the others.
+ List<String> aggregatedMessageTags = copyAggregationTags(messageMap);
+ setAggregatorTags(aggregatedMessage, aggregatedMessageTags);
+
+ for (Message attachmentMessage : messageMap.values()) {
+ //Add the individual messages as attachments
+ try {
+ // Clear the aggregation tags from the attachment message. Any future aggregation
+ // on the payload of these messages should be done within the context of the
+ // outer/aggregated message and it's tags.
+ setAggregatorTags(attachmentMessage, null);
+ aggregatedMessage.getAttachment().addItem(Util.serialize(attachmentMessage));
+ } catch (ParserConfigurationException e) {
+ throw new ActionProcessingException("Message attachment serialization failure", e);
+ } catch (IOException e) {
+ throw new ActionProcessingException("Message attachment serialization failure", e);
}
- //Add the individual messages as attachments
- aggregatedMessage.getAttachment().addItem(message);
}
- _aggregatedMessageMap.remove(uuId);
+
+ synchronized (aggregatedMessageMap)
+ {
+ aggregatedMessageMap.remove(uuId);
+ }
//TODO remove messageMap from permanent storage, or do that per message in the loop above using value of the aggregatorTag
//remove from the notificationMap if it is in there.
- _notified.remove(uuId);
return aggregatedMessage;
}
+
+ private List<String> copyAggregationTags(Map<Integer, Message> messageMap) {
+ // Get the tags from the first message...
+ List<String> nestedAggregationTags = getAggregatorTags(messageMap.values().iterator().next());
+
+ if(nestedAggregationTags != null && nestedAggregationTags.size() > 1) {
+ // clone the tags, just incase they get zapped from the source list...
+ List<String> aggregatedMessageTags = new ArrayList<String>();
+
+ aggregatedMessageTags.addAll(nestedAggregationTags);
+ // remove the last one because that's related to the nested aggregation...
+ aggregatedMessageTags.remove(aggregatedMessageTags.size() - 1);
+
+ return aggregatedMessageTags;
+ }
+
+ return null;
+ }
+
/**
* If the aggregation process is complete then return true. This depends on the configuration.
*
- * @param totalNumberOfMessages
- * @param splitterTimeStamp
- * @param messageMap
- * @return
+ * @param splitterTimeStamp The splitter timestamp.
+ * @return True if the message is timed out, otherwise false.
*/
- private boolean isTimedOut(Message message)
+ private boolean isTimedOut(long splitterTimeStamp)
{
- long splitterTimeStamp = (Long) message.getProperties().getProperty(SPLITTER_TIME_STAMP);
if (timeoutInMillies!=null) {
long now = new Date().getTime();
- long expiration = splitterTimeStamp + Long.valueOf(timeoutInMillies);
+ long expiration = splitterTimeStamp + timeoutInMillies;
if (logger.isDebugEnabled()) {
DateFormat dateFormat = DateFormat.getTimeInstance();
logger.debug("Current time=" + dateFormat.format(new Date(now))
@@ -271,7 +367,8 @@
return false;
}
/**
- * Checks for message that are timed out. If we find that one we notify ourselves about it by resending the message.
+ * Checks for message that are timed out. If we find that one, drop it in the DLQ and delete
+ * it from the map.
*
* @author kstam
*
@@ -279,42 +376,47 @@
class TimeoutChecker extends Thread {
private final Lock terminateLock = new ReentrantLock() ;
private final Condition terminateCondition = terminateLock.newCondition() ;
- private boolean terminated ;
-
+ private boolean terminated ;
+ ServiceInvoker dlQueueInvoker;
+
@SuppressWarnings("unchecked")
public void run() {
+ try {
+ dlQueueInvoker = new ServiceInvoker(INTERNAL_SERVICE_CATEGORY, DEAD_LETTER_SERVICE_NAME);
+ } catch (MessageDeliverException e) {
+ logger.error("Unable to initialise Dead Letter Channel Service Invoker for Aggregation timeout checker. Not using Dead Letter Channel.", e);
+ }
+
boolean running = true ;
while(running) {
//no need to check if no timeout is set
if (timeoutInMillies!=null) {
- for (ConcurrentHashMap< String, Message > messageMap : _aggregatedMessageMap.values()) {
+ // is a snapshot so no lock needed
+ for (Map<Integer, Message > messageMap : aggregatedMessageMap.values()) {
//Check the first message, they all have the same time stamp
Message message = messageMap.values().iterator().next();
- if (isTimedOut(message)) {
- //We found a timed-out message. Let's go notify ourselves about by resending a message,
- //it if we haven't done so already
- ArrayList<String> aggregatorTag = (ArrayList<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
- String uuId = aggregatorTag.get(0);
- if (!_notified.contains(uuId)) {
- _notified.add(uuId);
- logger.debug("Found timeout message.");
+ long timeStamp = (Long) message.getProperties().getProperty(SPLITTER_TIME_STAMP);
+
+ if (isTimedOut(timeStamp)) {
+ //We found a timed-out message. Let's go notify ourselves about it by resending a message,
+ //if we haven't done so already
+ List<String> aggregatorTag = getAggregatorTags(message);
+ if(aggregatorTag != null && !aggregatorTag.isEmpty()) {
+ AggregationDetails aggrDetails = new AggregationDetails(aggregatorTag.get(aggregatorTag.size() - 1));
+
try {
- EPR epr = registry.findEPR(serviceCategoryName, serviceName);
- Courier courier = CourierFactory.getCourier(epr);
- try
- {
- courier.deliver(message);
+ logger.info("Deleting message aggregation series: " + aggrDetails.getSeriesUuid());
+ if(dlQueueInvoker != null) {
+ Message aggregateMessage = createAggregateMessage(aggrDetails.getSeriesUuid(), messageMap);
+ dlQueueInvoker.deliverAsync(aggregateMessage);
}
- finally
- {
- CourierUtil.cleanCourier(courier) ;
- }
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- //If we can't notify then drop this data
- logger.debug("Deleting data for message series with uuId=" + uuId);
- _notified.remove(uuId);
- _aggregatedMessageMap.remove(uuId);
+ } catch(Throwable e) {
+ logger.error("Error delivering timed out aggregation message to Dead Letter Service.", e);
+ } finally {
+ synchronized (aggregatedMessageMap)
+ {
+ aggregatedMessageMap.remove(aggrDetails.getSeriesUuid());
+ }
}
}
}
@@ -332,7 +434,7 @@
}
}
}
-
+
public void terminate() {
terminateLock.lock() ;
try
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,83 @@
+package org.jboss.soa.esb.actions;
+
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.apache.log4j.Logger;
+
+/**
+ * <p/>
+ * This action adds all of its attributes to the message as properties. It was created to
+ * help pass in the name of the filename to use for StoreMessageToFile for continuous integration
+ * of quickstarts, but it has a more generalized purpose in that it allows anyone to set
+ * message properties quickly in the jboss-esb.xml.
+ * <p/>
+ * An "Action Processor" performs a processing action on a message payload and returns the processing
+ * result.
+ * <p/>
+ * Here is an example of how to use this within your jboss-esb.xml :
+ * <p/>
+ * <code>
+ * <action name="AddProperty"
+ * class="org.jboss.soa.esb.actions.PropertySetter"><br/>
+ * <property name="jbesbfilename" value="BPMOrchestration1Test.log"/><br/>
+ * </action><br/>
+ * </code>
+ * <p/>
+ * This will insert a property "jbesbfilename" into the message with a value of
+ * "BPMOrchestration1Test.log". There are no checks here on property names, so be careful
+ * when setting properties for JMS that you only set ones with valid names.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2.1
+ *
+ */
+public class PropertySetter extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+ private Logger logger = Logger.getLogger(PropertySetter.class);
+
+ /**
+ * Adds attributes to the message as properties
+ * @param message message
+ * @return message
+ * @throws Exception
+ */
+ public Message process(Message message) throws Exception {
+ try {
+ for (String key : _config.getAttributeNames()) {
+ String value = _config.getAttribute(key);
+ message.getProperties().setProperty(key, value);
+ }
+ } catch (Exception e) {
+ logger.error("", e);
+ throw e;
+ }
+
+ return message;
+ }
+
+ public PropertySetter(ConfigTree config) { _config = config; }
+
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -41,7 +41,7 @@
}
/**
- * Routes the message to one or more destonations.
+ * Routes the message to one or more destinations.
*/
public Message process(Message message) throws ActionProcessingException
{
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -31,6 +31,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.client.MessageMulticaster;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
@@ -68,6 +69,8 @@
*/
public void initialise() throws ActionLifecycleException
{
+ messageMulticaster = new MessageMulticaster(_config.getAttribute("action", "%unset%"));
+
ConfigTree[] destList = _config.getChildren(ROUTE_TO_TAG);
if (null == destList || destList.length < 1)
{
@@ -92,7 +95,7 @@
protected ConfigTree _config;
- protected org.jboss.soa.esb.client.MessageMulticaster messageMulticaster = new org.jboss.soa.esb.client.MessageMulticaster();
+ protected MessageMulticaster messageMulticaster;
protected static Logger _logger = Logger.getLogger(StaticWiretap.class);
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -31,7 +31,6 @@
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.message.ActionProcessingPipeline;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.MessagePayloadProxy;
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,193 @@
+/*
+ * 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
+ */
+package org.jboss.soa.esb.actions;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.ActionProcessingPipeline;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+
+/**
+ * Simple action that passes the message to a logging mechanism.
+ * This action is primarily used for testing the quickstarts.
+ *
+ * @author Kevin Conner
+ */
+public class TestMessageStore extends AbstractActionPipelineProcessor
+{
+ /**
+ * The message content location.
+ */
+ public static final String LOCATION = "location" ;
+ /**
+ * The log success flag.
+ */
+ public static final String LOG_SUCCESS = "logSuccess" ;
+ /**
+ * The log exception flag.
+ */
+ public static final String LOG_EXCEPTION = "logException" ;
+
+ /**
+ * The global test message store sink.
+ */
+ private static TestMessageStoreSink testMessageStoreSink ;
+
+ /**
+ * The message payload proxy.
+ */
+ private final MessagePayloadProxy payloadProxy ;
+ /**
+ * Should we log the success notification?
+ */
+ private final boolean logSuccess ;
+ /**
+ * Should we log the exception notification?
+ */
+ private final boolean logException ;
+
+ /**
+ * Create the action with the specified configuration.
+ *
+ * @param config The action configuration.
+ */
+ public TestMessageStore(final ConfigTree config)
+ {
+ String location = config.getAttribute(LOCATION) ;
+ if(location != null)
+ {
+ config.setAttribute(MessagePayloadProxy.GET_PAYLOAD_LOCATION, location) ;
+ }
+ payloadProxy = new MessagePayloadProxy(config) ;
+ payloadProxy.setNullGetPayloadHandling(MessagePayloadProxy.NullPayloadHandling.LOG) ;
+ logSuccess = config.getBooleanAttribute(LOG_SUCCESS, false) ;
+ logException = config.getBooleanAttribute(LOG_EXCEPTION, false) ;
+ }
+
+ /**
+ * Process the message.
+ *
+ * @param message The current message.
+ * @throws ActionProcessingPipeline for errors in processing.
+ */
+ public Message process(final Message message)
+ throws ActionProcessingException
+ {
+ logContents(getContents(message)) ;
+ return message ;
+ }
+
+ /**
+ * Process the exception notification.
+ * @param message The associated message.
+ * @param th The throwable causing the exception.
+ */
+ public void processException(final Message message, final Throwable th)
+ {
+ if (logException)
+ {
+ try
+ {
+ logContents(th.getLocalizedMessage() + ':' + getContents(message)) ;
+ }
+ catch (final ActionProcessingException ape)
+ {
+ logContents(ape.getLocalizedMessage()) ;
+ }
+ }
+ }
+
+ /**
+ * Process the success notification.
+ * @param message The associated message.
+ */
+ public void processSuccess(final Message message)
+ {
+ if (logSuccess)
+ {
+ try
+ {
+ logContents("Success:" + getContents(message)) ;
+ }
+ catch (final ActionProcessingException ape)
+ {
+ logContents(ape.getLocalizedMessage()) ;
+ }
+ }
+ }
+
+ /**
+ * Get the message contents.
+ * @param message The message.
+ * @return the message contents as a string or null if no contents.
+ * @throws ActionProcessingException for errors in processing.
+ */
+ private String getContents(final Message message)
+ throws ActionProcessingException
+ {
+ final Object contents;
+
+ try
+ {
+ contents = payloadProxy.getPayload(message) ;
+ }
+ catch (final MessageDeliverException mde)
+ {
+ throw new ActionProcessingException(mde) ;
+ }
+
+ if (contents != null)
+ {
+ final String messageVal ;
+ if (contents instanceof byte[])
+ {
+ messageVal = new String((byte[])contents) ;
+ }
+ else
+ {
+ messageVal = contents.toString() ;
+ }
+ return messageVal ;
+ }
+ return null ;
+ }
+
+ /**
+ * Set the message store sink.
+ * @param testMessageStoreSink The test message store sink.
+ */
+ public static synchronized void setMessageStoreSink(final TestMessageStoreSink testMessageStoreSink)
+ {
+ TestMessageStore.testMessageStoreSink = testMessageStoreSink ;
+ }
+
+ /**
+ * Log the contents to the message store sink.
+ * @param message The current message.
+ */
+ private static synchronized void logContents(final String message)
+ {
+ if (testMessageStoreSink != null)
+ {
+ testMessageStoreSink.logMessage(message) ;
+ }
+ }
+}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,129 @@
+/*
+ * 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
+ */
+package org.jboss.soa.esb.actions;
+
+import java.util.ArrayList;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * Simple action that passes the message to a logging mechanism.
+ * This action is primarily used for testing the quickstarts.
+ *
+ * @author Kevin Conner
+ */
+public class TestMessageStoreSink
+{
+ /**
+ * The list of messages.
+ */
+ private final ArrayList<String> list = new ArrayList<String>() ;
+ /**
+ * The lock for the sink.
+ */
+ private final Lock lock = new ReentrantLock() ;
+ /**
+ * The condition for notifying messages.
+ */
+ private final Condition waitCondition = lock.newCondition() ;
+
+ /**
+ * Wait for the specified number of messages to appear in the sink.
+ * @param numberOfMessages The number of messages.
+ * @param maxDelay The maximum delay for waiting.
+ */
+ public String[] waitForMessages(final int numberOfMessages, final long maxDelay)
+ {
+ final long startTime = System.currentTimeMillis() ;
+ final long endTime = startTime + maxDelay ;
+ lock.lock() ;
+ try
+ {
+ while (list.size() != numberOfMessages)
+ {
+ final long now = System.currentTimeMillis() ;
+ final long waitPeriod = endTime - now ;
+ if (waitPeriod > 0)
+ {
+ try
+ {
+ waitCondition.await(waitPeriod, TimeUnit.MILLISECONDS) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ }
+ else
+ {
+ break ;
+ }
+ }
+ final String[] results = list.toArray(new String[0]) ;
+ list.clear() ;
+ final int numResults = results.length ;
+ System.out.println("TestMessageStoreSink: Returning " + numResults + " message" + (numResults == 1 ? "" : "s")) ;
+ for(int count = 0 ; count < numResults ; count++)
+ {
+ System.out.println("TestMessageStoreSink: Returning message[" + count + "]: " + results[count]) ;
+ }
+ return results ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+
+ /**
+ * Log the message in the sink.
+ * @param message The current message.
+ */
+ public void logMessage(final String message)
+ {
+ lock.lock() ;
+ try
+ {
+ list.add(message) ;
+ System.out.println("TestMessageStoreSink: Adding message: " + message) ;
+ waitCondition.signal() ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+
+ /**
+ * Clear the messages in the sink.
+ */
+ public void clearMessages()
+ {
+ lock.lock() ;
+ try
+ {
+ list.clear() ;
+ System.out.println("TestMessageStoreSink: Clearing messages") ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -51,7 +51,8 @@
import org.jboss.soa.esb.common.Configuration;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.helpers.NamingContext;
+import org.jboss.soa.esb.helpers.NamingContextException;
+import org.jboss.soa.esb.helpers.NamingContextPool;
import org.jboss.soa.esb.notification.jms.DefaultJMSPropertiesSetter;
import org.jboss.soa.esb.notification.jms.JMSPropertiesSetter;
import org.jboss.soa.esb.util.Util;
@@ -351,7 +352,7 @@
Properties environment;
// TODO: Modify to support topic destinations too
- private JMSSendQueueSetup(String destinationName) throws NamingException, JMSException, ConnectionException {
+ private JMSSendQueueSetup(String destinationName) throws NamingException, JMSException, ConnectionException, NamingContextException {
this( destinationName, null, null, null, null);
}
@@ -359,7 +360,7 @@
String jndiContextFactory,
String jndiUrl,
String jndiPkgPrefix,
- String connectionFactoryName) throws NamingException, JMSException, ConnectionException {
+ String connectionFactoryName) throws NamingException, JMSException, ConnectionException, NamingContextException {
if ( jndiContextFactory == null )
jndiContextFactory = Configuration.getJndiServerContextFactory();
@@ -374,33 +375,36 @@
environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, jndiContextFactory);
environment.setProperty(Context.PROVIDER_URL, jndiUrl);
environment.setProperty(Context.URL_PKG_PREFIXES, jndiPkgPrefix);
- Context oCtx = NamingContext.getServerContext(environment);
- pool = JmsConnectionPoolContainer.getPool(environment, connectionFactoryName, JMSEpr.QUEUE_TYPE);
-
- this.destinationName = destinationName;
-
- jmsSession = pool.getQueueSession();
- boolean clean = true ;
+ Context oCtx = NamingContextPool.getNamingContext(environment);
try {
+ pool = JmsConnectionPoolContainer.getPool(environment, connectionFactoryName, JMSEpr.QUEUE_TYPE);
+
+ this.destinationName = destinationName;
+
+ jmsSession = pool.getQueueSession();
+ boolean clean = true ;
try {
- jmsDestination = (Destination)oCtx.lookup(destinationName);
- } catch (NamingException ne) {
try {
- oCtx = NamingContext.getFreshServerContext(environment);
- jmsDestination = (Queue) oCtx.lookup(destinationName);
- } catch (NamingException nex) {
- //ActiveMQ
- jmsDestination = jmsSession.createQueue(destinationName);
+ jmsDestination = (Destination) oCtx.lookup(destinationName);
+ } catch (NamingException ne) {
+ try {
+ oCtx = NamingContextPool.replaceNamingContext(oCtx, environment);
+ jmsDestination = (Queue) oCtx.lookup(destinationName);
+ } catch (NamingException nex) {
+ //ActiveMQ
+ jmsDestination = jmsSession.createQueue(destinationName);
+ }
}
+ jmsProducer = jmsSession.createProducer(jmsDestination);
+ clean = false ;
+ } finally {
+ if (clean) {
+ pool.closeSession(jmsSession) ;
+ }
}
- jmsProducer = jmsSession.createProducer(jmsDestination);
- clean = false ;
} finally {
- if (clean) {
- pool.closeSession(jmsSession) ;
- }
+ NamingContextPool.releaseNamingContext(oCtx) ;
}
-
}
public void setDeliveryMode(final int deliveryMode ) throws JMSException
@@ -423,14 +427,13 @@
private void close() {
try {
+ pool.closeSession(jmsSession);
if (jmsProducer!=null) {
jmsProducer.close();
}
} catch (Exception e) {
logger.error("Unable to close JMS Queue Setup.", e);
- } finally {
- pool.closeSession(jmsSession);
- }
+ }
}
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -59,6 +59,23 @@
}
/**
+ * Copy constructor.
+ *
+ * @param copy
+ */
+
+ public Call (Call copy) throws URISyntaxException
+ {
+ _to = ((copy._to == null) ? null : copy._to.copy());
+ _from = ((copy._from == null) ? null : copy._from.copy());
+ _replyTo = ((copy._replyTo == null) ? null : copy._replyTo.copy());
+ _relatesTo = ((copy._relatesTo == null) ? null : new URI(copy._relatesTo.toString()));
+ _faultTo = ((copy._faultTo == null) ? null : copy._faultTo.copy());
+ _action = ((copy._action == null) ? null : new URI(copy._action.toString()));
+ _messageID = ((copy._messageID == null) ? null : new URI(copy._messageID.toString()));
+ }
+
+ /**
* Create a new call, whose To field is set to the supplied EPR.
*
* @param epr the To field.
@@ -224,9 +241,11 @@
}
/**
- * Copy the instance specified.
+ * Copy the instance specified. This does a shallow (ptr) copy, so is not
+ * recommended.
*
* @param from the instance to copy.
+ * @deprecated use the copy constructor.
*/
public void copy (Call from)
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -73,6 +73,21 @@
}
/**
+ * Copy constructor.
+ *
+ * @param from
+ */
+
+ public EPR (EPR from)
+ {
+ /*
+ * Copy the underlying EPR values.
+ */
+
+ _addr = (PortReference) from._addr.copy();
+ }
+
+ /**
* Override the address of this EPR.
*
* @param uri the new address.
@@ -95,22 +110,12 @@
}
/**
- * Copy the contents of the specified EPR into this instance.
- * Can be used by copy constructors.
- *
- * @param from the instance to copy.
- * @deprecated use the copy constructor instead.
+ * Return a copy of this EPR.
*/
- public void copy (EPR from)
+ public EPR copy ()
{
- EPR fromImpl = (EPR) from;
-
- /*
- * Copy the underlying EPR values.
- */
-
- _addr = (PortReference) fromImpl._addr.copy();
+ return new EPR(this);
}
// public void setMetaData (MetaData md);
@@ -134,21 +139,6 @@
return false;
}
- /**
- * Copy constructor.
- *
- * @param from
- */
-
- protected EPR (EPR from)
- {
- /*
- * Copy the underlying EPR values.
- */
-
- _addr = (PortReference) from._addr.copy();
- }
-
private PortReference _addr;
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -76,7 +76,16 @@
XMLUtil.JBOSSESB_NAMESPACE_URI, value,
Extension.REFERENCE_PROPERTIES);
}
-
+
+ public void removeExtension (String tag, String value)
+ {
+ /*
+ * Need tag and value to make sure it's unique.
+ */
+
+ _extensions.remove(new Extension(tag, XMLUtil.JBOSSESB_PREFIX, XMLUtil.JBOSSESB_NAMESPACE_URI, value));
+ }
+
public void addExtension(String tag, String value)
{
addExtension(tag, XMLUtil.JBOSSESB_PREFIX,
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -27,6 +27,8 @@
package org.jboss.soa.esb.addressing;
+import javax.xml.namespace.QName;
+
public class XMLUtil
{
// WS-Addr
@@ -34,18 +36,29 @@
public static final String WSA_PREFIX = "wsa";
public static final String WSA_NAMESPACE_URI = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
- public static final String ENDPOINT_REFERENCE_TAG = "EndpointReference";
- public static final String MESSAGE_IDENTIFIER_TAG = "MessageID";
- public static final String REFERENCE_PROPERTIES_TAG = "ReferenceProperties";
- public static final String REFERENCE_PARAMETERS_TAG = "ReferenceParameters";
- public static final String REPLY_TO_TAG = "ReplyTo";
- public static final String FROM_TAG = "From";
+ public static final String ENDPOINT_REFERENCE_TAG = "EndpointReference";
+ public static final QName QNAME_ENDPOINT_REFERENCE_TAG = new QName(WSA_NAMESPACE_URI, "EndpointReference", WSA_PREFIX);
+ public static final String MESSAGE_IDENTIFIER_TAG = "MessageID";
+ public static final QName QNAME_MESSAGE_IDENTIFIER_TAG = new QName(WSA_NAMESPACE_URI, "MessageID", WSA_PREFIX);
+ public static final String REFERENCE_PROPERTIES_TAG = "ReferenceProperties";
+ public static final QName QNAME_REFERENCE_PROPERTIES_TAG = new QName(WSA_NAMESPACE_URI, "ReferenceProperties", WSA_PREFIX);
+ public static final String REFERENCE_PARAMETERS_TAG = "ReferenceParameters";
+ public static final QName QNAME_REFERENCE_PARAMETERS_TAG = new QName(WSA_NAMESPACE_URI, "ReferenceParameters", WSA_PREFIX);
+ public static final String REPLY_TO_TAG = "ReplyTo";
+ public static final QName QNAME_REPLY_TO_TAG = new QName(WSA_NAMESPACE_URI, "ReplyTo", WSA_PREFIX);
+ public static final String FROM_TAG = "From";
+ public static final QName QNAME_FROM_TAG = new QName(WSA_NAMESPACE_URI, "From", WSA_PREFIX);
public static final String TO_TAG = "To";
+ public static final QName QNAME_TO_TAG = new QName(WSA_NAMESPACE_URI, "To", WSA_PREFIX);
public static final String ADDRESS_TAG = "Address";
+ public static final QName QNAME_ADDRESS_TAG = new QName(WSA_NAMESPACE_URI, "Address", WSA_PREFIX);
public static final String ACTION_TAG = "Action";
+ public static final QName QNAME_ACTION_TAG = new QName(WSA_NAMESPACE_URI, "Action", WSA_PREFIX);
public static final String RELATES_TO_TAG = "RelatesTo";
+ public static final QName QNAME_RELATES_TO_TAG = new QName(WSA_NAMESPACE_URI, "RelatesTo", WSA_PREFIX);
public static final String FAULT_TO_TAG = "FaultTo";
+ public static final QName QNAME_FAULT_TO_TAG = new QName(WSA_NAMESPACE_URI, "FaultTo", WSA_PREFIX);
// JBossESB
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -206,6 +206,11 @@
{
return "EmailEpr [ "+super.getAddr().extendedToString()+" ]";
}
+
+ public EPR copy ()
+ {
+ return new EmailEpr(this);
+ }
public static final URI type ()
{
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -54,6 +54,15 @@
public FTPEpr (EPR epr)
{
super(epr);
+
+ if (epr instanceof FTPEpr)
+ {
+ FTPEpr instance = (FTPEpr) epr;
+
+ passwordSet = instance.passwordSet;
+ userSet = instance.userSet;
+ passiveSet = instance.passiveSet;
+ }
}
public FTPEpr (EPR epr, Element header)
@@ -74,15 +83,25 @@
if (tag != null)
{
if (tag.equals(USERNAME_TAG))
- getAddr().addExtension(USERNAME_TAG, nl.item(i).getTextContent());
+ setUserName(nl.item(i).getTextContent());
else
{
if (tag.equals(PASSWORD_TAG))
- getAddr().addExtension(PASSWORD_TAG, nl.item(i).getTextContent());
+ setPassword(nl.item(i).getTextContent());
else
{
if (tag.equals(PASSIVE_TAG))
- getAddr().addExtension(PASSIVE_TAG, nl.item(i).getTextContent());
+ {
+ String content = nl.item(i).getTextContent();
+
+ if ("true".equalsIgnoreCase(content))
+ setPassive(true);
+ else
+ {
+ if ("false".equalsIgnoreCase(content))
+ setPassive(false);
+ }
+ }
}
}
}
@@ -220,6 +239,11 @@
{
return "FTPEpr [ "+super.getAddr().extendedToString()+" ]";
}
+
+ public EPR copy ()
+ {
+ return new FTPEpr(this);
+ }
public static URI type ()
{
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -62,6 +62,20 @@
public FileEpr (EPR epr)
{
super(epr);
+
+ if (epr instanceof FileEpr)
+ {
+ FileEpr instance = (FileEpr) epr;
+
+ inputSet = instance.inputSet;
+ workSet = instance.workSet;
+ postDirSet = instance.postDirSet;
+ postSuffixSet = instance.postSuffixSet;
+ postDelSet = instance.postDelSet;
+ errorDirSet = instance.errorDirSet;
+ errorSuffixSet = instance.errorSuffixSet;
+ errorDelSet = instance.errorDelSet;
+ }
}
public FileEpr (EPR epr, Element header)
@@ -82,33 +96,53 @@
if (tag != null)
{
if (tag.equals(INPUT_SUFFIX_TAG))
- getAddr().addExtension(INPUT_SUFFIX_TAG, nl.item(i).getTextContent());
+ setInputSuffix(nl.item(i).getTextContent());
else
{
if (tag.equals(POST_DIR_TAG))
- getAddr().addExtension(POST_DIR_TAG, nl.item(i).getTextContent());
+ setPostDirectory(nl.item(i).getTextContent());
else
{
if (tag.equals(POST_SUFFIX_TAG))
- getAddr().addExtension(POST_SUFFIX_TAG, nl.item(i).getTextContent());
+ setPostSuffix(nl.item(i).getTextContent());
else
{
if (tag.equals(POST_DEL_TAG))
- getAddr().addExtension(POST_DEL_TAG, nl.item(i).getTextContent());
+ {
+ String content = nl.item(i).getTextContent();
+
+ if ("true".equalsIgnoreCase(content))
+ setPostDelete(true);
+ else
+ {
+ if ("false".equalsIgnoreCase(content))
+ setPostDelete(false);
+ }
+ }
else
{
if (tag.equals(ERROR_DIR_TAG))
{
- getAddr().addExtension(ERROR_DIR_TAG, nl.item(i).getTextContent());
+ setErrorDirectory(nl.item(i).getTextContent());
}
else
{
if (tag.equals((ERROR_SUFFIX_TAG)))
- getAddr().addExtension(ERROR_SUFFIX_TAG, nl.item(i).getTextContent());
+ setErrorSuffix(nl.item(i).getTextContent());
else
{
if (tag.equals((ERROR_DEL_TAG)))
- getAddr().addExtension(ERROR_DEL_TAG, nl.item(i).getTextContent());
+ {
+ String content = nl.item(i).getTextContent();
+
+ if ("true".equalsIgnoreCase(content))
+ setErrorDelete(true);
+ else
+ {
+ if ("false".equalsIgnoreCase(content))
+ setErrorDelete(false);
+ }
+ }
}
}
}
@@ -397,6 +431,11 @@
{
return "FileEpr [ "+super.getAddr().extendedToString()+" ]";
}
+
+ public EPR copy ()
+ {
+ return new FileEpr(this);
+ }
public static URI type ()
{
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -92,6 +92,11 @@
{
return "HTTPEpr [ "+super.getAddr().extendedToString()+" ]";
}
+
+ public EPR copy ()
+ {
+ return new HTTPEpr(this);
+ }
public static final URI type ()
{
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -74,6 +74,18 @@
public HibernateEpr(EPR epr) {
super(epr);
+
+ if (epr instanceof HibernateEpr)
+ {
+ HibernateEpr instance = (HibernateEpr) epr;
+
+ cfgFileSet = instance.cfgFileSet;
+ classNameSet = instance.classNameSet;
+ statusSet = instance.statusSet;
+ messageSet = instance.messageSet;
+ timestampSet = instance.timestampSet;
+ dataSet = instance.dataSet;
+ }
}
public HibernateEpr (EPR epr, Element header)
@@ -90,11 +102,11 @@
if (tag != null)
{
if (tag.equals(HIBERNATE_CFG_TAG)) {
- getAddr().addExtension(HIBERNATE_CFG_TAG, nl.item(i).getTextContent());
+ setHibernateCfgFile(nl.item(i).getTextContent());
} else if (tag.equals(CLASS_NAME_TAG)) {
- getAddr().addExtension(CLASS_NAME_TAG, nl.item(i).getTextContent());
+ setClassName(nl.item(i).getTextContent());
} else if (tag.equals(EVENT_TAG)) {
- getAddr().addExtension(EVENT_TAG, nl.item(i).getTextContent());
+ setEvent(nl.item(i).getTextContent());
}
}
} catch (Exception ex) {
@@ -350,7 +362,21 @@
{
return "HibernateEpr [ "+super.getAddr().extendedToString()+" ]";
}
+
+ public EPR copy ()
+ {
+ return new HibernateEpr(this);
+ }
+ protected final void changeClassName (String className) throws URISyntaxException
+ {
+ classNameSet = false;
+
+ super.getAddr().removeExtension(CLASS_NAME_TAG, getClassName());
+
+ setClassName(className);
+ }
+
public static final URI type ()
{
return m_type;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -68,6 +68,21 @@
public JDBCEpr (EPR epr)
{
super(epr);
+
+ if (epr instanceof JDBCEpr)
+ {
+ JDBCEpr instance = (JDBCEpr) epr;
+
+ userSet = instance.userSet;
+ passwordSet = instance.passwordSet;
+ sqlSet = instance.sqlSet;
+ driverSet = instance.driverSet;
+ tableNameSet = instance.tableNameSet;
+ messageIdSet = instance.messageIdSet;
+ statusSet = instance.statusSet;
+ dataSet = instance.dataSet;
+ timestampSet = instance.timestampSet;
+ }
}
public JDBCEpr (EPR epr, Element header)
@@ -88,43 +103,43 @@
if (tag != null)
{
if (tag.equals(USERNAME_TAG))
- getAddr().addExtension(USERNAME_TAG, nl.item(i).getTextContent());
+ setUserName(nl.item(i).getTextContent());
else
{
if (tag.equals(PASSWORD_TAG))
- getAddr().addExtension(PASSWORD_TAG, nl.item(i).getTextContent());
+ setPassword(nl.item(i).getTextContent());
else
{
if (tag.equals(SQL_TAG))
- getAddr().addExtension(SQL_TAG, nl.item(i).getTextContent());
+ setSQL(nl.item(i).getTextContent());
else
{
if (tag.equals(DRIVER_TAG))
- getAddr().addExtension(DRIVER_TAG, nl.item(i).getTextContent());
+ setDriver(nl.item(i).getTextContent());
else
{
if (tag.equals(URL_TAG))
- getAddr().addExtension(URL_TAG, nl.item(i).getTextContent());
+ setURL(nl.item(i).getTextContent());
else
{
if (tag.equals(TABLE_NAME_TAG))
- getAddr().addExtension(TABLE_NAME_TAG, nl.item(i).getTextContent());
+ setTableName(nl.item(i).getTextContent());
else
{
if (tag.equals(MESSAGE_ID_COLUMN_TAG))
- getAddr().addExtension(MESSAGE_ID_COLUMN_TAG, nl.item(i).getTextContent());
+ setMessageIdColumn(nl.item(i).getTextContent());
else
{
if (tag.equals(STATUS_COLUMN_TAG))
- getAddr().addExtension(STATUS_COLUMN_TAG, nl.item(i).getTextContent());
+ setStatusColumn(nl.item(i).getTextContent());
else
{
if (tag.equals(DATA_COLUMN_TAG))
- getAddr().addExtension(DATA_COLUMN_TAG, nl.item(i).getTextContent());
+ setDataColumn(nl.item(i).getTextContent());
else
{
if (tag.equals(TIMESTAMP_COLUMN_TAG))
- getAddr().addExtension(TIMESTAMP_COLUMN_TAG, nl.item(i).getTextContent());
+ setTimestampColumn(nl.item(i).getTextContent());
else
{
if (tag.equals(POST_DEL_TAG))
@@ -175,6 +190,11 @@
getAddr().addExtension(ERROR_DEL_TAG,Boolean.toString(errorDelete));
}
+ public EPR copy ()
+ {
+ return new JDBCEpr(this);
+ }
+
/**
* Set the URL for this endpoint.
*
@@ -496,6 +516,15 @@
return _type;
}
+ protected final void changeTableName (String tableName) throws URISyntaxException
+ {
+ tableNameSet = false;
+
+ super.getAddr().removeExtension(TABLE_NAME_TAG, getTableName());
+
+ setTableName(tableName);
+ }
+
private boolean userSet = false;
private boolean passwordSet = false;
private boolean sqlSet = false;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -88,6 +88,8 @@
public static final String PERSISTENT_TAG = "persistent";
+ public static final String TRANSACTED_TAG = "transacted";
+
/**
* JMS Client acknowledgment mode configuration tag
*/
@@ -203,6 +205,13 @@
} else if (tag.equals(DESTINATION_TYPE_TAG)) {
getAddr().addExtension(DESTINATION_TYPE_TAG, nl.item(i).getTextContent());
}
+ } else if (tag.equals(TRANSACTED_TAG)) {
+ boolean transacted = false;
+ final String transactedStr = nl.item(i).getTextContent();
+ if ( transactedStr != null )
+ transacted = Boolean.parseBoolean(transactedStr);
+
+ getAddr().addExtension(TRANSACTED_TAG, String.valueOf(transacted));
}
}
}
@@ -298,7 +307,7 @@
String destinationName, String connection, Properties environment,
String messageSelector, boolean peristent)
{
- this(protocol,destinationType,destinationName,connection,environment,messageSelector,peristent,DEFAULT_ACKNOWLEDGE_MODE);
+ this(protocol, destinationType, destinationName, connection, environment, messageSelector, peristent, DEFAULT_ACKNOWLEDGE_MODE);
}
/**
@@ -318,15 +327,72 @@
* reference to the connection factory.
* @param peristent
* true if messages should be sent persistently
+ */
+ public JMSEpr(String protocol, String destinationType,
+ String destinationName, String connection, Properties environment,
+ String messageSelector, boolean peristent,
+ boolean transacted)
+ {
+ this(protocol, destinationType, destinationName, connection, environment, messageSelector, peristent, DEFAULT_ACKNOWLEDGE_MODE, transacted);
+ }
+
+ /**
+ * Create a new JMS EPR.
+ *
+ * @param protocol
+ * the protocol version.
+ * @param destinationType
+ * the type of destination (queue/topic).
+ * @param destinationName
+ * name of the queue/topic.
+ * @param connection
+ * reference to the connection factory.
+ * @param environment
+ * reference to the jndi properties
+ * @param messageSelector
+ * reference to the connection factory.
+ * @param peristent
+ * true if messages should be sent persistently
* @param acknowledgeModeStr
* JMS client acknowledgement mode
+ * @param transacted
+ * true if the jms session should be transaction aware
*/
public JMSEpr(String protocol, String destinationType,
String destinationName, String connection, Properties environment,
+ String messageSelector, boolean peristent, String acknowledgeModeStr,
+ boolean transacted)
+ {
+ this( protocol, destinationType, destinationName, connection, environment,
+ messageSelector, peristent, acknowledgeModeStr, null, null, transacted );
+ }
+
+ /**
+ * Create a new JMS EPR.
+ *
+ * @param protocol
+ * the protocol version.
+ * @param destinationType
+ * the type of destination (queue/topic).
+ * @param destinationName
+ * name of the queue/topic.
+ * @param connection
+ * reference to the connection factory.
+ * @param environment
+ * reference to the jndi properties
+ * @param messageSelector
+ * reference to the connection factory.
+ * @param peristent
+ * true if messages should be sent persistently
+ * @param acknowledgeModeStr
+ * JMS client acknowledgement mode
+ */
+ public JMSEpr(String protocol, String destinationType,
+ String destinationName, String connection, Properties environment,
String messageSelector, boolean peristent, String acknowledgeModeStr)
{
this( protocol, destinationType, destinationName, connection, environment,
- messageSelector, peristent, acknowledgeModeStr, null, null );
+ messageSelector, peristent, acknowledgeModeStr, null, null, false );
}
/**
@@ -349,14 +415,52 @@
* @param acknowledgeModeStr
* JMS client acknowledgement mode
* @param username
+ * username to use when creating JMS connections
+ * @param password
+ * password to use when creating JMS connections
+ */
+ public JMSEpr(String protocol, String destinationType,
+ String destinationName, String connection, Properties environment,
+ String messageSelector, boolean peristent, String acknowledgeModeStr,
+ String username, String password)
+ {
+ this( protocol, destinationType, destinationName, connection, environment,
+ messageSelector, peristent, acknowledgeModeStr, username, password, false );
+
+ }
+
+ /**
+ * Create a new JMS EPR.
+ *
+ * @param protocol
+ * the protocol version.
+ * @param destinationType
+ * the type of destination (queue/topic).
+ * @param destinationName
+ * name of the queue/topic.
+ * @param connection
+ * reference to the connection factory.
+ * @param environment
+ * reference to the jndi properties
+ * @param messageSelector
+ * reference to the connection factory.
+ * @param peristent
+ * true if messages should be sent persistently
+ * @param acknowledgeModeStr
+ * JMS client acknowledgement mode
+ * @param username
* JMS destination username
* @param password
* JMS destination password
+ * @param transacted
+ * true if the jms session should be transaction aware
+ *
*/
public JMSEpr(String protocol, String destinationType,
String destinationName, String connection, Properties environment,
String messageSelector, boolean peristent, String acknowledgeModeStr,
- String username, String password)
+ String username, String password,
+ boolean transacted)
{
// how many of these do we really need? modify accordingly.
@@ -421,6 +525,8 @@
if(password != null)
addr.addExtension(JMS_SECURITY_CREDENTIAL_TAG, password);
+
+ addr.addExtension(TRANSACTED_TAG, String.valueOf(transacted));
}
else
@@ -568,7 +674,20 @@
final String password = getAddr().getExtensionValue(JMS_SECURITY_CREDENTIAL_TAG);
return password == null || password.equals("null") ? null : password;
}
+
+ /**
+ * @return the delivery mode
+ */
+ public final boolean getTransacted()
+ {
+ return Boolean.parseBoolean(getAddr().getExtensionValue(TRANSACTED_TAG));
+ }
+ public EPR copy ()
+ {
+ return new JMSEpr(this);
+ }
+
public String toString ()
{
return "JMSEpr [ "+super.getAddr().extendedToString()+" ]";
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/LogicalEPR.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/LogicalEPR.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/LogicalEPR.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -133,6 +133,11 @@
}
}
+ public EPR copy ()
+ {
+ return new LogicalEPR(this);
+ }
+
public static URI type() {
return _type;
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -50,6 +50,9 @@
public SFTPEpr(EPR epr)
{
super(epr);
+
+ if (epr instanceof SFTPEpr)
+ certificateSet = ((SFTPEpr) epr).certificateSet;
}
public SFTPEpr (EPR epr, Element header)
@@ -68,7 +71,10 @@
if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
{
if ((tag != null) && (tag.equals(CERTIFICATE_TAG)))
+ {
getAddr().addExtension(CERTIFICATE_TAG, nl.item(i).getTextContent());
+ certificateSet = true;
+ }
}
}
catch (Exception ex)
@@ -135,6 +141,11 @@
return null;
}
+ public EPR copy ()
+ {
+ return new SFTPEpr(this);
+ }
+
public String toString ()
{
return "SFTPEpr [ "+super.getAddr().extendedToString()+" ]";
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -24,19 +24,17 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.io.FileReader;
import java.io.IOException;
import java.util.Hashtable;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
-import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
import org.jboss.soa.esb.addressing.EPR;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
/**
* Allows EPRs to be saved to and loaded from files. Mainly for testing
@@ -193,32 +191,28 @@
{
if (theFile.exists())
{
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
-
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.parse(theFile);
- Element rootElement = doc.getDocumentElement();
+ final FileReader reader = new FileReader(theFile) ;
+ try
+ {
+ final XMLStreamReader in = XMLHelper.getXMLStreamReader(reader) ;
+ StreamHelper.skipToNextStartElement(in) ;
- return EPRHelper.fromXML(rootElement);
+ return EPRHelper.fromXML(in);
+ }
+ finally
+ {
+ reader.close() ;
+ }
}
else
throw new FileNotFoundException(theFile.toString());
}
- catch (UnmarshalException ex)
+ catch (XMLStreamException xmlse)
{
- throw new IOException(ex.toString());
+ final IOException ioe = new IOException("Failed to parse EPR file: " + theFile.getAbsolutePath()) ;
+ ioe.initCause(xmlse) ;
+ throw ioe ;
}
- catch (SAXException ex)
- {
- throw new IOException(ex.toString());
- }
- catch (ParserConfigurationException ex)
- {
- throw new IllegalArgumentException(ex.toString());
- }
}
protected EPRManager(String domain)
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/MessageMulticaster.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/MessageMulticaster.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/MessageMulticaster.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -19,13 +19,14 @@
*/
package org.jboss.soa.esb.client;
-import org.jboss.soa.esb.message.Message;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.actions.AggregationDetails;
import org.jboss.soa.esb.actions.Aggregator;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.apache.log4j.Logger;
import java.util.*;
@@ -48,8 +49,24 @@
private static Logger logger = Logger.getLogger(MessageMulticaster.class);
private Map<Service, ServiceInvoker> invokers = new LinkedHashMap<Service, ServiceInvoker>();
+ private String splitId;
/**
+ * Public default constructor.
+ */
+ public MessageMulticaster() {
+ }
+
+ /**
+ * Public default constructor.
+ * @param splitId Split ID for this multicaster.
+ */
+ public MessageMulticaster(String splitId) {
+ AssertArgument.isNotNullAndNotEmpty(splitId, "splitId");
+ this.splitId = splitId;
+ }
+
+ /**
* Add a message recipient Service.
* @param service Recipient service for receipt of messages from this miltcaster instance.
* @throws RegistryException Failed to lookup Service endpoint.
@@ -102,26 +119,23 @@
* @throws MessageDeliverException Failed to deliver message to endpoint.
*/
public void sendToSubset(Message message, List<Service> recipients) throws RegistryException, MessageDeliverException {
- if (recipients.isEmpty())
- logger.warn("MessageMulticaster.sendToSubset: empty recipients list!");
- else
- {
- String uuId = UUID.randomUUID().toString();
- ArrayList<String> aggregatorTags = new ArrayList<String>();
+ if (recipients.isEmpty()) {
+ logger.warn("MessageMulticaster.sendToSubset: empty recipients list!");
+ } else{
+ String seriesUUID = UUID.randomUUID().toString();
+ long seriesTimestamp = System.currentTimeMillis();
int recipientCount = recipients.size();
- long timestamp = System.currentTimeMillis();
-
+
for(int i = 0; i < recipientCount; i++) {
Service recipient = recipients.get(i);
ServiceInvoker invoker = getInvoker(recipient);
- String tag = uuId + ":" + (i + 1) + ":" + recipientCount + ":" + timestamp;
-
- aggregatorTags.add(tag);
- message.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
- if (logger.isDebugEnabled()) {
- logger.debug(Aggregator. AGGEGRATOR_TAG + "=" + tag);
+
+ if(recipientCount > 1) {
+ // Only add aggregation info if we're splitting the message i.e. sending it to
+ // more than 1 recipient...
+ addAggregationDetails(message, seriesUUID, recipientCount, seriesTimestamp, i + 1);
}
-
+
if(invoker == null) {
logger.error("Service '" + recipient + "' is not in recipient list. Delivering message to Dead Letter Channel.");
ServiceInvoker.deliverToDeadLetterService(message);
@@ -134,10 +148,33 @@
}
}
}
- }
+ }
}
- private org.jboss.soa.esb.client.ServiceInvoker getInvoker(Service recipient) throws RegistryException, MessageDeliverException {
+ private void addAggregationDetails(Message message, String uuId, int recipientCount, long seriesTimestamp, int messageIndex) {
+ AggregationDetails aggrDetails = new AggregationDetails(uuId, messageIndex, recipientCount, seriesTimestamp);
+ ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
+
+ // This is useful during aggregation - as a way of id'ing where the split occurred.
+ aggrDetails.setSplitId(splitId);
+
+ if(aggregatorTags == null) {
+ aggregatorTags = new ArrayList<String>();
+ message.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
+ }
+
+ if(messageIndex > 1) {
+ // remove the tag string for the last recipient...
+ aggregatorTags.remove(aggregatorTags.size() - 1);
+ }
+ aggregatorTags.add(aggrDetails.toString());
+
+ if (logger.isDebugEnabled()) {
+ logger.debug(Aggregator. AGGEGRATOR_TAG + "=" + aggrDetails);
+ }
+ }
+
+ private ServiceInvoker getInvoker(Service recipient) throws RegistryException, MessageDeliverException {
ServiceInvoker invoker = invokers.get(recipient);
// We lazilly create the invokers...
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -33,6 +33,8 @@
import org.jboss.soa.esb.addressing.PortReference;
import org.jboss.soa.esb.addressing.util.DefaultReplyTo;
import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import org.jboss.soa.esb.couriers.Courier;
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.couriers.CourierFactory;
@@ -57,6 +59,13 @@
* Manages loading of {@link EPR EPRs}, {@link Courier} selection and
* message delivery. Provides a unified/simplified interface for message
* delivery.
+ *
+ * The ServiceInvoker will cache entries from the registry for the relevant
+ * service. This cache will be refreshed under the following conditions:
+ *
+ * (i) all of the entries fail on a delivery attempt.
+ * (ii) the cache times out (see property org.jboss.soa.esb.registry.cache.life): default is
+ * 60 seconds.
*
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
*/
@@ -67,6 +76,12 @@
public static final String DELIVER_TO = "org.jboss.soa.esb.deliver.to";
/**
+ * Remove (suspected) dead EPRs.
+ */
+
+ private static boolean removeDeadEprs;
+
+ /**
* Class logger.
*/
private static Logger logger = Logger.getLogger(ServiceInvoker.class);
@@ -255,6 +270,7 @@
*/
private Message post(Message message, EPRInvoker eprInvoker) throws MessageDeliverException, FaultMessageException {
boolean staleEPRCache = true;
+ boolean initialPass = true;
//We are removing dead EPRs from the serviceClusterInfo. *Previous* deliveries maybe have
//removed EPRs that have now come back to life. We should try once more to pull a fresh list of EPRS
//from the registry before we give up (and fail-over to redelivery at a later time in the care
@@ -265,7 +281,22 @@
while (staleEPRCache) {
if ((serviceClusterInfo.getEPRs().size() == 0) || (new Date().after(expirationDate))) {
loadServiceClusterInfo();
- staleEPRCache=false;
+
+ if (initialPass && (serviceClusterInfo.getEPRs().size() == 0)) // zero from a previoud send
+ {
+ /*
+ * We need to check to see if this instance used up all of it's attempts to deliver
+ * in a previous deliver or we'll only refresh the cache once per subsequent send
+ * because we will have exhausted the EPRs in the cache, i.e., size==0.
+ *
+ * When the instance is originally created we do an initial cache fetch. Until this
+ * check, that cache fetch was not being done again after a complete failure. Unlikely
+ * to cause problems anyway, but possible.
+ */
+ initialPass = false;
+ }
+ else
+ staleEPRCache = false;
}
Message replyMessage;
EPR epr;
@@ -281,6 +312,14 @@
logger.info("Unresponsive EPR: " + epr+" for message: "+message.getHeader());
serviceClusterInfo.removeDeadEPR(epr);
+
+ /*
+ * So far we've only removed the EPR from the cache. Should we
+ * also remove it from the registry?
+ */
+
+ if (removeDeadEprs)
+ RegistryUtil.unregister(service.getCategory(), service.getName(), epr);
}
}
catch (MalformedEPRException ex) // so we can differentiate failure modes, since returning null is limiting
@@ -288,6 +327,10 @@
logger.info("Invalid EPR for service (probably ESB-unaware): ignoring for message: "+message.getHeader());
serviceClusterInfo.removeDeadEPR(epr);
+
+ /*
+ * DO NOT remove from the registry - it is not dead!!
+ */
}
}
}
@@ -477,7 +520,6 @@
} catch (FaultMessageException e) {
throw e;
} catch (CourierException e) {
- logger.error("CourierException caught :", e);
logger.debug("Badly formed EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"]. " + e.getMessage());
} catch (MalformedEPRException e) {
// Hmmmm???... Can this really happen? The Courier has already been created. Haven't we already validated the EPR during the Courier lookup (above)??
@@ -500,4 +542,18 @@
return null;
}
}
+
+ static
+ {
+ String pruneDead = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.REMOVE_DEAD_EPR, "false");
+
+ if ("true".equalsIgnoreCase(pruneDead))
+ {
+ removeDeadEprs = true;
+ }
+ else
+ {
+ removeDeadEprs = false;
+ }
+ }
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -50,7 +50,7 @@
public static final String JMS_SESSION_SLEEP = "org.jboss.soa.esb.jms.sessionSleep";
/*
- * Code properties
+ * Core properties
*/
public static final String JNDI_SERVER_URL = "org.jboss.soa.esb.jndi.server.url";
public static final String JNDI_SERVER_CONTEXT_FACTORY = "org.jboss.soa.esb.jndi.server.context.factory";
@@ -61,6 +61,7 @@
public static final String LOAD_BALANCER_POLICY = "org.jboss.soa.esb.loadbalancer.policy";
public static final String REDELIVER_DLS_SERVICE_ON = "org.jboss.soa.esb.dls.redeliver";
public static final String REGISTRY_CACHE_LIFE_MILLIES = "org.jboss.soa.esb.registry.cache.life";
+ public static final String REMOVE_DEAD_EPR = "org.jboss.soa.esb.failure.detect.removeDeadEPR";
/**
* The Registry Query Manager URI defines the endPoint where registry queries can be made.
*/
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/JBossESBPropertyService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/JBossESBPropertyService.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/JBossESBPropertyService.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -27,6 +27,8 @@
import java.net.URL;
import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import org.apache.log4j.Logger;
@@ -207,5 +209,98 @@
throw new TransactionStrategyException("Failed to mark the transaction on current thread for rollback", th) ;
}
}
+
+ /**
+ * Get a handle on the currently associated transaction (or null).
+ * @throws TransactionStrategyException
+ */
+
+ public Object getTransaction () throws TransactionStrategyException
+ {
+ try
+ {
+ return tm.getTransaction();
+ }
+ catch (final Throwable th)
+ {
+ throw new TransactionStrategyException("Problem when trying to getTransaction: ",th);
+ }
+ }
+
+ /**
+ * Suspend the current thread-to-transaction association.
+ *
+ * @return the associated transaction, or null.
+ * @throws TransactionStrategyException
+ */
+ public Object suspend () throws TransactionStrategyException
+ {
+ try
+ {
+ return tm.suspend();
+ }
+ catch (final Throwable th)
+ {
+ throw new TransactionStrategyException("Problem when trying to suspend transaction: ",th);
+ }
+ }
+
+ /**
+ * Associated the transaction with the current thread.
+ * @param tx
+ * @throws TransactionStrategyException
+ */
+ public void resume (Object tx) throws TransactionStrategyException
+ {
+ try
+ {
+ tm.resume((Transaction) tx);
+ }
+ catch (final Throwable th)
+ {
+ throw new TransactionStrategyException("Problem when trying to resume transaction: ",th);
+ }
+ }
+
+ /**
+ * 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
+ */
+ public boolean isActive () throws TransactionStrategyException
+ {
+ try
+ {
+ if (tm.getStatus() == Status.STATUS_ACTIVE)
+ return true;
+ else
+ return false;
+ }
+ catch (final Throwable th)
+ {
+ throw new TransactionStrategyException("Problem when trying to get transaction status: ",th);
+ }
+ }
+
+ public String toString ()
+ {
+ return "JTATransactionStrategy";
+ }
}
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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
@@ -91,6 +93,59 @@
throws TransactionStrategyException ;
/**
+ * Get a handle on the currently associated transaction (or null).
+ * @throws TransactionStrategyException
+ */
+
+ public abstract Object getTransaction () throws TransactionStrategyException;
+
+ /**
+ * Suspend the current thread-to-transaction association.
+ *
+ * @return the associated transaction, or null.
+ * @throws TransactionStrategyException
+ */
+ public abstract Object suspend () throws TransactionStrategyException;
+
+ /**
+ * Is the currently associated transaction active?
+ * @return
+ * @throws TransactionStrategyException
+ */
+ public abstract boolean isActive () throws TransactionStrategyException;
+
+ /**
+ * Associated the transaction with the current thread.
+ * @param tx
+ * @throws TransactionStrategyException
+ */
+ 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);
+ }
+
+ public static TransactionStrategy getStrategy ()
+ {
+ return _currentStrategy.get();
+ }
+
+ public static void removeStrategy ()
+ {
+ _currentStrategy.remove();
+ }
+
+ private final static ThreadLocal<TransactionStrategy> _currentStrategy = new ThreadLocal<TransactionStrategy>();
+
+ /**
* The null transaction strategy.
* @author kevin
*/
@@ -124,5 +179,59 @@
throws TransactionStrategyException
{
}
+
+ /**
+ * Get a handle on the currently associated transaction (or null).
+ * @throws TransactionStrategyException
+ */
+
+ public Object getTransaction () throws TransactionStrategyException
+ {
+ return null;
+ }
+
+ /**
+ * Suspend the current thread-to-transaction association.
+ *
+ * @return the associated transaction, or null.
+ * @throws TransactionStrategyException
+ */
+ public Object suspend () throws TransactionStrategyException
+ {
+ return null;
+ }
+
+ /**
+ * Associated the transaction with the current thread.
+ * @param tx
+ * @throws TransactionStrategyException
+ */
+ public void resume (Object tx) throws TransactionStrategyException
+ {
+ }
+
+ /**
+ * 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
+ */
+ public boolean isActive () throws TransactionStrategyException
+ {
+ return false;
+ }
+
+ public String toString ()
+ {
+ return "NullTransactionStrategy";
+ }
}
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -38,6 +38,8 @@
private DataSource m_oDS = null;
private Connection m_conn = null;
+
+ private boolean transactional = false;
protected List<PreparedStatement> m_olPrepSt = new ArrayList<PreparedStatement>();
@@ -45,21 +47,29 @@
public JdbcCleanConn(DataSource p_oDS)
{
+ this(p_oDS, false);
+ }
+
+ public JdbcCleanConn(DataSource p_oDS, boolean transactional)
+ {
m_oDS = p_oDS;
m_oLogger = Logger.getLogger(this.getClass());
+ this.transactional = transactional;
}
public void commit() throws SQLException
{
- if (null != m_conn)
+ if ((null != m_conn) && (!transactional))
{
m_conn.commit();
}
+ else
+ throw new SQLException("Connection is null!");
}
public void rollback() throws SQLException
{
- if (null != m_conn)
+ if ((null != m_conn) && (!transactional))
{
m_conn.rollback();
} else {
@@ -73,7 +83,7 @@
public void release()
{
- if (null != m_conn)
+ if ((null != m_conn) && (!transactional))
{
try
{
@@ -99,6 +109,9 @@
{
}
}
+ else
+ m_oLogger.debug("Connection is null.");
+
m_olPrepSt.clear();
m_conn = null;
} // __________________________________
@@ -109,6 +122,9 @@
if (null == m_conn)
{
connect();
+
+ if (m_conn == null)
+ throw new SQLException("Connection is null!");
}
PreparedStatement PS = m_conn.prepareStatement(p_sSt, p_i1, p_i2);
m_olPrepSt.add(PS);
@@ -120,6 +136,9 @@
if (null == m_conn)
{
connect();
+
+ if (m_conn == null)
+ throw new SQLException("Connection is null!");
}
PreparedStatement PS = m_conn.prepareStatement(p_sSt);
@@ -133,8 +152,14 @@
if (null == m_conn)
{
connect();
+
+ if (m_conn == null)
+ throw new SQLException("Connection is null!");
}
+ if (p_PS == null)
+ throw new SQLException("Null PreparedStatement!");
+
SQLException eRet = null;
int iQtry = (p_iQtry < 1) ? 1 : (p_iQtry < 50) ? p_iQtry : 50;
for (int i1 = 0; i1 < iQtry; i1++)
@@ -170,8 +195,14 @@
if (null == m_conn)
{
connect();
+
+ if (m_conn == null)
+ throw new SQLException("Connection is null!");
}
+ if (p_PS == null)
+ throw new SQLException("Null PreparedStatement!");
+
SQLException eRet = null;
int iQtry = (p_iQtry < 1) ? 1 : (p_iQtry < 50) ? p_iQtry : 50;
for (int i1 = 0; i1 < iQtry; i1++)
@@ -211,6 +242,9 @@
return;
}
+ if (m_oDS == null)
+ throw new SQLException("DataSource is null!");
+
SQLException eRet = null;
for (int i1 = 0; i1 < 5; i1++)
{
@@ -250,8 +284,11 @@
throw new RuntimeException("connect() FAILED: no connection");
}
- m_conn.setAutoCommit(false);
- m_conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
+ if (!transactional)
+ {
+ m_conn.setAutoCommit(false);
+ m_conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
+ }
m_olPrepSt.clear();
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -47,6 +47,7 @@
public static final String SERVICE_NAME_TAG = "service-name";
public static final String SERVICE_DESCRIPTION_TAG = "service-description";
public static final String EPR_DESCRIPTION_TAG = "epr-description";
+ public static final String REMOVE_OLD_SERVICE = "remove-old-service";
/** Gateways */
public static final String TARGET_SERVICE_CATEGORY_TAG = "target-service-category";
@@ -57,6 +58,7 @@
/** Listeners */
public static final String LISTENER_CLASS_TAG = "listenerClass";
public static final String TRANSACTED_TAG = "transacted";
+ public static final String ROLLBACK_ON_PIPELINE_FAULTS = "rollbackOnPipelineFaults";
/** Deployment */
public static final String DEPLOYMENT_NAME_TAG = "deployment";
@@ -122,6 +124,7 @@
public static final String SQL_WHERE_CONDITION_TAG = "whereCondition";
public static final String SQL_ORDER_BY_TAG = "orderBy";
public static final String SQL_POST_DEL_TAG = "postDelete";
+ public static final String SQL_TIMESTAMP_TAG = "insert-timestamp-column";
/** Reply Listener */
public static final String REPLY_LISTENER_TIMEOUT_TAG = "replyListenerTimeout";
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -144,7 +144,8 @@
Boolean.valueOf(tree.getAttribute(JMSEpr.PERSISTENT_TAG)),
tree.getAttribute(JMSEpr.ACKNOWLEDGE_MODE_TAG),
username,
- password);
+ password,
+ Boolean.valueOf(tree.getAttribute(JMSEpr.TRANSACTED_TAG)));
return epr;
}
catch (Exception e)
@@ -274,9 +275,18 @@
boolean bErrorDel = Boolean.valueOf(tree.getAttribute(
JDBCEpr.ERROR_DEL_TAG, "true"));
JDBCEpr epr = new JDBCEpr(url, bPostDel, bErrorDel);
- epr.setDriver(tree.getRequiredAttribute(JDBCEpr.DRIVER_TAG));
- epr.setUserName(getAttrAndWarn(tree, JDBCEpr.USERNAME_TAG, ""));
- epr.setPassword(getAttrAndWarn(tree, JDBCEpr.PASSWORD_TAG, ""));
+
+ String datasource = tree.getAttribute(JDBCEpr.DATASOURCE_TAG);
+
+ if (datasource == null)
+ {
+ epr.setDriver(tree.getRequiredAttribute(JDBCEpr.DRIVER_TAG));
+ epr.setUserName(getAttrAndWarn(tree, JDBCEpr.USERNAME_TAG, ""));
+ epr.setPassword(getAttrAndWarn(tree, JDBCEpr.PASSWORD_TAG, ""));
+ }
+ else
+ epr.setDatasource(datasource);
+
epr.setTableName(tree.getRequiredAttribute(JDBCEpr.TABLE_NAME_TAG));
epr.setMessageIdColumn(getColName(tree, JDBCEpr.MESSAGE_ID_COLUMN_TAG));
epr.setStatusColumn(getColName(tree, JDBCEpr.STATUS_COLUMN_TAG));
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -117,7 +117,8 @@
{
final String category = config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG) ;
final String name = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG) ;
-
+ final String removeOldService = config.getAttribute(ListenerTagNames.REMOVE_OLD_SERVICE);
+
if ("eprManager".equalsIgnoreCase(category))
{
register(name, epr) ;
@@ -136,9 +137,18 @@
registryLock.lock();
try
{
+ if ("true".equalsIgnoreCase(removeOldService))
+ registry.unRegisterService(category, name);
+
registry.registerEPR(category, name,
serviceDescription, epr, eprDescription) ;
}
+ catch (ServiceNotFoundException ex)
+ {
+ // ignore as it's possible another client just did the removal for us.
+
+ logger.debug("Could not unregister service < "+category+", "+name+" >.");
+ }
finally
{
registryLock.unlock() ;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -154,6 +154,7 @@
toElement.setAttribute(JMSEpr.ACKNOWLEDGE_MODE_TAG, messageFilter.getAcknowledgeMode());
toElement.setAttribute(JMSEpr.JMS_SECURITY_PRINCIPAL_TAG, messageFilter.getJmsSecurityPrincipal());
toElement.setAttribute(JMSEpr.JMS_SECURITY_CREDENTIAL_TAG, messageFilter.getJmsSecurityCredential());
+ toElement.setAttribute(JMSEpr.TRANSACTED_TAG, Boolean.toString( messageFilter.getTransacted()));
}
/*
@@ -206,6 +207,10 @@
final Element activationConfigElement = YADOMUtil.addElement(listenerNode, JcaConstants.ELEMENT_ACTIVATION_CONFIG) ;
addPropertyElement(activationConfigElement, "destination", messageFilter.getDestName()) ;
+ if (jmsJcaProvider.isSetProviderAdapterJNDI())
+ {
+ addPropertyElement(activationConfigElement, "providerAdapterJNDI", jmsJcaProvider.getProviderAdapterJNDI()) ;
+ }
final int destType = messageFilter.getDestType().intValue() ;
if (destType == DestType.INT_QUEUE)
{
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -65,10 +65,9 @@
}
if (provider.getDatasource() != null) {
- if ((provider.getUrl() != null)
- || (provider.getUsername() != null)
+ if ((provider.getUsername() != null)
|| (provider.getDriver() != null)) {
- throw new ConfigurationException ("Invalid sql-provider configuration : a datasource and a URL/username/password/driver "
+ throw new ConfigurationException ("Invalid sql-provider configuration : a datasource and a username/password/driver "
+ "combination cannot both be defined. Use only one (datasource or JDBC connection info)."
+ "Datasource : [" + provider.getDatasource() + "] JDBC URL [" + provider.getUrl() + "]");
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetter.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetter.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetter.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -34,6 +34,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.addressing.eprs.JMSEpr;
import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.message.Properties;
import org.jboss.soa.esb.notification.jms.JMSPropertiesSetter;
/**
@@ -45,6 +46,7 @@
* <li> JMSCorrelationID -> Call.setRelatesTo URI = jms:correlationID#YYXX-123456780-GG
* <li> JMSReplyTo -> Call.setReplyTo
* <li> JMSExpiration -> Properties( key = JMSPropertiesSetter.JMS_EXPIRATION )
+ * <li> JMSRedeliverd -> Properties( key = JMSPropertiesSetter.JMS_REDELIVERED
* </lu>
* Note: JMSCorrelationID is set as a fragment on the URI and can be retrieved like this:
* correlationURI.getFragment();
@@ -123,6 +125,7 @@
{
@SuppressWarnings("unchecked")
Enumeration<String> properties = fromJMSMessage.getPropertyNames();
+ Properties esbProperties = toESBMessage.getProperties();
if (null != properties)
{
while (properties.hasMoreElements())
@@ -130,9 +133,11 @@
String key = properties.nextElement();
Object value = fromJMSMessage.getObjectProperty(key);
if (null != value)
- toESBMessage.getProperties().setProperty(key, value);
+ esbProperties.setProperty(key, value);
}
}
+ final boolean redelivered = fromJMSMessage.getJMSRedelivered();
+ esbProperties.setProperty( JMSPropertiesSetter.JMS_REDELIVERED, Boolean.valueOf( redelivered ));
}
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -151,8 +151,12 @@
if (null != msgIn) {
try {
- Object obj = _processMethod.invoke(_composer, new Object[]
- {msgIn});
+ Object obj = _processMethod.invoke(_composer, new Object[] {msgIn});
+ // commit and acknowledge the reception of the message
+ // this is done after extracting the content of the JMS Message.
+ if ( jmsSession != null && jmsSession.getTransacted() )
+ jmsSession.commit();
+
if (null == obj) {
_logger.warn("Action class method <"
+ _processMethod.getName()
@@ -195,6 +199,8 @@
_logger.error("Action class method <"
+ _processMethod.getName()
+ "> returned a non Message object", e);
+
+ rollbackJMSTransaction();
continue;
}
catch (CourierException e) {
@@ -203,6 +209,7 @@
+ ".deliverAsync(Message) FAILED"
: "NULL courier can't deliverAsync Message";
_logger.error(text, e);
+ rollbackJMSTransaction();
continue;
}
continue;
@@ -210,13 +217,16 @@
catch (InvocationTargetException e) {
_logger.error("Problems invoking method <"
+ _processMethod.getName() + ">", e);
+ rollbackJMSTransaction();
}
catch (IllegalAccessException e) {
_logger.error("Problems invoking method <"
+ _processMethod.getName() + ">", e);
+ rollbackJMSTransaction();
}
catch (Exception e) {
_logger.error("Unexpected problem", e);
+ rollbackJMSTransaction();
}
}
}
@@ -233,13 +243,32 @@
protected void doThreadedDestroy() throws ManagedLifecycleException {
cleanup();
}
+
+ private void rollbackJMSTransaction()
+ {
+ try
+ {
+ if ( jmsSession != null && jmsSession.getTransacted() )
+ jmsSession.rollback();
+ } catch (JMSException e) {
+ final String errorMsg = "JMSException during jmsSession.rollback()";
+ _logger.error( errorMsg, e );
+ }
+ }
+
private void cleanup() {
try {
if (_serviceName != null) {
RegistryUtil.unregister(_serviceCategory, _serviceName, _myEpr);
}
- } finally {
+ if ( jmsSession != null && jmsSession.getTransacted() )
+ jmsSession.rollback();
+ }
+ catch (JMSException e)
+ {
+ e.printStackTrace();
+ } finally {
try {
if (jmsMessageConsumer != null) {
try {
@@ -364,6 +393,7 @@
String destType = _config.getAttribute(JMSEpr.DESTINATION_TYPE_TAG);
boolean persistent = Boolean.valueOf( _config.getAttribute(JMSEpr.PERSISTENT_TAG));
+ boolean transacted = Boolean.valueOf( _config.getAttribute(JMSEpr.TRANSACTED_TAG));
String acknowledgeMode = _config.getAttribute(JMSEpr.ACKNOWLEDGE_MODE_TAG);
@@ -374,11 +404,12 @@
environment.put( JMSEpr.JMS_SECURITY_PRINCIPAL_TAG, username );
environment.put( JMSEpr.JMS_SECURITY_CREDENTIAL_TAG, password );
}
+ _logger.debug( "JMSGateway isTransacted = " + transacted );
_myEpr = (null == _serviceName) ? null : new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, destType,
jmsDestinationName, sFactClass, environment, _messageSelector, persistent, acknowledgeMode,
- username, password);
- jmsConnectionPool = JmsConnectionPoolContainer.getPool(environment, sFactClass, destType,username, password);
+ username, password, transacted );
+ jmsConnectionPool = JmsConnectionPoolContainer.getPool(environment, sFactClass, destType,username, password, transacted);
try {
jmsSession = _myEpr != null ? jmsConnectionPool.getSession(((JMSEpr)_myEpr).getAcknowledgeMode()):
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -33,6 +33,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -84,10 +85,13 @@
* <p/> The following fields are mandatory (see checkMyParms()): <br/> <br/>SQL
* table name <br/>list of fields to retrieve <br/>list of key fields to use in
* the update statement <br/>a field that will be used to mark a row as
- * 'pending(p)', 'in process(w)', 'done(d)' or 'in error(e)'
+ * 'P' (pending), 'W' (in process), 'D' (done) or 'E' (error). When adding
+ * a pending row, make sure that the status_col value if an upper-cased 'P', as
+ * upper-cased characters are used as a convention.
*
* @author <a
* href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
* @since Version 4.0
*/
public class SqlTableGatewayListener extends AbstractThreadedManagedLifecycle {
@@ -348,7 +352,11 @@
if (Util.isNullString(_inProcessField))
throw new ConfigurationException(
"A valid inProcessField attribute must be specified");
-
+ _timestamp = ListenerUtil.getValue(_config,
+ JDBCEpr.TIMESTAMP_COLUMN_TAG, "");
+ if (_timestamp.trim().length() < 1)
+ _logger.debug("No value specified for: "
+ + ListenerTagNames.SQL_TIMESTAMP_TAG);
_where = ListenerUtil.getValue(_config,
ListenerTagNames.SQL_WHERE_CONDITION_TAG, "");
if (_where.trim().length() < 1)
@@ -477,8 +485,11 @@
protected List<Map<String, Object>> pollForCandidates() {
List<Map<String, Object>> oResults = new ArrayList<Map<String, Object>>();
final JdbcCleanConn oConn = getDbConn();
+
+ ResultSet RS = null;
+
try {
- ResultSet RS = oConn.execQueryWait(_PSscan, 1);
+ RS = oConn.execQueryWait(_PSscan, 1);
ResultSetMetaData meta = RS.getMetaData();
while (RS.next()) {
Map<String, Object> row = new HashMap<String, Object>();
@@ -496,6 +507,9 @@
}
finally {
try {
+ if (RS != null)
+ RS.close();
+
oConn.rollback();
} catch (final SQLException sqle) {
refreshDatasource();
@@ -533,9 +547,16 @@
initContext = new InitialContext();
oDS = (DataSource) initContext.lookup(_datasource);
} catch (NamingException e) {
- _logger.error("", e);
+ _logger.error("SqlTableGatewayListener.getDbConn failed to lookup datasource.", e);
}
}
+
+ /*
+ * Create JdbcCleanConn even if oDS is null because that will
+ * manage the error handling for us by throwing SQLExceptions
+ * at the appropriate time.
+ */
+
_dbConn = new JdbcCleanConn(oDS);
}
@@ -543,7 +564,7 @@
try {
prepareStatements();
} catch (SQLException e) {
- _logger.debug("Exception preparing statements", e);
+ _logger.warn("Exception preparing statements", e);
}
}
@@ -584,8 +605,11 @@
*/
protected String updateStatement() {
StringBuilder sb = new StringBuilder().append("update ").append(
- _tableName).append(" set ").append(_inProcessField).append(
- " = ? where ").append(_inProcessField).append(" = ?");
+ _tableName).append(" set ").append(_inProcessField).append(" = ? ");
+ if (_timestamp.trim().length() < 1) {
+ sb.append(", " + _timestamp + " = ? ");
+ }
+ sb.append("where ").append(_inProcessField).append(" = ?");
for (String sCurr : _keys) {
sb.append(" and ").append(sCurr).append(" = ?");
}
@@ -651,7 +675,12 @@
try {
int iParm = 1;
for (String sColName : _keys) {
- final String val = String.valueOf(_currentRow.get(sColName));
+ String val = null;
+ if (_currentRow.containsKey(sColName)) {
+ val = String.valueOf(_currentRow.get(sColName));
+ } else {
+ val = String.valueOf(_upperCurrentRow.get(sColName));
+ }
_PSdeleteRow.setString(iParm++, val);
}
@@ -705,26 +734,44 @@
try {
int iParm = 3;
+ if (_timestamp.trim().length() < 1) {
+ iParm++;
+ }
List<String> tempKeys = new ArrayList<String>();
for (String key : _currentRow.keySet()) {
tempKeys.add(key);
}
+ if (_upperCurrentRow != null) {
+ _upperCurrentRow.clear();
+ } else {
+ _upperCurrentRow = new HashMap<String, Object>();
+ }
+
for (String key : tempKeys) {
Object value = _currentRow.get(key);
- if (!_currentRow.containsKey(key.toUpperCase())) {
- _currentRow.put(key.toUpperCase(), value);
- }
+ _upperCurrentRow.put(key.toUpperCase(), value);
}
for (String sColName : _keys) {
- Object oVal = String.valueOf(_currentRow.get(sColName.toUpperCase()));
+ Object oVal = null;
+ if (_currentRow.containsKey(sColName)) {
+ oVal = String.valueOf(_currentRow.get(sColName.toUpperCase()));
+ } else {
+ oVal = String.valueOf(_upperCurrentRow.get(sColName.toUpperCase()));
+ }
+
_PSupdate.setObject(iParm++, oVal);
}
try {
- _PSupdate.setString(1, getStatus(toState));
- _PSupdate.setString(2, getStatus(fromState));
+ int counter = 1;
+ _PSupdate.setString(counter++, getStatus(toState));
+ if (_timestamp.trim().length() < 1) {
+ Date now = new Date();
+ _PSupdate.setString(counter++, now.toString());
+ }
+ _PSupdate.setString(counter++, getStatus(fromState));
final int count = getDbConn().execUpdWait(_PSupdate, 5);
if (count == 1) {
getDbConn().commit();
@@ -828,7 +875,7 @@
protected String _driver, _url, _user, _password, _datasource;
- protected String _tableName, _selectFields, _keyFields;
+ protected String _tableName, _selectFields, _keyFields, _timestamp;
protected String _where, _orderBy;
@@ -842,7 +889,7 @@
protected JdbcCleanConn _dbConn;
- protected Map<String, Object> _currentRow;
+ protected Map<String, Object> _currentRow, _upperCurrentRow;
public static enum ROW_STATE {
Pending, Working, Error, Done
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -32,6 +32,8 @@
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.couriers.CourierFactory;
import org.jboss.soa.esb.couriers.CourierTimeoutException;
@@ -85,6 +87,10 @@
* The error delay.
*/
private long errorDelay ;
+
+ private TransactionStrategy transactionStrategy;
+ private boolean transactional = false;
+ private boolean rollbackOnPipelineFaults = true;
/**
* public constructor
@@ -156,6 +162,11 @@
}
}
_latencySecs = lSeconds ;
+
+ transactional = _config.getBooleanAttribute(ListenerTagNames.TRANSACTED_TAG, false) ;
+ transactionStrategy = TransactionStrategy.getTransactionStrategy(transactional) ;
+
+ rollbackOnPipelineFaults = _config.getBooleanAttribute(ListenerTagNames.ROLLBACK_ON_PIPELINE_FAULTS, true);
}
/**
@@ -261,17 +272,53 @@
}
}
+ /**
+ * We have JMS transactional delivery/work semantics: before pulling a unit of work
+ * we start a transaction. If the pipeline completes successfully then we will
+ * commit that transaction and the OUW will be deleted. If we have to roll back
+ * the transaction then the UOW will be placed back on the input "queue" (assumes that
+ * the courier is transactional).
+ *
+ * @param maxWaitMillis
+ */
public void waitForEventAndProcess (long maxWaitMillis)
{
Message message = null ;
+ boolean problem = false;
+
try
{
+ transactionStrategy.begin();
+
+ /*
+ * If this is a transactional receive then the courier
+ * needs to be reset afterwards, because we can only
+ * guarantee one instance per transaction. If the courier
+ * instance does some handy multiplexing internally across different
+ * transactions then we won't be able to handle that at this level.
+ * However, at the moment that isn't an issue.
+ */
+
+ TransactionStrategy.setStrategy(transactionStrategy);
+
message = (maxWaitMillis > 0) ? _pickUpCourier
.pickup(maxWaitMillis) : null;
errorDelay = 0 ;
}
+ catch (TransactionStrategyException ex)
+ {
+ // could not begin transaction!
+
+ _logger.error("Could not begin transaction!");
+
+ problem = true;
+
+ return;
+ }
catch (CourierTimeoutException e)
{
+ problem = true;
+
return;
}
catch (FaultMessageException fme)
@@ -280,35 +327,79 @@
}
catch (CourierException e)
{
- _logger.debug("Courier Exception", e);
- if (errorDelay == 0)
- {
- errorDelay = MIN_ERROR_DELAY ;
- }
- else if (errorDelay < MAX_ERROR_DELAY)
- {
- errorDelay <<= 1 ;
- }
- _logger.warn("Error processing courier, backing off for " + errorDelay + " milliseconds") ;
- waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, errorDelay) ;
+ _logger.debug("Courier Exception", e);
+ if (errorDelay == 0)
+ {
+ errorDelay = MIN_ERROR_DELAY ;
+ }
+ else if (errorDelay < MAX_ERROR_DELAY)
+ {
+ errorDelay <<= 1 ;
+ }
+ e.printStackTrace();
+ _logger.warn("Error processing courier, backing off for " + errorDelay + " milliseconds") ;
+ waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, errorDelay) ;
+
+ problem = true;
+
return;
}
+ finally
+ {
+ if (problem)
+ {
+ try
+ {
+ if (transactionStrategy.getTransaction() != null)
+ {
+ CourierUtil.cleanCourier(_pickUpCourier);
+
+ resetCourier();
+ }
+ }
+ catch (Throwable ex)
+ {
+ CourierUtil.cleanCourier(_pickUpCourier);
+
+ resetCourier(); // to be on the safe side!
+ }
+
+ rollbackTransaction();
+ }
+
+ TransactionStrategy.removeStrategy();
+ }
if (null != message)
{
- final Message pipelineMessage = message ;
- final Runnable pipelineRunner = new Runnable() {
- public void run() {
- try {
- pipeline.process(pipelineMessage) ;
- } finally {
- updateThreadCount(-1) ;
- }
- }
- } ;
- updateThreadCount(+1);
- _execService.execute(pipelineRunner);
+ try
+ {
+ final Message pipelineMessage = message ;
+ final Object txHandle = transactionStrategy.suspend();
+ final TransactionalRunner txRunner = new TransactionalRunner(_pickUpCourier, pipelineMessage, txHandle);
+
+ updateThreadCount(+1);
+ _execService.execute(txRunner);
+
+ if (transactional)
+ {
+ _pickUpCourier = null; // runner will clean it up.
+
+ resetCourier(); // we need another courier for the next msg.
+ }
+ }
+ catch (TransactionStrategyException ex)
+ {
+ _logger.warn("Caught transaction related exception: ", ex);
+ rollbackTransaction();
+ }
}
+ else
+ {
+ // nothing to do, so roll back the transaction before returning.
+
+ rollbackTransaction();
+ }
} // ________________________________
@@ -392,7 +483,134 @@
}
}
}
+
+ private void rollbackTransaction ()
+ {
+ try
+ {
+ transactionStrategy.rollbackOnly();
+ transactionStrategy.terminate();
+ }
+ catch (Throwable ex)
+ {
+ _logger.warn("Problem while attempting to rollback transaction!"); // timeout should catch it next!
+ }
+ }
+
+ private void resetCourier ()
+ {
+ TwoWayCourier pickUpCourier = null;
+ try
+ {
+ pickUpCourier = CourierFactory.getPickupCourier(_epr) ;
+ try
+ {
+ final Method setPollLatency = pickUpCourier.getClass().getMethod(
+ "setPollLatency", new Class[] { Long.class });
+ setPollLatency.invoke(pickUpCourier, new Long(1000 * _latencySecs));
+ }
+ catch (final NoSuchMethodException nsme)
+ {
+ // OK, just leave it null
+ }
+ catch (final Exception ex)
+ {
+ CourierUtil.cleanCourier(pickUpCourier);
+
+ _logger.error("Problems invoking setPollLatency(long)", ex);
+ }
+ }
+ catch (final MalformedEPRException mepre)
+ {
+ _logger.error("Malformed EPR: " + _epr) ;
+ }
+ catch (final CourierException ce)
+ {
+ _logger.error("No appropriate courier can be obtained for " + _epr, ce);
+ }
+
+ _pickUpCourier = pickUpCourier;
+ }
+
+ class TransactionalRunner implements Runnable
+ {
+ public TransactionalRunner (PickUpOnlyCourier courier, Message pipelineMessage, Object txHandle)
+ {
+ _courier = courier;
+ _pipelineMessage = pipelineMessage;
+ _txHandle = txHandle;
+ }
+
+ public void run()
+ {
+ boolean problem = false;
+
+ try
+ {
+ transactionStrategy.resume(_txHandle);
+
+ pipeline.setTransactional(transactional);
+
+ TransactionStrategy.setStrategy(transactionStrategy);
+
+ /*
+ * Current strategy is to commit as long as process returns true.
+ * If fails, or any exceptions are caught, then we roll back.
+ *
+ * TODO re-examine the semantics around true/false from the pipeline.
+ */
+
+ // TODO consider adding a RollbackOnFalse option to allow override.
+
+ problem = rollbackOnPipelineFaults && !pipeline.process(_pipelineMessage);
+
+ if (!problem)
+ {
+ transactionStrategy.terminate();
+ }
+ }
+ catch (TransactionStrategyException ex)
+ {
+ problem = true;
+
+ _logger.warn("TransactionalRunner caught transaction exception: ", ex);
+ }
+ catch (RuntimeException ex)
+ {
+ problem = true;
+
+ throw ex;
+ }
+ catch (Throwable ex)
+ {
+ problem = true;
+
+ _logger.warn("TransactionalRunner caught throwable: ",ex);
+ }
+ finally
+ {
+ if (problem)
+ {
+ rollbackTransaction();
+ }
+
+ if (transactional)
+ {
+ CourierUtil.cleanCourier(_courier);
+ }
+
+ TransactionStrategy.removeStrategy();
+
+ updateThreadCount(-1);
+ }
+ }
+
+ private PickUpOnlyCourier _courier;
+ private Message _pipelineMessage;
+ private Object _txHandle;
+ };
+
private ConfigTree _config;
private String _eprCategoryName;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -135,14 +135,14 @@
*
* @param content
* the message bytes
- * @deprecated As of 4.2 this has been replaced by add(BytesBody.BYTES_LOCATION, content)
+ * @deprecated As of 4.2 you can use add(BytesBody.BYTES_LOCATION, content)
*/
public void setContents(byte[] content);
/**
* @return the byte content of the body.
- * @deprecated As of 4.2 this has been replaced by get(BytesBody.BYTES_LOCATION)
+ * @deprecated As of 4.2 you can use get(BytesBody.BYTES_LOCATION)
*/
public byte[] getContents();
@@ -153,14 +153,14 @@
*
* @param content
* the message bytes
- * @deprecated As of 4.2 this has been replaced by add(BytesBody.BYTES_LOCATION, content)
+ * @deprecated As of 4.2 you can use add(BytesBody.BYTES_LOCATION, content)
*/
public void setByteArray(byte[] content);
/**
* @return the byte content of the body.
- * @deprecated As of 4.2 this has been replaced by get(BytesBody.BYTES_LOCATION)
+ * @deprecated As of 4.2 you can use get(BytesBody.BYTES_LOCATION)
*/
public byte[] getByteArray();
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/BytesBody.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/BytesBody.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/BytesBody.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -40,7 +40,7 @@
public interface BytesBody extends Body
{
- @Deprecated
+
public static final String BYTES_LOCATION = "org.jboss.soa.esb.message.content.bytes";
public boolean readBoolean() throws IncompatibleModeException, IOException,
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -251,6 +251,7 @@
if (path.length==3) {
object = MVEL.getProperty(path[2], object);
}
+ logger.debug("expression=" + expression + " value=" + object);
return object;
}
/**
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -190,7 +190,14 @@
try {
tmpFile = File.createTempFile(TEMP_FILE_BASE, null);
stream = new FileOutputStream(tmpFile);
- IOUtils.write((byte[]) payloadProxy.getPayload(message), stream);
+
+ Object payload = payloadProxy.getPayload(message);
+
+ if (payload instanceof byte[])
+ IOUtils.write((byte[]) payload, stream);
+ else
+ IOUtils.write(payload.toString(), stream);
+
stream.close();
rfs = RemoteFileSystemFactory.getRemoteFileSystem(getFtpEpr(), true);
rfs.uploadFile(tmpFile, getFileName(message));
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -182,7 +182,7 @@
protected int[] deliveryModes;
/**
- * Priorities for JMS Messages sen by this notifier
+ * Priorities for JMS Messages seen by this notifier
*/
protected int[] priorities;
@@ -234,49 +234,60 @@
*/
public void sendNotification (org.jboss.soa.esb.message.Message esbMessage) throws NotificationException
{
- try
+ try
+ {
+ Message jmsMessage = null;
+ Object obj = payloadProxy.getPayload(esbMessage);
+
+ if (MessageType.JAVA_SERIALIZED.equals(esbMessage.getType()))
{
- Message jmsMessage = null;
- Object obj = payloadProxy.getPayload(esbMessage);
+ if(obj == null) {
+ // create a null payload message...
+ jmsMessage = sessions[0].createObjectMessage(null);
+ } else if(obj instanceof byte[]) {
+ jmsMessage = sessions[0].createObjectMessage((byte[]) obj);
+ } else {
+ throw new NotificationException("Expected payload type for '" + MessageType.JAVA_SERIALIZED + "' is byte[]. Recieved '" + obj.getClass().getName() + "'.");
+ }
+ }
+ else
+ {
+ String content = null;
+ if (obj instanceof byte[]) {
+ content = new String((byte[]) obj);
+ } else if(obj != null) {
+ content = obj.toString();
+ }
+ jmsMessage = sessions[0].createTextMessage(content);
+ }
- if (MessageType.JAVA_SERIALIZED.equals(esbMessage.getType()))
- {
- if(obj == null) {
- // create a null payload message...
- jmsMessage = sessions[0].createObjectMessage(null);
- } else if(obj instanceof byte[]) {
- jmsMessage = sessions[0].createObjectMessage((byte[]) obj);
- } else {
- throw new NotificationException("Expected payload type for '" + MessageType.JAVA_SERIALIZED + "' is byte[]. Recieved '" + obj.getClass().getName() + "'.");
- }
- }
- else
- {
- String content = null;
- if (obj instanceof byte[]) {
- content = new String((byte[]) obj);
- } else if(obj != null) {
- content = obj.toString();
- }
- jmsMessage = sessions[0].createTextMessage(content);
- }
-
- setJMSProperties( esbMessage, jmsMessage );
-
- for (Iterator II = m_oProps.keySet().iterator(); II.hasNext();)
- {
- String sKey = (String) II.next();
- String sVal = m_oProps.getProperty(sKey);
- jmsMessage.setStringProperty(sKey, sVal);
- }
- sendToAll(jmsMessage);
+ setJMSProperties( esbMessage, jmsMessage );
+
+ for (Iterator II = m_oProps.keySet().iterator(); II.hasNext();)
+ {
+ String sKey = (String) II.next();
+ String sVal = m_oProps.getProperty(sKey);
+ jmsMessage.setStringProperty(sKey, sVal);
}
- catch (JMSException ex)
- {
- throw new NotificationException(ex);
- } catch (MessageDeliverException e) {
- throw new NotificationException(e);
- }
+ sendToAll(jmsMessage);
+ }
+ catch (JMSException ex)
+ {
+ throw new NotificationException(ex);
+ } catch (MessageDeliverException e) {
+ throw new NotificationException(e);
+ }
+ finally
+ {
+ /*
+ * Why do we create multiple pools but only ever use one?
+ *
+ * Don't forget to put the session back into the pool!
+ */
+
+ if (connectionPools != null)
+ connectionPools[0].closeSession(sessions[0]);
+ }
} // __________________________________
/**
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/jms/DefaultJMSPropertiesSetter.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/jms/DefaultJMSPropertiesSetter.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/jms/DefaultJMSPropertiesSetter.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -48,14 +48,15 @@
{
private Logger log = Logger.getLogger( DefaultJMSPropertiesSetter.class );
- /**
- * Client JMSX Group ID.
- */
- private static final String JMSX_GROUP_ID = "JMSXGroupID" ;
- /**
- * Client JMSX Group Seq.
- */
- private static final String JMSX_GROUP_SEQ = "JMSXGroupSeq" ;
+ /**
+ * Client JMSX Group ID.
+ */
+ private static final String JMSX_GROUP_ID = "JMSXGroupID" ;
+ /**
+ * Client JMSX Group Seq.
+ */
+ private static final String JMSX_GROUP_SEQ = "JMSXGroupSeq" ;
+
/**
* Set JMS Header fields on the outgoing JMS Message.
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/jms/JMSPropertiesSetter.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/jms/JMSPropertiesSetter.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/jms/JMSPropertiesSetter.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -40,6 +40,12 @@
String JMS_EXPIRATION = "javax.jms.message.expiration";
/**
+ * Key used when setting the JMSRedelivered as a
+ * property on an ESB Message instance.
+ */
+ String JMS_REDELIVERED = "javax.jms.message.redelivered";
+
+ /**
* Sets JMS properties fields on the outgoing JMS Message.
* </p>
*
Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,139 +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.util;
-
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-/**
- * Auxiliary class that deals with implementation details of event messages handled by ESB aware applications.
- * <p/>The '_command' enumeration is inteded to contain all accepted command codes, and should be provided
- * by all classes that extend AbstractCommandMessage
- * <br/>Values that this class is able to render are (arbitrarily) stored in a Map<String,Object>
- * contained in the message body as a named Object with key getCommandValuesTag()
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public abstract class AbstractCommandVehicle implements Serializable
-{
- /**
- * Provide a name for the named object to look for in the ESB Message body.
- * @return String : intended to be used as the key in Message.getBody().get(arg)
- */
- public abstract String getCommandValuesTag();
-
- /**
- * The key for the command operation code in the command values map
- * @return String : intended to be used as the key in _values.get(arg)
- */
- public abstract String getCommandOpcodeKey();
-
- /**
- * Valid operator for this command vehicle, from String value
- * @param value - the String value of the operator
- * @return the Enum value that represents arg0
- */
- public abstract Enum operatorFromString(String value);
-
- private Logger _logger = Logger.getLogger(AbstractCommandVehicle.class);
-
- protected Map<String,Object>_values = new HashMap<String,Object>();
-
- protected Enum _operator;
- public Enum getOperator() { return _operator; }
- protected void setOperator(Enum operator) { _operator = operator; }
-
- protected AbstractCommandVehicle(Enum command)
- {
- _operator = command;
- }
-
- /**
- * Populate this event's associated values contained in the ESB message
- * <br/>Values that this class is able to render are expected to be in a Map<String,Object>
- * contained in the message body as a named Object (key=getCommandValuesTag())
- * @param message : Message - the vehicle of this command
- */
- @SuppressWarnings("unchecked")
- protected AbstractCommandVehicle(Message message)
- {
- Object obj = message.getBody().get(getCommandValuesTag());
- if (! (obj instanceof Map))
- throw new IllegalArgumentException("Message command values must be stored as a Map<String,Object>");
- _values.putAll((Map)obj);
- _operator = operatorFromString((String)_values.get(getCommandOpcodeKey()));
- _values.remove(getCommandValuesTag());
- } //________________________________
-
- /**
- * Instantiate a new message, and put values where they belong
- * @return Message - a fresh Message, with the command values in the appropriate spot
- */
- public Message toCommandMessage()
- {
- Message message = MessageFactory.getInstance().getMessage();
- URI uri = null;
- try { uri = new URI(UUID.randomUUID().toString()); }
- catch (URISyntaxException e)
- {
- _logger.fatal("Problem with UUID.randomUUID() - This should not happen");
- return null;
- }
- message.getHeader().getCall().setMessageID(uri);
-
- _values.put(getCommandOpcodeKey(), _operator.toString());
- message.getBody().add(getCommandValuesTag(), _values);
-
- return message;
- } //________________________________
-
- /**
- * Clean all values from this command object
- * <br/>Operator will still remain the same as before
- * @return Map<String,Object> the old contents of _values
- */
- public Map <String,Object>cleanValues()
- {
- Map <String,Object> oldVals = _values;
- _values = new HashMap<String,Object>();
- return oldVals;
- } //________________________________
-
- protected Object setValue(String key, Object value)
- {
- if (null==key)
- throw new IllegalArgumentException("Key must not be null");
- Object oldVal = _values.get(key);
- if (null==value)
- _values.remove(key);
- else
- oldVal = _values.put(key, value);
- return oldVal;
- } //________________________________
-}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -25,18 +25,19 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.InputStream;
import java.io.PrintStream;
import java.io.Serializable;
+import java.io.StringReader;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
@@ -49,15 +50,13 @@
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.TTCCLayout;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
-import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
+import org.jboss.internal.soa.esb.message.format.xml.XMLUtil;
+import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
import org.jboss.soa.esb.common.ModulePropertyManager;
import org.jboss.soa.esb.helpers.KeyValuePair;
import org.jboss.soa.esb.message.Message;
-import org.w3c.dom.Document;
import org.xml.sax.SAXException;
public class Util
@@ -171,6 +170,8 @@
return oRet;
} // __________________________________
+ // ParserConfigurationException is no longer thrown but,
+ // unfortunately, it is in the signature of the method!
public static Serializable serialize (Message message)
throws ParserConfigurationException, IOException
{
@@ -180,56 +181,42 @@
try
{
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
-
- factory.setNamespaceAware(true);
-
- Document doc = factory.newDocumentBuilder().newDocument();
- ((org.jboss.internal.soa.esb.message.format.xml.MessageImpl) message)
- .toXML(doc);
- StringWriter sWriter = new StringWriter();
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
- XMLSerializer xmlS = new XMLSerializer(sWriter, format);
- xmlS.asDOMSerializer();
- xmlS.serialize(doc);
- return sWriter.toString();
+ final StringWriter writer = new StringWriter() ;
+ final XMLStreamWriter out = XMLHelper.getXMLStreamWriter(writer) ;
+ final String origURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_ENVELOPE) ;
+ ((MessageImpl) message).writeContent(out) ;
+ StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_ENVELOPE.getPrefix(), origURI) ;
+ out.flush();
+ return writer.toString() ;
}
- catch (MarshalException ex)
+ catch (final XMLStreamException xmlse)
{
- final IOException ioe = new IOException("Util.serialize caught MarshalException:") ;
- ioe.initCause(ex) ;
+ final IOException ioe = new IOException("Util.serialize caught XMLStreamException:") ;
+ ioe.initCause(xmlse) ;
throw ioe ;
}
}// ________________________________
+ // ParserConfigurationException and SAXException are no longer thrown
+ // but, unfortunately, they are in the signature of the method!
public static Message deserialize (Serializable serial)
throws ParserConfigurationException, SAXException, IOException
{
- if (serial instanceof MessageImpl) // MessageType.JAVA_SERIALIZED
+ if (serial instanceof Message) // MessageType.JAVA_SERIALIZED
return (Message) serial;
try
{
- // MessageType.JBOSS_XML
- InputStream inStream = new ByteArrayInputStream(((String) serial)
- .getBytes());
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.parse(inStream);
-
- org.jboss.internal.soa.esb.message.format.xml.MessageImpl message = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
- message.fromXML(doc);
- return message;
+ // MessageType.JBOSS_XML
+ final StringReader reader = new StringReader((String)serial) ;
+ final XMLStreamReader in = XMLHelper.getXMLStreamReader(reader) ;
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_ENVELOPE) ;
+ return new MessageImpl(in) ;
}
- catch (UnmarshalException ex)
+ catch (XMLStreamException xmlse)
{
- final IOException ioe = new IOException("Util.deserialize caught UnmarshalException") ;
- ioe.initCause(ex) ;
+ final IOException ioe = new IOException("Util.deserialize caught XMLStreamException") ;
+ ioe.initCause(xmlse) ;
throw ioe ;
}
} // ________________________________
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierIntegrationTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierIntegrationTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierIntegrationTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierIntegrationTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,84 @@
+/*
+ * 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.couriers;
+
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.Session;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Unit test for JmsCourier
+ *
+ * @author <a href="mailto:daniel.bevenius at gmail.com">Daniel Bevenius</a>
+ *
+ */
+public class JmsCourierIntegrationTest
+{
+ @SuppressWarnings("unused")
+ private Logger log = Logger.getLogger( JmsCourierIntegrationTest.class );
+
+ private JmsCourier jmsCourier;
+
+ @Test
+ public void getJmsSession() throws CourierException, JMSException
+ {
+ Session jmsSession = jmsCourier.getJmsSession();
+ assertTrue( jmsSession.getTransacted() );
+ jmsCourier.cleanup();
+ }
+
+ @Before
+ public void createJmsCourierInstance() throws CourierException
+ {
+ final Properties env = null;
+ final String messageSelector = null;
+ final boolean persistent = true;
+ final boolean transacted = true;
+ JMSEpr epr = new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL,
+ JMSEpr.QUEUE_TYPE,
+ "queue/A",
+ "ConnectionFactory",
+ env,
+ messageSelector,
+ persistent,
+ transacted);
+ jmsCourier = new JmsCourier( epr );
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter( JmsCourierIntegrationTest.class );
+ }
+
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainerUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainerUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -74,12 +74,31 @@
final String password = "passwd";
final Properties env = null;
Map<String, String> poolKey = JmsConnectionPoolContainer.createPoolKey( env, connectionFactory, QUEUE_TYPE,
- username, password);
+ username, password, false);
assertEquals( username, poolKey.get( JMSEpr.JMS_SECURITY_PRINCIPAL_TAG ) );
assertEquals( password, poolKey.get( JMSEpr.JMS_SECURITY_CREDENTIAL_TAG ) );
}
+ @Test
+ public void createPoolKey_with_transacted_properties()
+ {
+ final boolean transacted = true;
+ final Properties env = null;
+ Map<String, String> poolKey = JmsConnectionPoolContainer.createPoolKey( env, connectionFactory, QUEUE_TYPE,
+ null, null, transacted);
+ assertEquals( transacted, Boolean.valueOf ( poolKey.get( JMSEpr.TRANSACTED_TAG ) ) );
+ }
+ @Test
+ public void createPoolKey_with_non_transacted_properties()
+ {
+ final boolean transacted = false;
+ final Properties env = null;
+ Map<String, String> poolKey = JmsConnectionPoolContainer.createPoolKey( env, connectionFactory, QUEUE_TYPE,
+ null, null, transacted);
+ assertEquals( transacted, Boolean.valueOf ( poolKey.get( JMSEpr.TRANSACTED_TAG ) ) );
+ }
+
public static junit.framework.Test suite()
{
return new JUnit4TestAdapter( JmsConnectionPoolContainerUnitTest.class );
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,72 @@
+/*
+ * 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.actions;
+
+import junit.framework.TestCase;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class AggregationDetailsUnitTest extends TestCase {
+
+ public void test_multi_args() throws MessageDeliverException {
+ test_invalid_multi_args("", 1, 1, 1, "null or empty 'seriesUuid' arg in method call.");
+ test_invalid_multi_args("x", -1, 1, 1, "Invalid AggregatorDetails. messageNumber < 1");
+ test_invalid_multi_args("x", 1, -1, 1, "Invalid AggregatorDetails. seriesSize < messageNumber");
+ test_invalid_multi_args("x", 1, 1, -1, "Invalid AggregatorDetails. timestamp < 1");
+
+ // This should work...
+ new AggregationDetails("x", 1, 1, 1);
+ }
+
+ private void test_invalid_multi_args(String seriesUuid, int messageNumber, int seriesSize, long seriesTimestamp, String errorMessage) {
+ try {
+ new AggregationDetails(seriesUuid, messageNumber, seriesSize, seriesTimestamp);
+ fail("Expected IllegalArgumentException/MessageDeliverException");
+ } catch(IllegalArgumentException e) {
+ assertEquals(errorMessage, e.getMessage());
+ }
+ }
+
+ public void test_tag_arg() throws MessageDeliverException {
+ test_invalid_tag_arg("", "null or empty 'aggregatorTag' arg in method call.");
+ test_invalid_tag_arg("1:1:1", "Invalid Aggregator Tag. Must have 4 tokens (colon separated).");
+ test_invalid_tag_arg(":1:1:1", "Invalid Aggregator Tag: seriesUuid is blank.");
+ test_invalid_tag_arg("xxx:x:1:1", "Invalid Aggregator Tag. 'messageNumber' must be an int.");
+ test_invalid_tag_arg("xxx:1:x:1", "Invalid Aggregator Tag. 'seriesSize' must be an int.");
+ test_invalid_tag_arg("xxx:1:1:x", "Invalid Aggregator Tag. 'timestamp' must be an long.");
+ test_invalid_tag_arg("xxx:-1:1:1", "Invalid Aggregator Tag. messageNumber < 1");
+ test_invalid_tag_arg("xxx:1:-1:1", "Invalid Aggregator Tag. seriesSize < messageNumber");
+ test_invalid_tag_arg("xxx:1:1:-1", "Invalid Aggregator Tag. timestamp < 1");
+
+ // This should work...
+ new AggregationDetails("xxx:1:1:1");
+ }
+
+ private void test_invalid_tag_arg(String tag, String errorMessage) {
+ try {
+ new AggregationDetails(tag);
+ fail("Expected IllegalArgumentException/MessageDeliverException");
+ } catch(IllegalArgumentException e) {
+ assertEquals(errorMessage, e.getMessage());
+ }
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregatorUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregatorUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregatorUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -73,7 +73,6 @@
return new JUnit4TestAdapter(AggregatorUnitTest.class);
}
-
@BeforeClass
public static void before() throws Exception {
MockCourierFactory.install();
@@ -122,11 +121,26 @@
}
} catch (Exception e) {
+ e.printStackTrace();
assertTrue(false);
}
}
@Test
+ public void aggregateWithoutTimeout()
+ {
+ try {
+ InputStream in = ClassUtil.getResourceAsStream("OtherAggregatorUnitTest.xml", AggregatorUnitTest.class);
+ String xml = FileUtil.readStream(in);
+ ConfigTree[] acts = ConfigTree.fromXml(xml).getChildren("action");
+
+ Aggregator aggregator = new Aggregator(acts[0]);
+ } catch (Exception e) {
+ assertTrue(false);
+ }
+ }
+
+ @Test
public void aggregateTimeoutTest1()
{
try {
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/OtherAggregatorUnitTest.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/OtherAggregatorUnitTest.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/OtherAggregatorUnitTest.xml (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/OtherAggregatorUnitTest.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,6 @@
+<testActions>
+ <action class="org.jboss.soa.esb.actions.Aggregator" name="Aggregator"
+ service-category="test" service-name="Aggregator" />
+ <action class="org.jboss.soa.esb.actions.Aggregator" name="Aggregator"
+ service-category="test" service-name="Aggregator"/>
+</testActions>
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation)
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,284 +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.actions.aggregation;
-
-import junit.framework.TestCase;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.*;
-import org.jboss.soa.esb.client.ServiceInvoker;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.testutils.ESBConfigUtil;
-
-import java.util.Map;
-
-/**
- * Tests for JBESB-1201 re timeout management.
- * <p/>
- * Make sure the message aggregation info flows in the following scenario...
- * <pre>
- *
- * |----- service1 -----|
- * | |
- * splitter --| |-- aggregator
- * | |
- * |----- service2 -----|
- *
- * </pre>
- *
- * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
- */
-public class JBESB_1201_UnitTest extends TestCase {
-
- private TestCourier service1Courier;
- private TestCourier service2Courier;
- private TestCourier aggregatorCourier;
- private TestCourier dlqServiceCourier;
-
- private StaticRouter splitter;
- private StaticRouter service1;
- private StaticRouter service2;
- private Aggregator aggregator;
-
- protected void setUp() throws Exception {
- MockCourierFactory.install();
- MockRegistry.install();
-
- service1Courier = new TestCourier();
- service2Courier = new TestCourier();
- aggregatorCourier = new TestCourier();
- dlqServiceCourier = new TestCourier();
-
- MockRegistry.register("test", "service1", service1Courier);
- MockRegistry.register("test", "service2", service2Courier);
- MockRegistry.register("test", "aggregator", aggregatorCourier);
- MockRegistry.register(ServiceInvoker.INTERNAL_SERVICE_CATEGORY, ServiceInvoker.DEAD_LETTER_SERVICE_NAME, dlqServiceCourier);
-
- initaliseServices();
- }
-
- private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
- ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
- ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
- ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
- ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
- ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");
-
- splitter = new StaticRouter(splitterConfig);
- splitter.initialise();
- service1 = new StaticRouter(service1Config);
- service1.initialise();
- service2 = new StaticRouter(service2Config);
- service2.initialise();
- aggregator = new Aggregator(aggregatorConfig);
- aggregator.initialise();
- }
-
- protected void tearDown() throws Exception {
- splitter.destroy();
- service1.destroy();
- service2.destroy();
- aggregator.destroy();
- MockRegistry.uninstall();
- MockCourierFactory.uninstall();
- }
-
- public void test_not_timed_out() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Get the aggregators message map and make sure it's empty...
- Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // 2 messages should arrive at the aggregatorCourier...
- assertEquals(2, aggregatorCourier.messages.size());
-
- // Aggregators message map should be empty...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the 1st message into the aggregater...
- aggregator.process(aggregatorCourier.messages.get(0));
- assertService1MessageDetailsOK(aggrMessageMap, service1Message);
-
- // Pump the 2nd (last) message into the aggregater...
- Message aggregateMessage = aggregator.process(aggregatorCourier.messages.get(1));
-
- assertNotNull(aggregateMessage);
- assertEquals(2, aggregateMessage.getAttachment().getUnnamedCount());
-
- // Make sure the aggregators message map is empty again...
- assertTrue(aggrMessageMap.isEmpty());
- }
-
- public void test_timed_out_non_delivered() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Get the aggregators message map and make sure it's empty...
- Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // The aggregator timeout is 2000ms... sleep here for 3000ms to force all
- // messages delivered to the aggregator to be timed out - should all be
- // ignored...
- Thread.sleep(3000);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // 2 messages should arrive at the aggregatorCourier...
- assertEquals(2, aggregatorCourier.messages.size());
-
- // Aggregators message map should be empty...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the 1st message into the aggregater...
- aggregator.process(aggregatorCourier.messages.get(0));
-
- // Aggregators message map should still be empty because the message should
- // have been ignored...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the 2nd (last) message into the aggregater...
- aggregator.process(aggregatorCourier.messages.get(1));
-
- // Aggregators message map should still be empty because the message should
- // have been ignored...
- assertTrue(aggrMessageMap.isEmpty());
- }
-
- public void test_timed_out_some_delivered() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Get the aggregators message map and make sure it's empty...
- Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // 1 messages should arrive at the aggregatorCourier...
- assertEquals(1, aggregatorCourier.messages.size());
-
- // Aggregators message map should be empty...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the 1st message into the aggregater and make sure it's
- // details are added properly to the map...
- aggregator.process(aggregatorCourier.messages.get(0));
- assertService1MessageDetailsOK(aggrMessageMap, service1Message);
-
- // The deadServiceCourier should be empty...
- assertEquals(0, dlqServiceCourier.messages.size());
-
- // The aggregator timeout is 2000ms... sleep here for 3000ms to force the 2nd
- // message delivered to the aggregator to be timed out...
- Thread.sleep(3000);
-
- // Should have timed out and "notified" on the first message...
- assertEquals(1, dlqServiceCourier.messages.size());
- // Aggregators message map should be empty again...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // 2 messages should be at the aggregatorCourier...
- assertEquals(2, aggregatorCourier.messages.size());
-
- // Pump the 2nd message into the aggregater...
- Message aggregateMessage = aggregator.process(aggregatorCourier.messages.get(1));
- assertNull(aggregateMessage);
-
- // Aggregators message map should be empty because the message should
- // have been ignored...
- assertTrue(aggrMessageMap.isEmpty());
- }
-
- public void test_timeoutchecker() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Get the aggregators message map and make sure it's empty...
- Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // 1 messages should arrive at the aggregatorCourier...
- assertEquals(1, aggregatorCourier.messages.size());
-
- // Aggregators message map should be empty...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the message into the aggregater and make sure it's
- // details are added properly to the map...
- aggregator.process(aggregatorCourier.messages.get(0));
- assertService1MessageDetailsOK(aggrMessageMap, service1Message);
-
- // The aggregator timeout is 2000ms... sleep here for 3000ms...
- Thread.sleep(4000);
-
- // Aggregators message map should be empty because the message should
- // have timed out...
- assertTrue("Message didn't get removed from map after timeout", aggrMessageMap.isEmpty());
- }
-
- private void assertService1MessageDetailsOK(Map<String, Map<Integer, Message>> aggrMessageMap, AggregationDetails service1Message) {
- // Aggregators message map should have 1 entry for the above message...
- assertEquals(1, aggrMessageMap.size());
- Map<Integer, Message> messageSeries = aggrMessageMap.get(service1Message.getSeriesUuid());
- assertNotNull(messageSeries);
- assertTrue(messageSeries.get(service1Message.getMessageNumber()) != null);
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,284 @@
+/*
+ * 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.actions.aggregation;
+
+import junit.framework.TestCase;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.*;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.ESBConfigUtil;
+
+import java.util.Map;
+
+/**
+ * Tests for JBESB-1201 re timeout management.
+ * <p/>
+ * Make sure the message aggregation info flows in the following scenario...
+ * <pre>
+ *
+ * |----- service1 -----|
+ * | |
+ * splitter --| |-- aggregator
+ * | |
+ * |----- service2 -----|
+ *
+ * </pre>
+ *
+ * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
+ */
+public class JBESB_1201_UnitTest extends TestCase {
+
+ private TestCourier service1Courier;
+ private TestCourier service2Courier;
+ private TestCourier aggregatorCourier;
+ private TestCourier dlqServiceCourier;
+
+ private StaticRouter splitter;
+ private StaticRouter service1;
+ private StaticRouter service2;
+ private Aggregator aggregator;
+
+ protected void setUp() throws Exception {
+ MockCourierFactory.install();
+ MockRegistry.install();
+
+ service1Courier = new TestCourier();
+ service2Courier = new TestCourier();
+ aggregatorCourier = new TestCourier();
+ dlqServiceCourier = new TestCourier();
+
+ MockRegistry.register("test", "service1", service1Courier);
+ MockRegistry.register("test", "service2", service2Courier);
+ MockRegistry.register("test", "aggregator", aggregatorCourier);
+ MockRegistry.register(ServiceInvoker.INTERNAL_SERVICE_CATEGORY, ServiceInvoker.DEAD_LETTER_SERVICE_NAME, dlqServiceCourier);
+
+ initaliseServices();
+ }
+
+ private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
+ ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
+ ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
+ ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
+ ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
+ ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");
+
+ splitter = new StaticRouter(splitterConfig);
+ splitter.initialise();
+ service1 = new StaticRouter(service1Config);
+ service1.initialise();
+ service2 = new StaticRouter(service2Config);
+ service2.initialise();
+ aggregator = new Aggregator(aggregatorConfig);
+ aggregator.initialise();
+ }
+
+ protected void tearDown() throws Exception {
+ splitter.destroy();
+ service1.destroy();
+ service2.destroy();
+ aggregator.destroy();
+ MockRegistry.uninstall();
+ MockCourierFactory.uninstall();
+ }
+
+ public void test_not_timed_out() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Get the aggregators message map and make sure it's empty...
+ Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // 2 messages should arrive at the aggregatorCourier...
+ assertEquals(2, aggregatorCourier.messages.size());
+
+ // Aggregators message map should be empty...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the 1st message into the aggregater...
+ aggregator.process(aggregatorCourier.messages.get(0));
+ assertService1MessageDetailsOK(aggrMessageMap, service1Message);
+
+ // Pump the 2nd (last) message into the aggregater...
+ Message aggregateMessage = aggregator.process(aggregatorCourier.messages.get(1));
+
+ assertNotNull(aggregateMessage);
+ assertEquals(2, aggregateMessage.getAttachment().getUnnamedCount());
+
+ // Make sure the aggregators message map is empty again...
+ assertTrue(aggrMessageMap.isEmpty());
+ }
+
+ public void test_timed_out_non_delivered() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Get the aggregators message map and make sure it's empty...
+ Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // The aggregator timeout is 2000ms... sleep here for 3000ms to force all
+ // messages delivered to the aggregator to be timed out - should all be
+ // ignored...
+ Thread.sleep(3000);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // 2 messages should arrive at the aggregatorCourier...
+ assertEquals(2, aggregatorCourier.messages.size());
+
+ // Aggregators message map should be empty...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the 1st message into the aggregater...
+ aggregator.process(aggregatorCourier.messages.get(0));
+
+ // Aggregators message map should still be empty because the message should
+ // have been ignored...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the 2nd (last) message into the aggregater...
+ aggregator.process(aggregatorCourier.messages.get(1));
+
+ // Aggregators message map should still be empty because the message should
+ // have been ignored...
+ assertTrue(aggrMessageMap.isEmpty());
+ }
+
+ public void test_timed_out_some_delivered() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Get the aggregators message map and make sure it's empty...
+ Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // 1 messages should arrive at the aggregatorCourier...
+ assertEquals(1, aggregatorCourier.messages.size());
+
+ // Aggregators message map should be empty...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the 1st message into the aggregater and make sure it's
+ // details are added properly to the map...
+ aggregator.process(aggregatorCourier.messages.get(0));
+ assertService1MessageDetailsOK(aggrMessageMap, service1Message);
+
+ // The deadServiceCourier should be empty...
+ assertEquals(0, dlqServiceCourier.messages.size());
+
+ // The aggregator timeout is 2000ms... sleep here for 3000ms to force the 2nd
+ // message delivered to the aggregator to be timed out...
+ Thread.sleep(3000);
+
+ // Should have timed out and "notified" on the first message...
+ assertEquals(1, dlqServiceCourier.messages.size());
+ // Aggregators message map should be empty again...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // 2 messages should be at the aggregatorCourier...
+ assertEquals(2, aggregatorCourier.messages.size());
+
+ // Pump the 2nd message into the aggregater...
+ Message aggregateMessage = aggregator.process(aggregatorCourier.messages.get(1));
+ assertNull(aggregateMessage);
+
+ // Aggregators message map should be empty because the message should
+ // have been ignored...
+ assertTrue(aggrMessageMap.isEmpty());
+ }
+
+ public void test_timeoutchecker() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Get the aggregators message map and make sure it's empty...
+ Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // 1 messages should arrive at the aggregatorCourier...
+ assertEquals(1, aggregatorCourier.messages.size());
+
+ // Aggregators message map should be empty...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the message into the aggregater and make sure it's
+ // details are added properly to the map...
+ aggregator.process(aggregatorCourier.messages.get(0));
+ assertService1MessageDetailsOK(aggrMessageMap, service1Message);
+
+ // The aggregator timeout is 2000ms... sleep here for 3000ms...
+ Thread.sleep(4000);
+
+ // Aggregators message map should be empty because the message should
+ // have timed out...
+ assertTrue("Message didn't get removed from map after timeout", aggrMessageMap.isEmpty());
+ }
+
+ private void assertService1MessageDetailsOK(Map<String, Map<Integer, Message>> aggrMessageMap, AggregationDetails service1Message) {
+ // Aggregators message map should have 1 entry for the above message...
+ assertEquals(1, aggrMessageMap.size());
+ Map<Integer, Message> messageSeries = aggrMessageMap.get(service1Message.getSeriesUuid());
+ assertNotNull(messageSeries);
+ assertTrue(messageSeries.get(service1Message.getMessageNumber()) != null);
+ }
+}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,172 +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.actions.aggregation;
-
-import junit.framework.TestCase;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.actions.*;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.testutils.ESBConfigUtil;
-
-import java.util.List;
-
-/**
- * Tests for JBESB-1204 and JBESB-1331 re aggrgation tag infos.
- * <p/>
- * Make sure the message aggregation info flows in the following scenario...
- * <pre>
- *
- * |----- service1 -----|
- * | |
- * splitter --| |-- aggregator
- * | |
- * |----- service2 -----|
- *
- * </pre>
- *
- * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
- */
-public class JBESB_1204_1331_UnitTest extends TestCase {
-
- private TestCourier service1Courier;
- private TestCourier service2Courier;
- private TestCourier aggregatorCourier;
-
- private StaticRouter splitter;
- private StaticRouter service1;
- private StaticRouter service2;
- private Aggregator aggregator;
-
- protected void setUp() throws Exception {
- MockCourierFactory.install();
- MockRegistry.install();
-
- service1Courier = new TestCourier();
- service2Courier = new TestCourier();
- aggregatorCourier = new TestCourier();
-
- MockRegistry.register("test", "service1", service1Courier);
- MockRegistry.register("test", "service2", service2Courier);
- MockRegistry.register("test", "aggregator", aggregatorCourier);
-
- initaliseServices();
- }
-
- private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
- ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
- ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
- ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
- ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
- ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");
-
- splitter = new StaticRouter(splitterConfig);
- splitter.initialise();
- service1 = new StaticRouter(service1Config);
- service1.initialise();
- service2 = new StaticRouter(service2Config);
- service2.initialise();
- aggregator = new Aggregator(aggregatorConfig);
- aggregator.initialise();
- }
-
- protected void tearDown() throws Exception {
- splitter.destroy();
- service1.destroy();
- service2.destroy();
- aggregator.destroy();
- MockRegistry.uninstall();
- MockCourierFactory.uninstall();
- }
-
- public void test() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException {
- Message messageIn = MessageFactory.getInstance().getMessage();
- List<String> aggrTags;
- AggregationDetails aggrDetailsS1;
- AggregationDetails aggrDetailsS2;
- AggregationDetails aggrDetailsAggrM1;
- AggregationDetails aggrDetailsAggrM2;
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
-
- // There should be 2 msssages delivered.. one to service1 and one service2...
- assertEquals(1, service1Courier.messages.size());
- assertEquals(1, service2Courier.messages.size());
-
- // The 2 messages should each have 1 aggregation info string (no more)...
- aggrTags = Aggregator.getAggregatorTags(service1Courier.messages.get(0));
- assertEquals(1, aggrTags.size());
- aggrDetailsS1 = new AggregationDetails(aggrTags.get(0));
- aggrTags = Aggregator.getAggregatorTags(service2Courier.messages.get(0));
- assertEquals(1, aggrTags.size());
- aggrDetailsS2 = new AggregationDetails(aggrTags.get(0));
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // 2 messages should arrive at the aggregatorCourier...
- assertEquals(2, aggregatorCourier.messages.size());
-
- // Extract aggr details from first message...
- aggrTags = Aggregator.getAggregatorTags(aggregatorCourier.messages.get(0));
- assertEquals(1, aggrTags.size());
- aggrDetailsAggrM1 = new AggregationDetails(aggrTags.get(0));
-
- // Extract aggr details from second message...
- aggrTags = Aggregator.getAggregatorTags(aggregatorCourier.messages.get(1));
- assertEquals(1, aggrTags.size());
- aggrDetailsAggrM2 = new AggregationDetails(aggrTags.get(0));
-
- // make sure all the UUIDs match...
- assertEquals(aggrDetailsS1.getSeriesUuid(), aggrDetailsS2.getSeriesUuid());
- assertEquals(aggrDetailsS2.getSeriesUuid(), aggrDetailsAggrM1.getSeriesUuid());
- assertEquals(aggrDetailsAggrM1.getSeriesUuid(), aggrDetailsAggrM2.getSeriesUuid());
-
- // make sure all the timestamps match...
- assertEquals(aggrDetailsS1.getSeriesTimestamp(), aggrDetailsS2.getSeriesTimestamp());
- assertEquals(aggrDetailsS2.getSeriesTimestamp(), aggrDetailsAggrM1.getSeriesTimestamp());
- assertEquals(aggrDetailsAggrM1.getSeriesTimestamp(), aggrDetailsAggrM2.getSeriesTimestamp());
-
- // make sure the series size matches...
- assertEquals(aggrDetailsS1.getSeriesSize(), aggrDetailsS2.getSeriesSize());
- assertEquals(aggrDetailsS2.getSeriesSize(), aggrDetailsAggrM1.getSeriesSize());
- assertEquals(aggrDetailsAggrM1.getSeriesSize(), aggrDetailsAggrM2.getSeriesSize());
-
- // make sure the message num's don't match, and that they're 1 or 2...
- assertNotSame(aggrDetailsAggrM1.getMessageNumber(), aggrDetailsAggrM2.getMessageNumber());
- assertTrue(aggrDetailsAggrM1.getMessageNumber() == 1 || aggrDetailsAggrM1.getMessageNumber() == 2);
- assertTrue(aggrDetailsAggrM2.getMessageNumber() == 1 || aggrDetailsAggrM2.getMessageNumber() == 2);
-
- // make sure the splitId matches...
- assertEquals("splitter1-action", aggrDetailsS1.getSplitId());
- assertEquals(aggrDetailsS1.getSplitId(), aggrDetailsS2.getSplitId());
- assertEquals(aggrDetailsS2.getSplitId(), aggrDetailsAggrM1.getSplitId());
- assertEquals(aggrDetailsAggrM1.getSplitId(), aggrDetailsAggrM2.getSplitId());
- }
-}
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,172 @@
+/*
+ * 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.actions.aggregation;
+
+import junit.framework.TestCase;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.actions.*;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.ESBConfigUtil;
+
+import java.util.List;
+
+/**
+ * Tests for JBESB-1204 and JBESB-1331 re aggrgation tag infos.
+ * <p/>
+ * Make sure the message aggregation info flows in the following scenario...
+ * <pre>
+ *
+ * |----- service1 -----|
+ * | |
+ * splitter --| |-- aggregator
+ * | |
+ * |----- service2 -----|
+ *
+ * </pre>
+ *
+ * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
+ */
+public class JBESB_1204_1331_UnitTest extends TestCase {
+
+ private TestCourier service1Courier;
+ private TestCourier service2Courier;
+ private TestCourier aggregatorCourier;
+
+ private StaticRouter splitter;
+ private StaticRouter service1;
+ private StaticRouter service2;
+ private Aggregator aggregator;
+
+ protected void setUp() throws Exception {
+ MockCourierFactory.install();
+ MockRegistry.install();
+
+ service1Courier = new TestCourier();
+ service2Courier = new TestCourier();
+ aggregatorCourier = new TestCourier();
+
+ MockRegistry.register("test", "service1", service1Courier);
+ MockRegistry.register("test", "service2", service2Courier);
+ MockRegistry.register("test", "aggregator", aggregatorCourier);
+
+ initaliseServices();
+ }
+
+ private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
+ ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
+ ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
+ ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
+ ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
+ ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");
+
+ splitter = new StaticRouter(splitterConfig);
+ splitter.initialise();
+ service1 = new StaticRouter(service1Config);
+ service1.initialise();
+ service2 = new StaticRouter(service2Config);
+ service2.initialise();
+ aggregator = new Aggregator(aggregatorConfig);
+ aggregator.initialise();
+ }
+
+ protected void tearDown() throws Exception {
+ splitter.destroy();
+ service1.destroy();
+ service2.destroy();
+ aggregator.destroy();
+ MockRegistry.uninstall();
+ MockCourierFactory.uninstall();
+ }
+
+ public void test() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+ List<String> aggrTags;
+ AggregationDetails aggrDetailsS1;
+ AggregationDetails aggrDetailsS2;
+ AggregationDetails aggrDetailsAggrM1;
+ AggregationDetails aggrDetailsAggrM2;
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+
+ // There should be 2 msssages delivered.. one to service1 and one service2...
+ assertEquals(1, service1Courier.messages.size());
+ assertEquals(1, service2Courier.messages.size());
+
+ // The 2 messages should each have 1 aggregation info string (no more)...
+ aggrTags = Aggregator.getAggregatorTags(service1Courier.messages.get(0));
+ assertEquals(1, aggrTags.size());
+ aggrDetailsS1 = new AggregationDetails(aggrTags.get(0));
+ aggrTags = Aggregator.getAggregatorTags(service2Courier.messages.get(0));
+ assertEquals(1, aggrTags.size());
+ aggrDetailsS2 = new AggregationDetails(aggrTags.get(0));
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // 2 messages should arrive at the aggregatorCourier...
+ assertEquals(2, aggregatorCourier.messages.size());
+
+ // Extract aggr details from first message...
+ aggrTags = Aggregator.getAggregatorTags(aggregatorCourier.messages.get(0));
+ assertEquals(1, aggrTags.size());
+ aggrDetailsAggrM1 = new AggregationDetails(aggrTags.get(0));
+
+ // Extract aggr details from second message...
+ aggrTags = Aggregator.getAggregatorTags(aggregatorCourier.messages.get(1));
+ assertEquals(1, aggrTags.size());
+ aggrDetailsAggrM2 = new AggregationDetails(aggrTags.get(0));
+
+ // make sure all the UUIDs match...
+ assertEquals(aggrDetailsS1.getSeriesUuid(), aggrDetailsS2.getSeriesUuid());
+ assertEquals(aggrDetailsS2.getSeriesUuid(), aggrDetailsAggrM1.getSeriesUuid());
+ assertEquals(aggrDetailsAggrM1.getSeriesUuid(), aggrDetailsAggrM2.getSeriesUuid());
+
+ // make sure all the timestamps match...
+ assertEquals(aggrDetailsS1.getSeriesTimestamp(), aggrDetailsS2.getSeriesTimestamp());
+ assertEquals(aggrDetailsS2.getSeriesTimestamp(), aggrDetailsAggrM1.getSeriesTimestamp());
+ assertEquals(aggrDetailsAggrM1.getSeriesTimestamp(), aggrDetailsAggrM2.getSeriesTimestamp());
+
+ // make sure the series size matches...
+ assertEquals(aggrDetailsS1.getSeriesSize(), aggrDetailsS2.getSeriesSize());
+ assertEquals(aggrDetailsS2.getSeriesSize(), aggrDetailsAggrM1.getSeriesSize());
+ assertEquals(aggrDetailsAggrM1.getSeriesSize(), aggrDetailsAggrM2.getSeriesSize());
+
+ // make sure the message num's don't match, and that they're 1 or 2...
+ assertNotSame(aggrDetailsAggrM1.getMessageNumber(), aggrDetailsAggrM2.getMessageNumber());
+ assertTrue(aggrDetailsAggrM1.getMessageNumber() == 1 || aggrDetailsAggrM1.getMessageNumber() == 2);
+ assertTrue(aggrDetailsAggrM2.getMessageNumber() == 1 || aggrDetailsAggrM2.getMessageNumber() == 2);
+
+ // make sure the splitId matches...
+ assertEquals("splitter1-action", aggrDetailsS1.getSplitId());
+ assertEquals(aggrDetailsS1.getSplitId(), aggrDetailsS2.getSplitId());
+ assertEquals(aggrDetailsS2.getSplitId(), aggrDetailsAggrM1.getSplitId());
+ assertEquals(aggrDetailsAggrM1.getSplitId(), aggrDetailsAggrM2.getSplitId());
+ }
+}
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,241 +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.actions.aggregation;
-
-import junit.framework.TestCase;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.*;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.testutils.ESBConfigUtil;
-import org.jboss.soa.esb.util.Util;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Tests for JBESB-1204 and JBESB-1331.
- * <p/>
- * Make sure the message aggregation info flows in the following scenario...
- * <pre>
- *
- * |------------------ service1 ----------------|
- * | |
- * splitter1 --| |-- aggregator2 --
- * | |--service2--| |
- * |-- splitter2 --| |--aggregator1--|
- * |--service3--|
- *
- * </pre>
- *
- * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
- */
-public class Nested_Splits_UnitTest extends TestCase {
-
- private TestCourier splitter2Courier; // no need for a courier for splitter1
- private TestCourier service1Courier;
- private TestCourier service2Courier;
- private TestCourier service3Courier;
- private TestCourier aggregator1Courier;
- private TestCourier aggregator2Courier;
-
- private StaticRouter splitter1;
- private StaticRouter splitter2;
- private StaticRouter service1;
- private StaticRouter service2;
- private StaticRouter service3;
- private Aggregator aggregator1;
- private Aggregator aggregator2;
- private Aggregator aggregator3;
-
- protected void setUp() throws Exception {
- MockCourierFactory.install();
- MockRegistry.install();
-
- splitter2Courier = new TestCourier();
- service1Courier = new TestCourier();
- service2Courier = new TestCourier();
- service3Courier = new TestCourier();
- aggregator1Courier = new TestCourier();
- aggregator2Courier = new TestCourier();
-
- MockRegistry.register("test", "splitter2", splitter2Courier);
- MockRegistry.register("test", "service1", service1Courier);
- MockRegistry.register("test", "service2", service2Courier);
- MockRegistry.register("test", "service3", service3Courier);
- MockRegistry.register("test", "aggregator1", aggregator1Courier);
- MockRegistry.register("test", "aggregator2", aggregator2Courier);
-
- initaliseServices();
- }
-
- private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
- ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-02.xml"));
- ConfigTree splitter1Config = esbConfig.getActionConfig("null-listener", "splitter1-action");
- ConfigTree splitter2Config = esbConfig.getActionConfig("null-listener", "splitter2-action");
- ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
- ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
- ConfigTree service3Config = esbConfig.getActionConfig("null-listener", "service3-config");
- ConfigTree aggregator1Config = esbConfig.getActionConfig("null-listener", "aggregator1-config");
- ConfigTree aggregator2Config = esbConfig.getActionConfig("null-listener", "aggregator2-config");
- ConfigTree aggregator3Config = esbConfig.getActionConfig("null-listener", "aggregator3-config");
-
- splitter1 = new StaticRouter(splitter1Config);
- splitter1.initialise();
- splitter2 = new StaticRouter(splitter2Config);
- splitter2.initialise();
- service1 = new StaticRouter(service1Config);
- service1.initialise();
- service2 = new StaticRouter(service2Config);
- service2.initialise();
- service3 = new StaticRouter(service3Config);
- service3.initialise();
- aggregator1 = new Aggregator(aggregator1Config);
- aggregator1.initialise();
- aggregator2 = new Aggregator(aggregator2Config);
- aggregator2.initialise();
- aggregator3 = new Aggregator(aggregator3Config);
- aggregator3.initialise();
- }
-
- protected void tearDown() throws Exception {
- splitter1.destroy();
- service1.destroy();
- service2.destroy();
- aggregator1.destroy();
- MockRegistry.uninstall();
- MockCourierFactory.uninstall();
- }
-
- /**
- * |------------------ service1 ----------------|
- * | |
- * splitter1 --| |-- aggregator2 --
- * | |--service2--| |
- * |-- splitter2 --| |--aggregator1--|
- * |--service3--|
- */
- public void test_nested_split() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, IOException, SAXException, ParserConfigurationException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Manually deliver the message to the splitter1 service...
- splitter1.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // Manually deliver the message in splitter2Courier into splitter2...
- splitter2.process(splitter2Courier.messages.get(0));
- AggregationDetails service2Message = Aggregator.getAggregatorDetails(service2Courier.messages.get(0), 0);
- assertNotNull(service2Message);
-
- // Manually deliver the message in aggregator2Courier into aggregator2 (this is the message from service1)...
- aggregator2.process(aggregator2Courier.messages.get(0));
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // Manually deliver the message in service3Courier into service3...
- service3.process(service3Courier.messages.get(0));
-
- // aggregator1Courier should have 2 messages in it... one from service2
- // and one from service3...
- assertEquals(2, aggregator1Courier.messages.size());
-
- // Should be 2 aggrTags before aggregation...
- List<String> aggrTags = Aggregator.getAggregatorTags(aggregator1Courier.messages.get(1));
- assertEquals(2, aggrTags.size());
-
- // Manually deliver the 2 messages to aggregator1...
- aggregator1.process(aggregator1Courier.messages.get(0));
- Message aggregator1Message = aggregator1.process(aggregator1Courier.messages.get(1));
- assertNoAggregationTags(aggregator1Courier.messages.get(0));
- assertNoAggregationTags(aggregator1Courier.messages.get(1));
- aggrTags = Aggregator.getAggregatorTags(aggregator1Message);
- assertEquals(1, aggrTags.size());
- AggregationDetails aggregator1MessageAggrDetails = Aggregator.getAggregatorDetails(aggregator1Message, 0);
- assertEquals(service1Message.getSeriesUuid(), aggregator1MessageAggrDetails.getSeriesUuid());
-
- // Manually deliver the aggregator1Message to aggregator2...
- Message aggregator2Message = aggregator2.process(aggregator1Message);
- assertNoAggregationTags(aggregator1Message);
- assertEquals(2, aggregator2Message.getAttachment().getUnnamedCount());
- Message message1 = Util.deserialize((Serializable) aggregator2Message.getAttachment().itemAt(0));
- assertNoAggregationTags(message1);
- Message message2 = Util.deserialize((Serializable) aggregator2Message.getAttachment().itemAt(1));
- assertNoAggregationTags(message2);
- }
-
- public void test_splitIds() throws ActionProcessingException {
- // Should be allowed to pump messages with diff splitIds into aggregator2
- // because there's no splitId set on it...
- test_splitIds(aggregator2, "splitId-1", "splitId-2");
-
- // Should get an error if I try the same with aggregator 3, coz it has
- // a "splitId" set on it...
- try {
- test_splitIds(aggregator3, "splitId-x", "splitId-y");
- fail("Expected ActionProcessingException");
- } catch (ActionProcessingException e) {
- assertEquals("Invalid aggregation config on aggregator 'aggregator3-config' . This aggregator is configured to only aggregate message with an aggregation 'spliId' of 'splitId1'. The splitId on the received message is 'splitId-x'. A nested aggregation point may be missing, or may have been bypassed.", e.getMessage());
- }
-
- // The following should work because the splitIds match the split ID on
- // aggregator3's config (see action-configs-02.xml).
- test_splitIds(aggregator3, "splitId1", "splitId1");
-
- }
-
- private void test_splitIds(Aggregator aggregator, String splitId1, String splitId2) throws ActionProcessingException {
- Message messageIn = MessageFactory.getInstance().getMessage();
- AggregationDetails aggrDetails;
- List<String> aggrTags = new ArrayList<String>();
-
- aggrDetails = new AggregationDetails("xx", 1, 2, 123123);
- aggrDetails.setSplitId(splitId1);
- aggrTags.add(aggrDetails.toString());
- Aggregator.setAggregatorTags(messageIn, aggrTags);
- aggregator.process(messageIn);
-
- aggrDetails = new AggregationDetails("cc", 1, 2, 123123);
- aggrDetails.setSplitId(splitId1);
- aggrTags.add(aggrDetails.toString());
- Aggregator.setAggregatorTags(messageIn, aggrTags);
- aggregator.process(messageIn);
-
- }
-
- private void assertNoAggregationTags(Message aggregator1Message) {
- List<String> aggrTags;
- aggrTags = Aggregator.getAggregatorTags(aggregator1Message);
- assertNull(aggrTags);
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,241 @@
+/*
+ * 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.actions.aggregation;
+
+import junit.framework.TestCase;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.*;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.ESBConfigUtil;
+import org.jboss.soa.esb.util.Util;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Tests for JBESB-1204 and JBESB-1331.
+ * <p/>
+ * Make sure the message aggregation info flows in the following scenario...
+ * <pre>
+ *
+ * |------------------ service1 ----------------|
+ * | |
+ * splitter1 --| |-- aggregator2 --
+ * | |--service2--| |
+ * |-- splitter2 --| |--aggregator1--|
+ * |--service3--|
+ *
+ * </pre>
+ *
+ * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
+ */
+public class Nested_Splits_UnitTest extends TestCase {
+
+ private TestCourier splitter2Courier; // no need for a courier for splitter1
+ private TestCourier service1Courier;
+ private TestCourier service2Courier;
+ private TestCourier service3Courier;
+ private TestCourier aggregator1Courier;
+ private TestCourier aggregator2Courier;
+
+ private StaticRouter splitter1;
+ private StaticRouter splitter2;
+ private StaticRouter service1;
+ private StaticRouter service2;
+ private StaticRouter service3;
+ private Aggregator aggregator1;
+ private Aggregator aggregator2;
+ private Aggregator aggregator3;
+
+ protected void setUp() throws Exception {
+ MockCourierFactory.install();
+ MockRegistry.install();
+
+ splitter2Courier = new TestCourier();
+ service1Courier = new TestCourier();
+ service2Courier = new TestCourier();
+ service3Courier = new TestCourier();
+ aggregator1Courier = new TestCourier();
+ aggregator2Courier = new TestCourier();
+
+ MockRegistry.register("test", "splitter2", splitter2Courier);
+ MockRegistry.register("test", "service1", service1Courier);
+ MockRegistry.register("test", "service2", service2Courier);
+ MockRegistry.register("test", "service3", service3Courier);
+ MockRegistry.register("test", "aggregator1", aggregator1Courier);
+ MockRegistry.register("test", "aggregator2", aggregator2Courier);
+
+ initaliseServices();
+ }
+
+ private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
+ ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-02.xml"));
+ ConfigTree splitter1Config = esbConfig.getActionConfig("null-listener", "splitter1-action");
+ ConfigTree splitter2Config = esbConfig.getActionConfig("null-listener", "splitter2-action");
+ ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
+ ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
+ ConfigTree service3Config = esbConfig.getActionConfig("null-listener", "service3-config");
+ ConfigTree aggregator1Config = esbConfig.getActionConfig("null-listener", "aggregator1-config");
+ ConfigTree aggregator2Config = esbConfig.getActionConfig("null-listener", "aggregator2-config");
+ ConfigTree aggregator3Config = esbConfig.getActionConfig("null-listener", "aggregator3-config");
+
+ splitter1 = new StaticRouter(splitter1Config);
+ splitter1.initialise();
+ splitter2 = new StaticRouter(splitter2Config);
+ splitter2.initialise();
+ service1 = new StaticRouter(service1Config);
+ service1.initialise();
+ service2 = new StaticRouter(service2Config);
+ service2.initialise();
+ service3 = new StaticRouter(service3Config);
+ service3.initialise();
+ aggregator1 = new Aggregator(aggregator1Config);
+ aggregator1.initialise();
+ aggregator2 = new Aggregator(aggregator2Config);
+ aggregator2.initialise();
+ aggregator3 = new Aggregator(aggregator3Config);
+ aggregator3.initialise();
+ }
+
+ protected void tearDown() throws Exception {
+ splitter1.destroy();
+ service1.destroy();
+ service2.destroy();
+ aggregator1.destroy();
+ MockRegistry.uninstall();
+ MockCourierFactory.uninstall();
+ }
+
+ /**
+ * |------------------ service1 ----------------|
+ * | |
+ * splitter1 --| |-- aggregator2 --
+ * | |--service2--| |
+ * |-- splitter2 --| |--aggregator1--|
+ * |--service3--|
+ */
+ public void test_nested_split() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, IOException, SAXException, ParserConfigurationException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Manually deliver the message to the splitter1 service...
+ splitter1.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // Manually deliver the message in splitter2Courier into splitter2...
+ splitter2.process(splitter2Courier.messages.get(0));
+ AggregationDetails service2Message = Aggregator.getAggregatorDetails(service2Courier.messages.get(0), 0);
+ assertNotNull(service2Message);
+
+ // Manually deliver the message in aggregator2Courier into aggregator2 (this is the message from service1)...
+ aggregator2.process(aggregator2Courier.messages.get(0));
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // Manually deliver the message in service3Courier into service3...
+ service3.process(service3Courier.messages.get(0));
+
+ // aggregator1Courier should have 2 messages in it... one from service2
+ // and one from service3...
+ assertEquals(2, aggregator1Courier.messages.size());
+
+ // Should be 2 aggrTags before aggregation...
+ List<String> aggrTags = Aggregator.getAggregatorTags(aggregator1Courier.messages.get(1));
+ assertEquals(2, aggrTags.size());
+
+ // Manually deliver the 2 messages to aggregator1...
+ aggregator1.process(aggregator1Courier.messages.get(0));
+ Message aggregator1Message = aggregator1.process(aggregator1Courier.messages.get(1));
+ assertNoAggregationTags(aggregator1Courier.messages.get(0));
+ assertNoAggregationTags(aggregator1Courier.messages.get(1));
+ aggrTags = Aggregator.getAggregatorTags(aggregator1Message);
+ assertEquals(1, aggrTags.size());
+ AggregationDetails aggregator1MessageAggrDetails = Aggregator.getAggregatorDetails(aggregator1Message, 0);
+ assertEquals(service1Message.getSeriesUuid(), aggregator1MessageAggrDetails.getSeriesUuid());
+
+ // Manually deliver the aggregator1Message to aggregator2...
+ Message aggregator2Message = aggregator2.process(aggregator1Message);
+ assertNoAggregationTags(aggregator1Message);
+ assertEquals(2, aggregator2Message.getAttachment().getUnnamedCount());
+ Message message1 = Util.deserialize((Serializable) aggregator2Message.getAttachment().itemAt(0));
+ assertNoAggregationTags(message1);
+ Message message2 = Util.deserialize((Serializable) aggregator2Message.getAttachment().itemAt(1));
+ assertNoAggregationTags(message2);
+ }
+
+ public void test_splitIds() throws ActionProcessingException {
+ // Should be allowed to pump messages with diff splitIds into aggregator2
+ // because there's no splitId set on it...
+ test_splitIds(aggregator2, "splitId-1", "splitId-2");
+
+ // Should get an error if I try the same with aggregator 3, coz it has
+ // a "splitId" set on it...
+ try {
+ test_splitIds(aggregator3, "splitId-x", "splitId-y");
+ fail("Expected ActionProcessingException");
+ } catch (ActionProcessingException e) {
+ assertEquals("Invalid aggregation config on aggregator 'aggregator3-config' . This aggregator is configured to only aggregate message with an aggregation 'spliId' of 'splitId1'. The splitId on the received message is 'splitId-x'. A nested aggregation point may be missing, or may have been bypassed.", e.getMessage());
+ }
+
+ // The following should work because the splitIds match the split ID on
+ // aggregator3's config (see action-configs-02.xml).
+ test_splitIds(aggregator3, "splitId1", "splitId1");
+
+ }
+
+ private void test_splitIds(Aggregator aggregator, String splitId1, String splitId2) throws ActionProcessingException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+ AggregationDetails aggrDetails;
+ List<String> aggrTags = new ArrayList<String>();
+
+ aggrDetails = new AggregationDetails("xx", 1, 2, 123123);
+ aggrDetails.setSplitId(splitId1);
+ aggrTags.add(aggrDetails.toString());
+ Aggregator.setAggregatorTags(messageIn, aggrTags);
+ aggregator.process(messageIn);
+
+ aggrDetails = new AggregationDetails("cc", 1, 2, 123123);
+ aggrDetails.setSplitId(splitId1);
+ aggrTags.add(aggrDetails.toString());
+ Aggregator.setAggregatorTags(messageIn, aggrTags);
+ aggregator.process(messageIn);
+
+ }
+
+ private void assertNoAggregationTags(Message aggregator1Message) {
+ List<String> aggrTags;
+ aggrTags = Aggregator.getAggregatorTags(aggregator1Message);
+ assertNull(aggrTags);
+ }
+}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,56 +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.actions.aggregation;
-
-import org.jboss.internal.soa.esb.couriers.MockCourier;
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.tests.XMLMessageUnitTest;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import junit.framework.Assert;
-
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
-*/
-class TestCourier extends MockCourier {
-
- public List<Message> messages = new ArrayList<Message>();
-
- public TestCourier() {
- super(true);
- }
-
- public boolean deliver(Message message) throws CourierException, MalformedEPRException {
- try {
- String xmlRepresentation = XMLMessageUnitTest.msgToXML((MessageImpl)message);
- messages.add(XMLMessageUnitTest.msgFromXML(xmlRepresentation));
- return true;
- } catch(Exception e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- return false;
- }
-}
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,56 @@
+/*
+ * 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.actions.aggregation;
+
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.tests.XMLMessageUnitTest;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import junit.framework.Assert;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+*/
+class TestCourier extends MockCourier {
+
+ public List<Message> messages = new ArrayList<Message>();
+
+ public TestCourier() {
+ super(true);
+ }
+
+ public boolean deliver(Message message) throws CourierException, MalformedEPRException {
+ try {
+ String xmlRepresentation = XMLMessageUnitTest.msgToXML((MessageImpl)message);
+ messages.add(XMLMessageUnitTest.msgFromXML(xmlRepresentation));
+ return true;
+ } catch(Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ }
+ return false;
+ }
+}
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,43 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
- <providers>
- <bus-provider name="null"><bus busid="null"/></bus-provider>
- </providers>
-
- <services>
- <service category="MessageRouting" name="SplitterService" description="Sends messages to N destinations">
-
- <listeners>
- <listener name="null-listener" busidref="null" />
- </listeners>
-
- <actions mep="OneWay">
-
- <action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="service1"/>
- <route-to service-category="test" service-name="service2"/>
- </property>
- </action>
-
- <action name="service1-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator"/>
- </property>
- </action>
-
- <action name="service2-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator"/>
- </property>
- </action>
-
- <action name="aggregator-config" class="org.jboss.soa.esb.actions.Aggregator">
- <property name="timeoutInMillies" value="2000"/>
- </action>
-
- </actions>
- </service>
- </services>
-</jbossesb>
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,43 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+ <providers>
+ <bus-provider name="null"><bus busid="null"/></bus-provider>
+ </providers>
+
+ <services>
+ <service category="MessageRouting" name="SplitterService" description="Sends messages to N destinations">
+
+ <listeners>
+ <listener name="null-listener" busidref="null" />
+ </listeners>
+
+ <actions mep="OneWay">
+
+ <action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="service1"/>
+ <route-to service-category="test" service-name="service2"/>
+ </property>
+ </action>
+
+ <action name="service1-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator"/>
+ </property>
+ </action>
+
+ <action name="service2-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator"/>
+ </property>
+ </action>
+
+ <action name="aggregator-config" class="org.jboss.soa.esb.actions.Aggregator">
+ <property name="timeoutInMillies" value="2000"/>
+ </action>
+
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,66 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
- <providers>
- <bus-provider name="null"><bus busid="null"/></bus-provider>
- </providers>
-
- <services>
- <service category="MessageRouting" name="SplitterService" description="Sends messages to N destinations">
-
- <listeners>
- <listener name="null-listener" busidref="null" />
- </listeners>
-
- <actions mep="OneWay">
-
- <action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="service1"/>
- <route-to service-category="test" service-name="splitter2"/>
- </property>
- </action>
-
- <action name="splitter2-action" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="service2"/>
- <route-to service-category="test" service-name="service3"/>
- </property>
- </action>
-
- <action name="service1-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator2"/>
- </property>
- </action>
-
- <action name="service2-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator1"/>
- </property>
- </action>
-
- <action name="service3-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator1"/>
- </property>
- </action>
-
- <action name="aggregator1-config" class="org.jboss.soa.esb.actions.Aggregator">
- <property name="timeoutInMillies" value="200000"/>
- </action>
-
- <action name="aggregator2-config" class="org.jboss.soa.esb.actions.Aggregator">
- <property name="timeoutInMillies" value="200000"/>
- </action>
-
- <!-- Used for splitId checking tests -->
- <action name="aggregator3-config" class="org.jboss.soa.esb.actions.Aggregator">
- <property name="timeoutInMillies" value="200000"/>
- <property name="splitId" value="splitId1"/>
- </action>
-
- </actions>
- </service>
- </services>
-</jbossesb>
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,66 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+ <providers>
+ <bus-provider name="null"><bus busid="null"/></bus-provider>
+ </providers>
+
+ <services>
+ <service category="MessageRouting" name="SplitterService" description="Sends messages to N destinations">
+
+ <listeners>
+ <listener name="null-listener" busidref="null" />
+ </listeners>
+
+ <actions mep="OneWay">
+
+ <action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="service1"/>
+ <route-to service-category="test" service-name="splitter2"/>
+ </property>
+ </action>
+
+ <action name="splitter2-action" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="service2"/>
+ <route-to service-category="test" service-name="service3"/>
+ </property>
+ </action>
+
+ <action name="service1-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator2"/>
+ </property>
+ </action>
+
+ <action name="service2-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator1"/>
+ </property>
+ </action>
+
+ <action name="service3-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator1"/>
+ </property>
+ </action>
+
+ <action name="aggregator1-config" class="org.jboss.soa.esb.actions.Aggregator">
+ <property name="timeoutInMillies" value="200000"/>
+ </action>
+
+ <action name="aggregator2-config" class="org.jboss.soa.esb.actions.Aggregator">
+ <property name="timeoutInMillies" value="200000"/>
+ </action>
+
+ <!-- Used for splitId checking tests -->
+ <action name="aggregator3-config" class="org.jboss.soa.esb.actions.Aggregator">
+ <property name="timeoutInMillies" value="200000"/>
+ <property name="splitId" value="splitId1"/>
+ </action>
+
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -208,6 +208,29 @@
assertEquals( Session.DUPS_OK_ACKNOWLEDGE, ackMode.getAcknowledgeModeInt() );
}
+ @Test
+ public void contstructor_non_transacted() throws CourierException, URISyntaxException
+ {
+ JMSEpr jmsEpr = new JMSEpr( ONE_ONE_PROTOCOL, expectedDestinationType, expectedDestination ,
+ expectedConnectionFactory,
+ nullEnvironment, expectedSelector,
+ NON_PERSISTENT);
+
+ assertEquals( false, jmsEpr.getTransacted() );
+ }
+
+ @Test
+ public void contstructor_transacted() throws CourierException, URISyntaxException
+ {
+ final boolean transacted = true;
+ JMSEpr jmsEpr = new JMSEpr( ONE_ONE_PROTOCOL, expectedDestinationType, expectedDestination ,
+ expectedConnectionFactory,
+ nullEnvironment, expectedSelector,
+ NON_PERSISTENT, transacted);
+
+ assertEquals( transacted, jmsEpr.getTransacted() );
+ }
+
private void assertDefaults(final String destination, final String connectionFactory, final String destinationType)
{
assertEquals( expectedDestination, destination );
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -25,16 +25,11 @@
import java.net.URI;
import java.net.URISyntaxException;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import junit.framework.TestCase;
-import org.jboss.internal.soa.esb.addressing.helpers.CallHelper;
+import org.jboss.internal.soa.esb.message.format.xml.CallImpl;
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.addressing.EPR;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
/**
* Unit tests for the Class class.
@@ -211,20 +206,9 @@
call.setReplyTo(getEPR("urn:replyTo", "replyToTag", "replyToValue")) ;
call.setTo(getEPR("urn:to", "toTag", "toValue")) ;
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ final String content = CallImpl.toXML(call) ;
+ final Call result = CallImpl.fromXML(content) ;
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
- Element header = doc.createElement("HEADER");
-
- doc.appendChild(header);
-
- CallHelper.toXML(call, doc, header);
-
- final Call result = CallHelper.fromXML(header) ;
-
assertEquals("Action URI", call.getAction(), result.getAction()) ;
assertEquals("FaultTo EPR", call.getFaultTo(), result.getFaultTo()) ;
assertEquals("From EPR", call.getFrom(), result.getFrom()) ;
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -22,27 +22,26 @@
package org.jboss.soa.esb.addressing.tests;
+import java.io.StringReader;
import java.io.StringWriter;
import java.net.URI;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.addressing.helpers.PortReferenceHelper;
+import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.PortReference;
import org.jboss.soa.esb.addressing.XMLUtil;
import org.jboss.soa.esb.addressing.eprs.EmailEpr;
import org.jboss.soa.esb.message.tests.XMLMessageUnitTest;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
/**
* Unit tests for the EPR class.
*
@@ -118,30 +117,27 @@
{
EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
- final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- final DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
- Element header = doc.createElement("header");
- Element fromElement = doc.createElementNS(XMLUtil.WSA_NAMESPACE_URI, XMLUtil.WSA_PREFIX+":"+XMLUtil.FROM_TAG);
+ final StringWriter writer = new StringWriter() ;
+ final XMLStreamWriter out = XMLHelper.getXMLStreamWriter(writer) ;
- doc.appendChild(header);
- header.appendChild(fromElement);
+ final QName header = new QName("header") ;
+ final String origHeaderURI = StreamHelper.writeStartElement(out, header) ;
+ PortReferenceHelper.toXML(out, XMLUtil.QNAME_FROM_TAG, email.getAddr()) ;
+ StreamHelper.writeEndElement(out, header.getPrefix(), origHeaderURI) ;
+ out.flush() ;
+
+ final String content = writer.toString() ;
+ log.debug("Exported XML: "+content);
+
+ final StringReader reader = new StringReader(content) ;
+ final XMLStreamReader in = XMLHelper.getXMLStreamReader(reader) ;
+ StreamHelper.checkNextStartTag(in, header) ;
+ StreamHelper.checkNextStartTag(in, XMLUtil.QNAME_FROM_TAG) ;
- PortReferenceHelper.toXML(header, doc, fromElement, email.getAddr(), false);
-
- final StringWriter sWriter = new StringWriter() ;
- final OutputFormat format = new OutputFormat() ;
- format.setIndenting(true) ;
-
- final XMLSerializer xmlS = new XMLSerializer(sWriter, format) ;
-
- xmlS.asDOMSerializer() ;
- xmlS.serialize(doc) ;
-
- log.debug("Exported XML: "+sWriter.toString());
+ PortReference pr = PortReferenceHelper.fromXML(in);
+ StreamHelper.checkEndTag(in, XMLUtil.QNAME_FROM_TAG) ;
+ StreamHelper.checkParentFinished(in) ;
- PortReference pr = PortReferenceHelper.fromXML(fromElement, false);
-
EPR basicEpr = new EPR(pr);
EmailEpr nEpr = new EmailEpr(basicEpr);
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,3 +1,25 @@
+/*
+ * 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.command;
import java.util.ArrayList;
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -38,7 +38,6 @@
import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.body.content.BytesBody;
import org.jboss.soa.esb.message.format.MessageFactory;
public class ListenerManagerJDBCUnitTest extends ListenerManagerFileUnitTest
@@ -54,7 +53,6 @@
clearMessages() ;
-
try
{
Statement stmt = getDbConnection().createStatement();
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -49,7 +49,7 @@
//Make sure this file exists
File configFile = new File(configFileName);
assertTrue("File '" + configFile + "' doesn't exist.", configFile.exists());
- //Remove the listener and gateway configuration files if the exist
+ //Remove the listener and gateway configuration files if they exist
File currentDir = configFile.getParentFile();
if (null==currentDir)
currentDir=new File("");
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -23,7 +23,7 @@
<sql-provider name="HSQLDB" url="jdbc:postgresql://myhost:5432/testDB" driver="org.postgresql.Driver" username="joe" password="secret">
<sql-bus busid="SQL-Test">
- <sql-message-filter tablename="testtable"/>
+ <sql-message-filter tablename="testtable" message-id-column="message_id" message-column="message" status-column="status" insert-timestamp-column="insert_timestamp"/>
</sql-bus>
</sql-provider>
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -5,7 +5,7 @@
-->
<jbossesb-listeners parameterReloadSecs="180">
<Bank-Listener listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="2" service-category="Bank" service-description="Bank Reconciliation Service" service-name="Reconciliation">
-<EPR acknowledge-mode="AUTO_ACKNOWLEDGE" connection-factory="ConnectionFactory" destination-name="queue/B" destination-type="topic" jndi-URL="jnp://localhost:1099" message-selector="service='Reconciliation'" persistent="true" protocol="jms"/>
+<EPR acknowledge-mode="AUTO_ACKNOWLEDGE" connection-factory="ConnectionFactory" destination-name="queue/B" destination-type="topic" jndi-URL="jnp://localhost:1099" message-selector="service='Reconciliation'" persistent="true" protocol="jms" transacted="false"/>
<action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter" propName="propValue">
This is some complex..
<!-- property -->
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1 +1 @@
-<?xml version="1.0" encoding="UTF-8"?><!-- NOTE: DO NOT MODIFY This file was auto-generated.--><jbossesb-gateways parameterReloadSecs="180"><Bank-JMS-Gateway acknowledge-mode="AUTO_ACKNOWLEDGE" connection-factory="com.xyz.provider.XYZConnectionFactory" destination-name="queue/A" destination-type="queue" gatewayClass="org.jboss.soa.esb.listeners.gateway.JmsGatewayListener" is-gateway="true" jndi-URL="xyz://server1:9876" jndi-context-factory="com.xyz.provider.NamingContextFactory" jndi-pkg-prefix="com.xyz" maxThreads="1" message-selector="service='Reconciliation'" persistent="true" protocol="jms" service-description="Bank Reconciliation Service" target-service-category="Bank" target-service-name="Reconciliation"/><Bank-HTTP-Gateway gatewayClass="org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener" is-gateway="true" jbr-serverBindAddress="192.168.1.111" jbr-serverBindPort="8765" jbr-serverProtocol="http" maxThreads="1" service-description="Bank Reconciliation Serv!
ice" target-service-category="Bank" target-service-name="Reconciliation"/></jbossesb-gateways>
+<?xml version="1.0" encoding="UTF-8"?><!-- NOTE: DO NOT MODIFY This file was auto-generated.--><jbossesb-gateways parameterReloadSecs="180"><Bank-JMS-Gateway acknowledge-mode="AUTO_ACKNOWLEDGE" connection-factory="com.xyz.provider.XYZConnectionFactory" destination-name="queue/A" destination-type="queue" gatewayClass="org.jboss.soa.esb.listeners.gateway.JmsGatewayListener" is-gateway="true" jndi-URL="xyz://server1:9876" jndi-context-factory="com.xyz.provider.NamingContextFactory" jndi-pkg-prefix="com.xyz" maxThreads="1" message-selector="service='Reconciliation'" persistent="true" protocol="jms" service-description="Bank Reconciliation Service" target-service-category="Bank" target-service-name="Reconciliation" transacted="false"/><Bank-HTTP-Gateway gatewayClass="org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener" is-gateway="true" jbr-serverBindAddress="192.168.1.111" jbr-serverBindPort="8765" jbr-serverProtocol="http" maxThreads="1" service-description="Bank !
Reconciliation Service" target-service-category="Bank" target-service-name="Reconciliation"/></jbossesb-gateways>
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -13,6 +13,7 @@
<property name="message-selector" value="service='Reconciliation'"/>
<property name="persistent" value="true" />
<property name="acknowledge-mode" value="AUTO_ACKNOWLEDGE" />
+ <property name="transacted" value="false" />
</bus>
</bus-provider>
@@ -29,6 +30,7 @@
<property name="message-selector" value="service='Reconciliation'" />
<property name="persistent" value="true" />
<property name="acknowledge-mode" value="AUTO_ACKNOWLEDGE" />
+ <property name="transacted" value="false" />
</bus>
</bus-provider>
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetterUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetterUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetterUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -110,6 +110,17 @@
assertEquals( propertyValue, toESBMessage.getProperties().getProperty( propertyKey )) ;
}
+ @Test
+ public void setPropertiesFromJMSMessage_withJMSRedelivererdProperty_false() throws JMSException
+ {
+ boolean redelivered = false;
+ fromJMSTextMessage.setJMSRedelivered( redelivered );
+
+ strategy.setPropertiesFromJMSMessage( fromJMSTextMessage , toESBMessage );
+
+ assertEquals( redelivered, toESBMessage.getProperties().getProperty( JMSPropertiesSetter.JMS_REDELIVERED )) ;
+ }
+
@Before
public void setup()
{
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -25,17 +25,26 @@
import junit.framework.TestCase;
import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.jboss.soa.esb.message.format.MessageFactory;
public class ActionProcessingPipelineUnitTest extends TestCase
{
+ public void testProperty() {
+
+ }
+
@Override
protected void setUp() throws Exception
{
super.setUp();
- MockActionInfo.reset() ;
+ MockActionInfo.reset();
+ System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+
+ com.arjuna.common.util.propertyservice.PropertyManager pm = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE);
+ pm.setProperty("javax.xml.registry.ConnectionFactoryClass", "org.apache.ws.scout.registry.ConnectionFactoryImpl");
}
/*
@@ -45,12 +54,12 @@
*
* Do the above for each type of action.
*/
-
public void testActionPipelineProcessor()
throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
-
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, MockActionPipelineProcessor.class.getName(),
null, null, null) ;
addAction(configTree, MockActionPipelineProcessor.class.getName(),
@@ -82,6 +91,8 @@
throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, MockActionPipelineProcessor.class.getName(),
null, null, null) ;
@@ -114,6 +125,8 @@
throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, MockActionPipelineProcessor.class.getName(),
"process", null, null) ;
@@ -148,6 +161,8 @@
throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, MockActionPipelineProcessor.class.getName(),
"process", null, null) ;
@@ -182,6 +197,8 @@
throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, MockActionLifecycleProcessor.class.getName(),
"process", null, null) ;
@@ -216,6 +233,8 @@
throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, MockActionLifecycleProcessor.class.getName(),
"process", null, null) ;
@@ -250,6 +269,8 @@
throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, MockActionProcessor.class.getName(),
"process", null, null) ;
@@ -284,6 +305,8 @@
throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, MockActionProcessor.class.getName(),
"process", null, null) ;
@@ -317,6 +340,8 @@
public void testErrorActionProcessorException() throws Exception
{
final ConfigTree configTree = new ConfigTree("parent");
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, ErrorActionProcessor.class.getName(), "process",
null, null);
@@ -341,6 +366,8 @@
public void testNPEActionProcessorException() throws Exception
{
final ConfigTree configTree = new ConfigTree("parent");
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, NPEActionProcessor.class.getName(), "process",
null, null);
@@ -366,6 +393,8 @@
throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG,
+ ListenerTagNames.MEP_ONE_WAY) ;
addAction(configTree, MockActionPipelineProcessorConstructorFailure.class.getName(),
null, null, null) ;
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounterUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounterUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounterUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -52,10 +52,14 @@
private ConfigTree createConfigTreeForScheduler()
{
- ConfigTree config = new ConfigTree( "cronScheduleListener" );
+ ConfigTree parent = new ConfigTree("parent");
+ parent.setAttribute("deployment", "sample.esb");
+
+ ConfigTree config = new ConfigTree( "cronScheduleListener", parent);
config.setAttribute( "composer", "class");
config.setAttribute( "listenerClass", "org.jboss.soa.esb.listeners.ScheduleListener" );
config.setAttribute( "scheduleidref", "cronTrigger");
+
return config;
}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/MessageAttachmentSerializeTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/MessageAttachmentSerializeTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/MessageAttachmentSerializeTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -27,15 +27,18 @@
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
import junit.framework.TestCase;
+import org.jboss.internal.soa.esb.message.format.xml.XMLUtil;
+import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
import org.jboss.soa.esb.message.Attachment;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
/**
* QA tests for the Message interface and implementations.
@@ -75,35 +78,40 @@
inp.readObject();
inp.close();
- assertEquals(old,oNew);
+ assertEquals("name1", old.get("name1"), oNew.get("name1")) ;
+ assertEquals("name2", old.get("name2"), oNew.get("name2")) ;
+ assertEquals("unnamed 0", old.itemAt(0), oNew.itemAt(0)) ;
+ assertEquals("unnamed 1", old.itemAt(1), oNew.itemAt(1)) ;
}
public void testXml() throws Exception
{
- DocumentBuilder oDB = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- Document oDoc = oDB.newDocument();
- Element oRoot = oDoc.createElement("root");
- oDoc.appendChild(oRoot);
-
- org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl
- old = new org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl();
- populateAttachment(old);
- old.toXML(oRoot);
-
- org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl
- oNew = new org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl();
- oNew.fromXML(oRoot);
+ final StringWriter writer = new StringWriter() ;
+ final XMLStreamWriter out = XMLHelper.getXMLStreamWriter(writer) ;
+ final String origURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_ATTACHMENT) ;
+
+ org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl old =
+ new org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl();
+ populateAttachment(old);
+ old.writeContent(out) ;
+
+ StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_ATTACHMENT.getPrefix(), origURI) ;
+
+ out.flush() ;
+
+ final String content = writer.toString() ;
+
+ final StringReader reader = new StringReader(content) ;
+ final XMLStreamReader in = XMLHelper.getXMLStreamReader(reader) ;
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_ATTACHMENT) ;
+
+ org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl oNew =
+ new org.jboss.internal.soa.esb.message.format.xml.AttachmentImpl(in);
- assertEquals(old,oNew);
-
- Document oD2 = oDB.newDocument();
- Element oR2 = oD2.createElement("root");
- oD2.appendChild(oR2);
- oNew.toXML(oR2);
-
- String s1 = Util.toString(oRoot);
- String s2 = Util.toString(oR2);
- assertEquals(s1,s2);
+ assertEquals("name1", old.get("name1"), oNew.get("name1")) ;
+ assertEquals("name2", old.get("name2"), oNew.get("name2")) ;
+ assertEquals("unnamed 0", old.itemAt(0), oNew.itemAt(0)) ;
+ assertEquals("unnamed 1", old.itemAt(1), oNew.itemAt(1)) ;
}
private void populateAttachment(Attachment att)
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/MessagePropertiesSerializeTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/MessagePropertiesSerializeTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/MessagePropertiesSerializeTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -27,15 +27,19 @@
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
import junit.framework.TestCase;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
+import org.jboss.internal.soa.esb.message.format.xml.XMLUtil;
+import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+
/**
* QA tests for the Message interface and implementations.
* @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
@@ -74,35 +78,36 @@
inp.readObject();
inp.close();
- assertEquals(old,oNew);
+ assertEquals("p1", old.getProperty("p1"), oNew.getProperty("p1")) ;
+ assertEquals("p2", old.getProperty("p2"), oNew.getProperty("p2")) ;
}
public void testXml() throws Exception
{
- DocumentBuilder oDB = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- Document oDoc = oDB.newDocument();
- Element oRoot = oDoc.createElement("root");
- oDoc.appendChild(oRoot);
-
- org.jboss.internal.soa.esb.message.format.xml.PropertiesImpl
- old = new org.jboss.internal.soa.esb.message.format.xml.PropertiesImpl();
- populateProperties(old);
- old.toXML(oRoot);
-
- org.jboss.internal.soa.esb.message.format.xml.PropertiesImpl
- oNew = new org.jboss.internal.soa.esb.message.format.xml.PropertiesImpl();
- oNew.fromXML(oRoot);
+ final StringWriter writer = new StringWriter() ;
+ final XMLStreamWriter out = XMLHelper.getXMLStreamWriter(writer) ;
+ final String origURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_PROPERTIES) ;
+
+ org.jboss.internal.soa.esb.message.format.xml.PropertiesImpl old =
+ new org.jboss.internal.soa.esb.message.format.xml.PropertiesImpl();
+ populateProperties(old);
+ old.writeContent(out) ;
+
+ StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_PROPERTIES.getPrefix(), origURI) ;
+
+ out.flush() ;
+
+ final String content = writer.toString() ;
+
+ final StringReader reader = new StringReader(content) ;
+ final XMLStreamReader in = XMLHelper.getXMLStreamReader(reader) ;
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_PROPERTIES) ;
+
+ org.jboss.internal.soa.esb.message.format.xml.PropertiesImpl oNew =
+ new org.jboss.internal.soa.esb.message.format.xml.PropertiesImpl(in);
- assertEquals(old,oNew);
-
- Document oD2 = oDB.newDocument();
- Element oR2 = oD2.createElement("root");
- oD2.appendChild(oR2);
- oNew.toXML(oR2);
-
- String s1 = Util.toString(oRoot);
- String s2 = Util.toString(oR2);
- assertEquals(s1,s2);
+ assertEquals("p1", old.getProperty("p1"), oNew.getProperty("p1")) ;
+ assertEquals("p2", old.getProperty("p2"), oNew.getProperty("p2")) ;
}
private void populateProperties(org.jboss.soa.esb.message.Properties props)
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -26,11 +26,7 @@
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.io.StringWriter;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import junit.framework.TestCase;
import org.apache.log4j.Logger;
@@ -39,11 +35,8 @@
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
-import org.w3c.dom.Document;
+import org.jboss.soa.esb.util.Util;
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
/**
* Unit tests for the Class class.
*
@@ -55,6 +48,7 @@
private Logger log = Logger.getLogger( AttachmentUnitTest.class );
public void testSerializeAttachment()
+ throws Exception
{
Message msg = MessageFactory.getInstance().getMessage(
MessageType.JAVA_SERIALIZED);
@@ -77,10 +71,6 @@
catch (IllegalArgumentException ex)
{
}
- catch (Exception ex)
- {
- fail(ex.toString());
- }
assertEquals(at.getUnnamedCount(), 2);
@@ -101,28 +91,22 @@
int count = at.getUnnamedCount();
- try
- {
- ByteArrayOutputStream s = new ByteArrayOutputStream();
- ObjectOutputStream o = new ObjectOutputStream(s);
+ ByteArrayOutputStream s = new ByteArrayOutputStream();
+ ObjectOutputStream o = new ObjectOutputStream(s);
- o.writeObject(msg);
- o.close();
+ o.writeObject(msg);
+ o.close();
- ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
- ObjectInputStream io = new ObjectInputStream(is);
+ ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+ ObjectInputStream io = new ObjectInputStream(is);
- MessageImpl nImpl = (MessageImpl) io.readObject();
+ MessageImpl nImpl = (MessageImpl) io.readObject();
- assertEquals(nImpl.getAttachment().getUnnamedCount(), count);
- }
- catch (Exception ex)
- {
- fail(ex.toString());
- }
+ assertEquals(nImpl.getAttachment().getUnnamedCount(), count);
}
public void testXMLAttachment()
+ throws Exception
{
Message msg = MessageFactory.getInstance().getMessage(
MessageType.JBOSS_XML);
@@ -145,10 +129,6 @@
catch (IllegalArgumentException ex)
{
}
- catch (Exception ex)
- {
- fail(ex.toString());
- }
assertEquals(at.getUnnamedCount(), 2);
@@ -169,41 +149,11 @@
int count = at.getUnnamedCount();
- try
- {
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
- org.jboss.internal.soa.esb.message.format.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg;
-
- doc = theImpl.toXML(doc);
-
- StringWriter sWriter = new StringWriter();
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
-
- XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
- xmlS.asDOMSerializer();
- xmlS.serialize(doc);
-
- String documentAsString = sWriter.toString();
-
- log.debug("Message looks like: " + documentAsString);
-
- org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
-
- nImpl.fromXML(doc);
-
- assertEquals(nImpl.getAttachment().getUnnamedCount(), count);
- }
- catch (Exception ex)
- {
- log.error( ex );
-
- fail(ex.toString());
- }
+ final String documentAsString = (String)Util.serialize(msg) ;
+ log.debug("Message looks like: " + documentAsString);
+ final Message nImpl = Util.deserialize(documentAsString) ;
+
+ assertEquals(nImpl.getAttachment().getUnnamedCount(), count);
}
}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -26,23 +26,15 @@
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.io.StringWriter;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import junit.framework.TestCase;
import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
-import org.w3c.dom.Document;
+import org.jboss.soa.esb.util.Util;
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
/**
* Unit tests for the Class class.
*
@@ -68,33 +60,11 @@
assertEquals(msg.getBody().get("foo"), "bar");
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
-
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
- MessageImpl theImpl = (MessageImpl) msg;
+ final String documentAsString = (String)Util.serialize(msg) ;
- doc = theImpl.toXML(doc);
-
- StringWriter sWriter = new StringWriter();
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
-
- XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
- xmlS.asDOMSerializer();
- xmlS.serialize(doc);
-
- String documentAsString = sWriter.toString();
-
- MessageImpl nImpl = new MessageImpl();
-
log.debug("Document is "+documentAsString);
- nImpl.fromXML(doc);
+ final Message nImpl = Util.deserialize(documentAsString);
assertEquals(nImpl.getBody().get("foo"), "bar");
}
@@ -121,33 +91,12 @@
assertEquals(msg.getBody().get("foo"), new Boolean(true));
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- factory.setNamespaceAware(true);
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
- MessageImpl theImpl = (MessageImpl) msg;
+ final String documentAsString = (String)Util.serialize(msg) ;
- doc = theImpl.toXML(doc);
-
- StringWriter sWriter = new StringWriter();
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
-
- XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
- xmlS.asDOMSerializer();
- xmlS.serialize(doc);
-
- String documentAsString = sWriter.toString();
-
- MessageImpl nImpl = new MessageImpl();
-
- log.debug("Document is "+documentAsString);
+ log.debug("Document is "+documentAsString);
+
+ final Message nImpl = Util.deserialize(documentAsString);
- nImpl.fromXML(doc);
-
assertEquals(nImpl.getBody().get("foo"), new Boolean(true));
}
catch (Exception ex)
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,229 @@
+/*
+ * 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.message.tests;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.ObjectInputStream;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.message.format.DeferredDeserialisationException;
+import org.jboss.soa.esb.message.Attachment;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.Properties;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * Unit tests for checking deserialisation of old formats and just in time resolving
+ * of object values.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+
+public class DeserializedValuesMessageUnitTest extends TestCase
+{
+ public void testOldSerializedAttachmentDeserialisation()
+ throws Exception
+ {
+ final Attachment attachment = (Attachment)deserialise("old_attachment.ser") ;
+ validateOldAttachment(attachment) ;
+ }
+
+ public void testOldSerializedBodyDeserialisation()
+ throws Exception
+ {
+ final Body body = (Body)deserialise("old_body.ser") ;
+ validateOldBody(body) ;
+ }
+
+ public void testOldSerializedPropertiesDeserialisation()
+ throws Exception
+ {
+ final Properties properties = (Properties)deserialise("old_properties.ser") ;
+ validateOldProperties(properties) ;
+ }
+
+ public void testOldSerializedMessageDeserialisation()
+ throws Exception
+ {
+ final Message message = (Message)deserialise("old_message.ser") ;
+ validateOldAttachment(message.getAttachment()) ;
+ validateOldBody(message.getBody()) ;
+ validateOldProperties(message.getProperties()) ;
+ }
+
+ public void testOldXMLMessageDeserialisation()
+ throws Exception
+ {
+ final String contents = getContents("old_message.xml") ;
+ final Message message = Util.deserialize(contents) ;
+ validateOldAttachment(message.getAttachment()) ;
+ validateOldBody(message.getBody()) ;
+ validateOldProperties(message.getProperties()) ;
+ }
+
+ public void testNewSerializedAttachmentDeserialisation()
+ throws Exception
+ {
+ final Attachment attachment = (Attachment)deserialise("new_attachment.ser") ;
+ validateNewAttachment(attachment) ;
+ }
+
+ public void testNewSerializedBodyDeserialisation()
+ throws Exception
+ {
+ final Body body = (Body)deserialise("new_body.ser") ;
+ validateNewBody(body) ;
+ }
+
+ public void testNewSerializedPropertiesDeserialisation()
+ throws Exception
+ {
+ final Properties properties = (Properties)deserialise("new_properties.ser") ;
+ validateNewProperties(properties) ;
+ }
+
+ public void testNewSerializedMessageDeserialisation()
+ throws Exception
+ {
+ final Message message = (Message)deserialise("new_message.ser") ;
+ validateNewAttachment(message.getAttachment()) ;
+ validateNewBody(message.getBody()) ;
+ validateNewProperties(message.getProperties()) ;
+ }
+
+ public void testNewXMLMessageDeserialisation()
+ throws Exception
+ {
+ final String contents = getContents("new_message.xml") ;
+ final Message message = Util.deserialize(contents) ;
+ validateNewAttachment(message.getAttachment()) ;
+ validateNewBody(message.getBody()) ;
+ validateNewProperties(message.getProperties()) ;
+ }
+
+ private void validateOldAttachment(final Attachment attachment)
+ {
+ assertEquals("unnamed count", 1, attachment.getUnnamedCount()) ;
+ assertEquals("named count", 1, attachment.getNamedCount()) ;
+ final Object namedAttachment = attachment.get("testAttribute") ;
+ assertEquals("Named attachment", "Named value", namedAttachment) ;
+ final Object unnamedAttachment = attachment.itemAt(0) ;
+ assertEquals("Unnamed attachment", "Unnamed value", unnamedAttachment) ;
+ }
+
+ private void validateOldBody(final Body body)
+ {
+ final Object bodyValue = body.get() ;
+ assertEquals("Body value", "Body value", bodyValue) ;
+ }
+
+ private void validateOldProperties(final Properties properties)
+ {
+ final Object propertyValue = properties.getProperty("testProperty") ;
+ assertEquals("Property value", "Property value", propertyValue) ;
+ }
+
+ private void validateNewAttachment(final Attachment attachment)
+ {
+ assertEquals("unnamed count", 1, attachment.getUnnamedCount()) ;
+ assertEquals("named count", 1, attachment.getNamedCount()) ;
+ try
+ {
+ attachment.get("testAttribute") ;
+ fail("Expected DeferredDeserialisationException for named attachment") ;
+ }
+ catch (final DeferredDeserialisationException dse) {}
+
+ try
+ {
+ attachment.itemAt(0) ;
+ fail("Expected DeferredDeserialisationException for unnamed attachment") ;
+ }
+ catch (final DeferredDeserialisationException dse) {}
+ }
+
+ private void validateNewBody(final Body body)
+ {
+ try
+ {
+ body.get() ;
+ fail("Expected DeferredDeserialisationException for body contents") ;
+ }
+ catch (final DeferredDeserialisationException dse) {}
+ }
+
+ private void validateNewProperties(final Properties properties)
+ {
+ try
+ {
+ properties.getProperty("testProperty") ;
+ fail("Expected DeferredDeserialisationException for named property") ;
+ }
+ catch (final DeferredDeserialisationException dse) {}
+ }
+
+ private Object deserialise(final String resource)
+ throws IOException, ClassNotFoundException
+ {
+ final InputStream is = getClass().getResourceAsStream(resource) ;
+ try
+ {
+ final ObjectInputStream ois = new ObjectInputStream(is) ;
+ return ois.readObject() ;
+ }
+ finally
+ {
+ is.close() ;
+ }
+ }
+
+ private String getContents(final String resource)
+ throws IOException
+ {
+ final InputStream is = getClass().getResourceAsStream(resource) ;
+ try
+ {
+ final InputStreamReader isr = new InputStreamReader(is) ;
+ final StringBuilder sb = new StringBuilder() ;
+ final char[] buffer = new char[256] ;
+ while(true)
+ {
+ final int count = isr.read(buffer) ;
+ if (count <= 0)
+ {
+ break ;
+ }
+ sb.append(buffer, 0, count) ;
+ }
+ return sb.toString();
+ }
+ finally
+ {
+ is.close() ;
+ }
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -26,12 +26,8 @@
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.io.StringWriter;
import java.net.URI;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import junit.framework.TestCase;
import org.apache.log4j.Logger;
@@ -39,11 +35,8 @@
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
-import org.w3c.dom.Document;
+import org.jboss.soa.esb.util.Util;
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
/**
* Unit tests for the Class class.
*
@@ -111,31 +104,12 @@
assertEquals(msg.getFault().getCode(), code);
assertEquals(msg.getFault().getReason(), "because");
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
- org.jboss.internal.soa.esb.message.format.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg;
+ final String documentAsString = (String)Util.serialize(msg) ;
- doc = theImpl.toXML(doc);
-
- StringWriter sWriter = new StringWriter();
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
-
- XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
- xmlS.asDOMSerializer();
- xmlS.serialize(doc);
-
- String documentAsString = sWriter.toString();
-
- log.debug("Message looks like: " + documentAsString);
+ log.debug("Message looks like: " + documentAsString);
+
+ final Message nImpl = Util.deserialize(documentAsString);
- org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
-
- nImpl.fromXML(doc);
-
assertEquals(nImpl.getFault().getReason(), "because");
}
catch (Exception ex)
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -27,16 +27,13 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import junit.framework.TestCase;
import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
-import org.w3c.dom.Document;
+import org.jboss.soa.esb.util.Util;
/**
* Unit tests for the Class class.
@@ -136,19 +133,11 @@
try
{
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
- org.jboss.internal.soa.esb.message.format.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg;
+ final String documentAsString = (String)Util.serialize(msg) ;
- doc = theImpl.toXML(doc);
+ final Message nImpl = Util.deserialize(documentAsString);
- org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
-
- nImpl.fromXML(doc);
-
- assertEquals(nImpl.getProperties().getProperty("foo"), "bar");
+ assertEquals(nImpl.getProperties().getProperty("foo"), "bar");
}
catch (Exception ex)
{
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,140 @@
+/*
+ * 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.message.tests;
+
+import java.io.Serializable;
+
+import org.jboss.internal.soa.esb.message.format.serialized.SerializedValueImpl;
+
+import junit.framework.TestCase;
+
+/**
+ * Unit tests for checking serialised wrapping of values.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+
+public class SerializedValueUnitTest extends TestCase
+{
+ public void testObjectTypes()
+ {
+ // Objects
+ verifyEquality("Null value", null) ;
+ verifyEquality("Boolean type", Boolean.TRUE) ;
+ verifyEquality("Byte type", Byte.valueOf((byte)1)) ;
+ verifyEquality("Short type", Short.valueOf((short)2)) ;
+ verifyEquality("Character type", Character.valueOf((char)3)) ;
+ verifyEquality("Integer type", Integer.valueOf(4)) ;
+ verifyEquality("Long type", Long.valueOf(5)) ;
+ verifyEquality("Float type", Float.valueOf(6)) ;
+ verifyEquality("Double type", Double.valueOf(7)) ;
+ verifyEquality("String type", "8") ;
+ final SerializedValueImpl wrapped = (SerializedValueImpl)SerializedValueImpl.wrap(new NonNativeType()) ;
+ verifyEquality("Wrapped type", wrapped) ;
+ }
+
+ public void testBaseTypeArrays()
+ {
+ // base type arrays
+ verifyEquality("boolean array type", new boolean[] {true, false}) ;
+ verifyEquality("byte array type", new byte[] {0, 1}) ;
+ verifyEquality("short array type", new short[] {2, 3}) ;
+ verifyEquality("char array type", new char[] {4, 5}) ;
+ verifyEquality("int array type", new int[] {6, 7}) ;
+ verifyEquality("long array type", new long[] {8, 9}) ;
+ verifyEquality("float array type", new float[] {10, 11}) ;
+ verifyEquality("double array type", new double[] {12, 13}) ;
+ }
+
+ public void testBaseTypeNestedArrays()
+ {
+ // base type nested arrays
+ verifyEquality("boolean nested array type", new boolean[][] {{true, false}, {true, false}}) ;
+ verifyEquality("byte nested array type", new byte[][] {{0, 1}, {0, 1}}) ;
+ verifyEquality("short nested array type", new short[][] {{2, 3}, {2, 3}}) ;
+ verifyEquality("char nested array type", new char[][] {{4, 5}, {4, 5}}) ;
+ verifyEquality("int nested array type", new int[][] {{6, 7}, {6, 7}}) ;
+ verifyEquality("long nested array type", new long[][] {{8, 9}, {8, 9}}) ;
+ verifyEquality("float nested array type", new float[][] {{10, 11}, {10, 11}}) ;
+ verifyEquality("double nested array type", new double[][] {{12, 13}, {12, 13}}) ;
+ }
+
+ public void testObjectTypeArrays()
+ {
+ // object type arrays
+ verifyEquality("Boolean array type", new Boolean[] {Boolean.TRUE}) ;
+ verifyEquality("Byte array type", new Byte[] {Byte.valueOf((byte)1)}) ;
+ verifyEquality("Short array type", new Short[] {Short.valueOf((short)2)}) ;
+ verifyEquality("Character array type", new Character[] {Character.valueOf((char)3)}) ;
+ verifyEquality("Integer array type", new Integer[] {Integer.valueOf(4)}) ;
+ verifyEquality("Long array type", new Long[] {Long.valueOf(5)}) ;
+ verifyEquality("Float array type", new Float[] {Float.valueOf(6)}) ;
+ verifyEquality("Double array type", new Double[] {Double.valueOf(7)}) ;
+ verifyEquality("String array type", new String[] {"8"}) ;
+ final SerializedValueImpl wrapped = (SerializedValueImpl)SerializedValueImpl.wrap(new NonNativeType()) ;
+ verifyEquality("Wrapped type", new SerializedValueImpl[] {wrapped}) ;
+ }
+
+ public void testObjectTypeNestedArrays()
+ {
+ // object type nested arrays
+ verifyEquality("Boolean nested array type", new Boolean[][] {{Boolean.TRUE}, {Boolean.TRUE}}) ;
+ verifyEquality("Byte nested array type", new Byte[][] {{Byte.valueOf((byte)1)}, {Byte.valueOf((byte)1)}}) ;
+ verifyEquality("Short nested array type", new Short[][] {{Short.valueOf((short)2)}, {Short.valueOf((short)2)}}) ;
+ verifyEquality("Character nested array type", new Character[][] {{Character.valueOf((char)3)}, {Character.valueOf((char)3)}}) ;
+ verifyEquality("Integer nested array type", new Integer[][] {{Integer.valueOf(4)}, {Integer.valueOf(4)}}) ;
+ verifyEquality("Long nested array type", new Long[][] {{Long.valueOf(5)}, {Long.valueOf(5)}}) ;
+ verifyEquality("Float nested array type", new Float[][] {{Float.valueOf(6)}, {Float.valueOf(6)}}) ;
+ verifyEquality("Double nested array type", new Double[][] {{Double.valueOf(7)}, {Double.valueOf(7)}}) ;
+ verifyEquality("String nested array type", new String[][] {{"8"}, {"8"}}) ;
+ final SerializedValueImpl wrapped = (SerializedValueImpl)SerializedValueImpl.wrap(new NonNativeType()) ;
+ verifyEquality("Wrapped type", new SerializedValueImpl[][] {{wrapped}, {wrapped}}) ;
+ }
+
+ public void testNonNativeType()
+ {
+ verifyWrapped("Non-native type", new NonNativeType()) ;
+ }
+
+ private void verifyEquality(final String message, final Serializable value)
+ {
+ final Serializable serializable = SerializedValueImpl.wrap(value) ;
+ if (value != null)
+ {
+ assertNotNull(message, serializable) ;
+ }
+ assertEquals(message, value, serializable) ;
+ }
+
+ private void verifyWrapped(final String message, final Serializable value)
+ {
+ final Serializable serializable = SerializedValueImpl.wrap(value) ;
+ assertNotNull(message, serializable) ;
+ assertEquals(message, SerializedValueImpl.class, serializable.getClass()) ;
+ }
+
+ private class NonNativeType implements Serializable
+ {
+ private static final long serialVersionUID = 6703031480417642685L;
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -22,30 +22,19 @@
package org.jboss.soa.esb.message.tests;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import junit.framework.TestCase;
-
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
import org.jboss.soa.esb.addressing.eprs.*;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.body.content.BytesBody;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
+import org.jboss.soa.esb.util.Util;
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+import java.net.URL;
/**
* Unit tests for the Class class.
@@ -550,42 +539,12 @@
public static String msgToXML(final MessageImpl msg)
throws Exception
{
- final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() ;
-
- factory.setNamespaceAware(true);
-
- final DocumentBuilder builder = factory.newDocumentBuilder() ;
- Document doc = builder.newDocument() ;
-
- doc = msg.toXML(doc) ;
-
- final StringWriter sWriter = new StringWriter() ;
- final OutputFormat format = new OutputFormat() ;
- format.setIndenting(true) ;
-
- final XMLSerializer xmlS = new XMLSerializer(sWriter, format) ;
-
- xmlS.asDOMSerializer() ;
- xmlS.serialize(doc) ;
-
- return sWriter.toString() ;
+ return (String) Util.serialize(msg);
}
public static MessageImpl msgFromXML(final String xmlRepresentation)
throws Exception
{
- final StringReader stringReader = new StringReader(xmlRepresentation) ;
- final InputSource inputSource = new InputSource(stringReader) ;
-
- final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() ;
-
- factory.setNamespaceAware(true);
-
- final DocumentBuilder builder = factory.newDocumentBuilder() ;
- final Document doc = builder.parse(inputSource) ;
-
- final MessageImpl message = new MessageImpl() ;
- message.fromXML(doc) ;
- return message ;
+ return (MessageImpl) Util.deserialize(xmlRepresentation);
}
}
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_attachment.ser (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_attachment.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_body.ser (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_body.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.ser (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Envelope>
+ <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"/>
+ <Context/>
+ <Body>
+ <Content>
+ <Key><![CDATA[b3JnLmpib3NzLnNvYS5lc2IubWVzc2FnZS5kZWZhdWx0RW50cnk=]]></Key>
+ <Value>
+ <marshalunmarshal>
+ <plugin-type>urn:xml/marshalunmarshal/plugin/serialization</plugin-type><![CDATA[rO0ABXNyABxrbnJjLnNlcmlhbGlzYXRpb24uQm9keVZhbHVlFUC+gJ5+pZsCAAB4cA==]]></marshalunmarshal>
+ </Value>
+ </Content>
+ </Body>
+ <Attachment>
+ <UnNamed><![CDATA[rO0ABXNyAB9rbnJjLnNlcmlhbGlzYXRpb24uVW5uYW1lZFZhbHVlR5i5iw0twBwCAAB4cA==]]></UnNamed>
+ <Named name="testAttribute"><![CDATA[rO0ABXNyAB1rbnJjLnNlcmlhbGlzYXRpb24uTmFtZWRWYWx1ZS3thWzi1Ho9AgAAeHA=]]></Named>
+ </Attachment>
+ <Properties>
+ <Property>
+ <Key><![CDATA[dGVzdFByb3BlcnR5]]></Key>
+ <Value><![CDATA[rO0ABXNyACBrbnJjLnNlcmlhbGlzYXRpb24uUHJvcGVydHlWYWx1ZYvcf2hIglUuAgAAeHA=]]></Value>
+ </Property>
+ </Properties>
+</Envelope>
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_properties.ser (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_properties.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_attachment.ser (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_attachment.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_body.ser (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_body.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.ser (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Envelope>
+ <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"/>
+ <Context/>
+ <Body>
+ <Content>
+ <Key><![CDATA[b3JnLmpib3NzLnNvYS5lc2IubWVzc2FnZS5kZWZhdWx0RW50cnk=]]></Key>
+ <Value>
+ <marshalunmarshal>
+ <plugin-type>urn:xml/marshalunmarshal/plugin/serialization</plugin-type><![CDATA[rO0ABXQACkJvZHkgdmFsdWU=]]></marshalunmarshal>
+ </Value>
+ </Content>
+ </Body>
+ <Attachment>
+ <UnNamed><![CDATA[rO0ABXQADVVubmFtZWQgdmFsdWU=]]></UnNamed>
+ <Named name="testAttribute"><![CDATA[rO0ABXQAC05hbWVkIHZhbHVl]]></Named>
+ </Attachment>
+ <Properties>
+ <Property>
+ <Key><![CDATA[dGVzdFByb3BlcnR5]]></Key>
+ <Value><![CDATA[rO0ABXQADlByb3BlcnR5IHZhbHVl]]></Value>
+ </Property>
+ </Properties>
+</Envelope>
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_properties.ser (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_properties.ser)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/JMSUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/JMSUtil.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/JMSUtil.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,3 +1,23 @@
+/*
+ * 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,
+ */
+
package org.jboss.soa.esb.testutils;
import org.apache.log4j.Logger;
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,35 @@
+/*
+ * 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.testutils;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Null action.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NullAction extends AbstractActionPipelineProcessor {
+ public Message process(Message message) throws ActionProcessingException {
+ return null;
+ }
+}
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,85 +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.util;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.message.Message;
-
-/**
- * AbstractCommandVehicle unit tests.
- * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
- */
-public class AbstractCommandVehicleUnitTest extends TestCase {
-
- static class MyVehicle extends AbstractCommandVehicle
- {
- private static final long serialVersionUID = 1L;
- @Override
- public String getCommandOpcodeKey() { return "myCmdOpcodeKey"; }
- @Override
- public String getCommandValuesTag() { return "CMD_VALUES_TAG"; }
- @Override
- public Operation operatorFromString(String value) {return Operation.valueOf(value); }
-
- public static final String VAL1 = "value1_tag";
-
- public enum Operation
- {
- oper1
- ,oper2
- }
-
- public MyVehicle(Enum command) { super(command); }
- public MyVehicle(Message message) { super(message); }
-
- public void setVal1(String obj) { super.setValue(VAL1, obj); }
- public String getVal1() { return (String)_values.get(VAL1); }
- }
-
- public void test_01()
- {
- String compareValue = "12345";
-
- MyVehicle vh1 = new MyVehicle(MyVehicle.Operation.oper1);
- vh1.setVal1(compareValue);
- Message msg = vh1.toCommandMessage();
-
- MyVehicle newVh = new MyVehicle(msg);
- assertEquals(MyVehicle.Operation.oper1, newVh.getOperator());
- assertEquals(compareValue, newVh.getVal1());
- }
-
- public void test_02()
- {
- String compareValue = "ZZZZZZZZZZZZZZ";
-
- MyVehicle vh1 = new MyVehicle(MyVehicle.Operation.oper2);
- vh1.setVal1(compareValue);
- Message msg = vh1.toCommandMessage();
-
- MyVehicle newVh = new MyVehicle(msg);
- assertEquals(MyVehicle.Operation.oper2, newVh.getOperator());
- assertEquals(compareValue, newVh.getVal1());
- }
-
-}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/aggregator/aggregation_service/jbossesb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/aggregator/aggregation_service/jbossesb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/aggregator/aggregation_service/jbossesb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -24,11 +24,14 @@
<action class="org.jboss.soa.esb.actions.Aggregator" name="Aggregator">
<property name="timeoutInMillies" value="60000"/>
</action>
+
+ <!-- add transformation action to aggregate the attachments into 1 message -->
+ <action name="assemble" class="org.jboss.soa.esb.samples.quickstart.aggregator.AggregatedMessageAssembler" />
+
<action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="An aggregated message was created" />
+ <property name="message" value="An aggregated message was created (see attachments)" />
</action>
- <!-- add transformation action to aggregate the attachments into 1 message -->
- </actions>
+ </actions>
</service>
</services>
</jbossesb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,65 @@
+/*
+ * 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.samples.quickstart.aggregator;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Attachment;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+
+import java.io.Serializable;
+
+/**
+ * Assemble an aggregated message.
+ * <p/>
+ * This is just an example. Of course a real worl example would do something more
+ * useful than just append the messages together in a StringBuffer!
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class AggregatedMessageAssembler extends AbstractActionPipelineProcessor {
+
+ public AggregatedMessageAssembler(ConfigTree config) {
+ }
+
+ public Message process(Message message) throws ActionProcessingException {
+ Attachment attachments = message.getAttachment();
+ int attachmentCount = attachments.getUnnamedCount();
+ StringBuffer assemblyBuffer = new StringBuffer();
+
+ for (int i = 0; i < attachmentCount; i++) {
+ try {
+ Message aggrMessage = Util.deserialize((Serializable) attachments.itemAt(i));
+ String payload = aggrMessage.getBody().get().toString();
+
+ assemblyBuffer.append("**** Payload from Message Attachment " + i + ":\n");
+ assemblyBuffer.append(payload + "\n");
+ } catch (Exception e) {
+ // Not an aggregated message attachment... continue...
+ }
+ }
+
+ message.getBody().add(assemblyBuffer.toString());
+
+ return message;
+ }
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -38,22 +38,15 @@
<target name="runtest">
<echo message="This target is not implemented for this quickstart. Please run 'ant deployProcess' and 'ant startProcess'"/>
</target>
-
- <target name="refreshProcess" description="Moves the changed process definition to the server without restarting all the services">
- <echo>Moves the changed process definition to the server without restarting all the services</echo>
- <copy overwrite="true"
- file="${project.process.dir}/processdefinition.xml"
- tofile="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.esb/processdefinition.xml"/>
- </target>
- <target name="deployProcess" depends="compile" description="Sends a message to deploy the process definition">
- <echo>Sends a message to deploy the process definition</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage" failonerror="true">
- <arg value="${jbossesb.inputdir}"/>
- <arg value=".deployProcessGW"/> <!-- file ext -->
- <arg value="Go Deploy It"/> <!-- the file contents -->
- <classpath refid="exec-classpath"/>
- </java>
+ <target name="deployProcess" description="deploys the process definition" depends="jbossesb-dependencies">
+ <echo>Deploy the process definition</echo>
+ <taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
+ <classpath refid="exec-classpath"/>
+ </taskdef>
+ <deployToServer>
+ <fileset dir="${basedir}/processDefinition" includes="*"/>
+ </deployToServer>
</target>
<target name="startProcess" depends="compile" description="Sends a message to start the process instance">
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -75,23 +75,6 @@
</providers>
<services>
- <service category="BPM_Orchestration_Deploy_Service" name="Deploy_Service"
- description="BPM Orchestration Sample 1: Use this service to deploy a process instance">
- <listeners>
- <fs-listener name="Gateway" busidref="deployGwChannel"
- maxThreads="1"
- is-gateway="true" />
- <fs-listener name="ESB-Listener" busidref="deployEsbChannel"
- maxThreads="1"/>
- </listeners>
- <actions>
- <action name="DeployFromFile"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="DeployProcessDefinition" />
- <property name="process-definition-file" value="/processdefinition.xml" />
- </action>
- </actions>
- </service>
<service category="BPM_Orchestration_Starter_Service" name="Starter_Service"
description="BPM Orchestration Sample 1: Use this service to start a process instance">
@@ -105,42 +88,24 @@
<actions>
<action name="spy1"
class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
-
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<!-- move the body.getContents() into jBPM -->
<action name="create_new_process_instance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="NewProcessInstanceCommand" />
+ <property name="command" value="StartProcessInstanceCommand" />
<property name="process-definition-name" value="processDefinition2"/>
<property name="actor" value="FrankSinatra"/>
- <property name="object-paths">
+ <property name="esbToBpmVars">
<!-- esb-name maps to getBody().get("eVar1") -->
- <object-path esb="eVar1" bpm="counter" value="45" />
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- </property>
-
- </action>
-
- <action name="displayProcessInfo"
- class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.ProcessInfo"/>
-
- <action name="spy2"
- class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
-
- <action name="signal_the_new_process_instance"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="SignalCommand" />
- <property name="process-definition-name" value="processDefinition2"/>
- <property name="object-paths">
- <!-- esb-name maps to getBody().get("eVar1") -->
- <object-path esb="eVar1" bpm="counter" value="45" />
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- </property>
+ <mapping esb="eVar1" bpm="counter" value="45" />
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ </property>
</action>
- <action name="spy3"
- class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
-
- </actions>
+ <action name="spy2"
+ class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
+
+ </actions>
</service>
<service category="BPM_Orchestration_Service1" name="Service1"
@@ -164,7 +129,8 @@
<actions>
<action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
<property name="script" value="/scripts/service2.groovy" />
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration_Service3" name="Service3"
@@ -177,6 +143,7 @@
<action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
<property name="script" value="/scripts/service3.groovy" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration_ResultsService" name="ResultsService"
@@ -187,7 +154,8 @@
</listeners>
<actions>
<action name="spy"
- class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
+ class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/gpd.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/gpd.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/gpd.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,30 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
-<root-container name="processDefinition2" width="948" height="681">
- <node name="start" x="81" y="38" width="140" height="40">
- <edge>
+<process-diagram name="processDefinition2" width="744" height="728">
+ <node name="start" x="29" y="19" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="node1" x="236" y="97" width="140" height="40">
- <edge>
+ <node name="node1" x="132" y="99" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="node2" x="61" y="162" width="140" height="40">
- <edge>
+ <node name="node2" x="38" y="172" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="node3" x="259" y="176" width="140" height="40">
- <edge>
+ <node name="node3" x="183" y="247" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="end1" x="162" y="330" width="140" height="40"/>
- <node name="Send Results" x="57" y="251" width="140" height="40">
- <edge>
+ <node name="end1" x="46" y="415" width="140" height="40"/>
+ <node name="Send Results" x="45" y="322" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
-</root-container>
+</process-diagram>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,55 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
-
+
<process-definition
- xmlns="" name="processDefinition2">
+ name="processDefinition2">
<start-state name="start">
<event type="node-leave">
<action name="action1" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.process_actions.MyBPMActionHandler" config-type="bean"></action>
</event>
- <transition name="" to="node1"></transition>
+ <transition to="node1"></transition>
</start-state>
<node name="node1">
<action name="action2" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration_Service1</esbCategoryName>
<esbServiceName>Service1</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ </esbToBpmVars>
</action>
- <transition name="" to="node2"></transition>
+ <transition to="node2"></transition>
</node>
<node name="node2">
<action name="action2" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration_Service2</esbCategoryName>
<esbServiceName>Service2</esbServiceName>
<millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody"/>
+ </esbToBpmVars>
</action>
- <transition name="" to="node3"></transition>
+ <transition to="node3"></transition>
</node>
<node name="node3">
<action name="action2" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration_Service3</esbCategoryName>
- <esbServiceName>Service3</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <esbServiceName>Service3</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody"/>
+ </esbToBpmVars>
</action>
- <transition name="" to="Send Results"></transition>
+ <transition to="Send Results"></transition>
</node>
<end-state name="end1"></end-state>
<node name="Send Results">
@@ -58,16 +56,15 @@
</event>
<action name="action2" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration_ResultsService</esbCategoryName>
- <esbServiceName>ResultsService</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <esbServiceName>ResultsService</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody"/>
+ </esbToBpmVars>
</action>
- <transition name="" to="end1"></transition>
+ <transition to="end1"></transition>
</node>
</process-definition>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processimage.jpg
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/readme.txt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -12,28 +12,19 @@
'[SchemaExport] schema export complete' to appear on the console.
4. Switch back to "Window2", type 'ant startProcess'.
5. Switch back to Application Server console to see the output from the ESB.
- 6. To undeploy the esb archive, type 'ant undeploy' ("Window1").
+
+ Sample Output from "ant startProcess":
+ ======================================
+ 10:42:14,386 INFO [MessageSpy] Body: Start It Up
+ 10:42:14,463 INFO [ProcessInfo] Token ID: 1
+ 10:42:14,463 INFO [ProcessInfo] Process Name: null
+ 10:42:14,463 INFO [ProcessInfo] Process Version: null
+ 10:42:14,463 INFO [MessageSpy] Body: Start It Up
+
+ 6. In the http://localhost:8080/jbpm-console, you can check that the "processDefinition2" is
+ deployed and that there is one running instance.
+ 7. To undeploy the esb archive, type 'ant undeploy' ("Window1").
-Sample Output from "ant startProcess":
-======================================
-10:42:14,386 INFO [MessageSpy] Body: Start It Up
-10:42:14,463 INFO [ProcessInfo] Token ID: 1
-10:42:14,463 INFO [ProcessInfo] Process Name: null
-10:42:14,463 INFO [ProcessInfo] Process Version: null
-10:42:14,463 INFO [MessageSpy] Body: Start It Up
-10:42:14,482 WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
-10:42:15,182 INFO [STDOUT] 1********** Begin Service 1 ***********
-10:42:15,263 INFO [STDOUT] In: Start It Up
-10:42:15,263 INFO [STDOUT] Out: Service 1 Start It Up
-10:42:15,263 INFO [STDOUT] ************ End Service 1 ************
-10:42:15,747 INFO [STDOUT] 2********** Begin Service 2 ***********
-10:42:15,747 INFO [STDOUT] In: Start It Up
-10:42:15,747 INFO [STDOUT] Out: Service 2 Start It Up
-10:42:15,748 INFO [STDOUT] ************ End Service 2 ************
-10:42:16,889 INFO [STDOUT] 3********** Begin Service 3 ***********
-10:42:16,890 INFO [STDOUT] In: Start It Up
-10:42:16,890 INFO [STDOUT] Out: Service 3 Start It Up
-10:42:16,890 INFO [STDOUT] ************ End Service 3 ************
-10:42:17,596 INFO [STDOUT] Executed by the process, not by the ESB
-10:42:17,653 INFO [MessageSpy] Body: Start It Up
-10:42:18,637 INFO [MessageSpy] Body: Start It Up
+
+
+
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/ProcessInfo.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/ProcessInfo.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/ProcessInfo.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -22,7 +22,6 @@
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
import org.apache.log4j.Logger;
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/process_actions/MyBPMActionHandler.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/process_actions/MyBPMActionHandler.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/process_actions/MyBPMActionHandler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -20,10 +20,8 @@
*/
package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.process_actions;
-import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.Token;
public class MyBPMActionHandler implements ActionHandler
{
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/test/SendTestMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/test/SendTestMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/test/SendTestMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -29,27 +29,26 @@
public class SendTestMessage {
public SendTestMessage() {
-
}
- public static void main(String args[]) throws Exception
- {
- System.out.println("Here");
- String inputDirectory = args[0];
- String fileExt = args[1];
- String fileContents = args[2];
-
+
+ public void sendMessage(String inputDirectory, String fileExtension, String fileContents) {
String prefix = Long.toString(Calendar.getInstance().getTimeInMillis());
- File x = File.createTempFile(prefix + "_",fileExt,new File(inputDirectory));
-
-
+ File x = null;
try {
+ x = File.createTempFile(prefix + "_",fileExtension,new File(inputDirectory));
BufferedWriter out = new BufferedWriter(new FileWriter(x));
out.write(fileContents.toCharArray());
out.close();
} catch (Exception e) {
System.out.println("Error while writing the file: " + x.getAbsolutePath());
System.out.println(e.getMessage());
- }
+ }
+ }
+
+ public static void main(String args[]) throws Exception
+ {
+ SendTestMessage stm = new SendTestMessage();
+ stm.sendMessage(args[0], args[1], args[2]);
}
}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -31,12 +31,14 @@
<echo>Use "ant deployProcess" followed by "ant startProcess"</echo>
</target>
- <target name="deployProcess" depends="compile" description="Sends a message to deploy the process definition">
- <echo>Sends a message to deploy the process definition</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.test.SendJMSMessageDeploy" failonerror="true">
- <arg value="Hello World: Deploy the process def"/>
- <classpath refid="exec-classpath"/>
- </java>
+ <target name="deployProcess" description="deploys the process definition" depends="jbossesb-dependencies">
+ <echo>Deploy the process definition</echo>
+ <taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
+ <classpath refid="exec-classpath"/>
+ </taskdef>
+ <deployToServer>
+ <fileset dir="${basedir}/processDefinition" includes="*"/>
+ </deployToServer>
</target>
<target name="startProcess" depends="compile" description="Sends a message to start the process instance">
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -62,27 +62,8 @@
</providers>
<services>
- <service category="BPM_Orchestration2_Deploy_Service" name="Deploy_Service"
- description="BPM Orchestration Sample 2: Use this service to deploy a process instance">
- <listeners>
- <jms-listener name="JMS-Gateway" busidref="deployGwChannel"
- maxThreads="1"
- is-gateway="true" />
- <jms-listener name="ESB-Listener" busidref="deployEsbChannel"
- maxThreads="1"/>
- </listeners>
- <actions>
- <action name="DeployFromFile"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="DeployProcessDefinition" />
- <property name="process-definition-file" value="/processDefinition/processdefinition.xml" />
- </action>
- <action name="deployed-message" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="Process Definition Deployed" />
- </action>
- </actions>
- </service>
+
<service category="BPM_Orchestration2_Starter_Service" name="Starter_Service"
description="BPM Orchestration Sample 2: Use this service to start a process instance">
<listeners>
@@ -93,48 +74,23 @@
maxThreads="1"/>
</listeners>
<actions>
-
- <action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+ <action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true"/>
- </action>
- <!--
- <action name="create_new_process_instance"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="NewProcessInstanceCommand" />
- <property name="process-definition-name" value="bpm_orchestration2Process"/>
- <property name="object-paths">
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- </property>
- </action>
-
- <action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="printfull" value="true"/>
- </action>
-
- <action name="signal_the_new_process_instance"
+ </action>
+ <action name="start_a_new_process_instance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="SignalCommand" />
- <property name="process-definition-name" value="bpm_orchestration2Process"/>
- <property name="object-paths">
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- </property>
- </action>
- -->
-
- <action name="start_a_new_process_instance"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="StartProcessInstanceCommand" />
<property name="process-definition-name" value="bpm_orchestration2Process"/>
- <property name="object-paths">
- <object-path esb="eVar1" bpm="counter" value="45" />
- <object-path esb="BODY_CONTENT" bpm="theBody" />
+ <property name="esbToBpmVars">
+ <mapping esb="eVar1" bpm="counter" value="45" />
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
</property>
- </action>
-
- <action name="dump3" class="org.jboss.soa.esb.actions.SystemPrintln">
+ </action>
+
+ <action name="dump3" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true"/>
- </action>
-
+ </action>
</actions>
</service>
@@ -156,7 +112,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service1_Alert" />
</action>
-
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service2" name="Service2"
@@ -174,6 +130,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service2_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service3" name="Service3"
@@ -191,6 +148,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service3_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -207,6 +165,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service4_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service5" name="Service5"
@@ -222,6 +181,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service5_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service6" name="Service6"
@@ -238,6 +198,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service6_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service7" name="Service7"
@@ -254,6 +215,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service7_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -272,6 +234,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_results_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="results-message" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message" value="SUCCESS!" />
</action>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/gpd.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/gpd.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/gpd.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,66 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
-<root-container name="bpm_orchestration2Process" width="804" height="579">
- <node name="start" x="225" y="10" width="140" height="40">
- <edge>
+<process-diagram name="bpm_orchestration2Process" width="729" height="728">
+ <node name="start" x="0" y="10" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="Receive Order" x="114" y="81" width="140" height="40">
- <edge>
+ <node name="Receive Order" x="214" y="13" width="140" height="40">
+ <transition>
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="Validate Order" x="341" y="80" width="140" height="40">
- <edge>
+ <node name="Validate Order" x="247" y="131" width="140" height="40">
+ <transition>
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="fork1" x="170" y="234" width="325" height="25">
- <edge>
+ <node name="fork1" x="185" y="273" width="200" height="25">
+ <transition name="tr2">
<label x="5" y="-10"/>
- </edge>
- <edge>
+ </transition>
+ <transition name="to Dallas WHSE">
<label x="5" y="-10"/>
- </edge>
- <edge>
+ </transition>
+ <transition name="to Los Angeles WHSE">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="Los Angeles WHSE" x="49" y="294" width="140" height="40">
- <edge>
+ <node name="Los Angeles WHSE" x="20" y="340" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="Dallas WHSE" x="235" y="295" width="140" height="40">
- <edge>
+ <node name="Dallas WHSE" x="221" y="385" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="Atlanta WHSE" x="426" y="297" width="140" height="40">
- <edge>
+ <node name="Atlanta WHSE" x="425" y="335" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="join1" x="143" y="379" width="341" height="25">
- <edge>
+ <node name="join1" x="190" y="460" width="200" height="25">
+ <transition>
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="Shipment Notice" x="246" y="432" width="140" height="40">
- <edge>
+ <node name="Shipment Notice" x="232" y="532" width="140" height="40">
+ <transition name="">
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="end1" x="246" y="499" width="140" height="40"/>
- <node name="Credit Check" x="116" y="155" width="140" height="40">
- <edge>
+ <node name="end1" x="509" y="530" width="140" height="40"/>
+ <node name="Credit Check" x="165" y="73" width="140" height="40">
+ <transition>
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="Inventory Check" x="335" y="156" width="140" height="40">
- <edge>
+ <node name="Inventory Check" x="192" y="193" width="140" height="40">
+ <transition>
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
-</root-container>
+</process-diagram>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/processdefinition.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/processdefinition.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/processdefinition.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<process-definition
- xmlns="urn:jbpm.org:jpdl-3.1" name="bpm_orchestration2Process">
+ name="bpm_orchestration2Process">
<start-state name="start">
<transition name="" to="Receive Order"></transition>
</start-state>
@@ -10,13 +10,12 @@
<action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service1</esbCategoryName>
<esbServiceName>Service1</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ </esbToBpmVars>
</action>
<transition to="Credit Check"></transition>
</node>
@@ -25,13 +24,12 @@
<action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service2</esbCategoryName>
<esbServiceName>Service2</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody"/>
+ </esbToBpmVars>
</action>
<transition to="Inventory Check"></transition>
</node>
@@ -45,14 +43,13 @@
<action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service5</esbCategoryName>
- <esbServiceName>Service5</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <esbServiceName>Service5</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ </esbToBpmVars>
</action>
<transition name="" to="join1"></transition>
@@ -61,14 +58,13 @@
<action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service6</esbCategoryName>
- <esbServiceName>Service6</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <esbServiceName>Service6</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ </esbToBpmVars>
</action>
<transition name="" to="join1"></transition>
@@ -78,14 +74,13 @@
<action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service7</esbCategoryName>
- <esbServiceName>Service7</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <esbServiceName>Service7</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody"/>
+ </esbToBpmVars>
</action>
<transition name="" to="join1"></transition>
@@ -99,12 +94,12 @@
<action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_ResultsService</esbCategoryName>
<esbServiceName>ResultsService</esbServiceName>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody"/>
+ </esbToBpmVars>
</action>
@@ -116,14 +111,13 @@
<action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service3</esbCategoryName>
- <esbServiceName>Service3</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <esbServiceName>Service3</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ </esbToBpmVars>
</action>
<transition to="Validate Order"></transition>
</node>
@@ -131,14 +125,13 @@
<action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service4</esbCategoryName>
- <esbServiceName>Service4</esbServiceName>
- <millisToWaitForResponse>5000</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <esbServiceName>Service4</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ </esbToBpmVars>
</action>
<transition to="fork1"></transition>
</node>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/processDefinition/processimage.jpg
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/readme.txt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -73,45 +73,45 @@
Sample Output from "ant startProcess":
======================================
-11:18:50,656 INFO [STDOUT] 11111111111 Begin Service 1 11111111111
+11:18:50,656 INFO [STDOUT] ** Begin Receive Order - Service 1 **
11:18:50,765 INFO [STDOUT] In: Getting Started
11:18:50,765 INFO [STDOUT] Out: Getting Started 'Receive Order'
-11:18:50,765 INFO [STDOUT] 111111111111 End Service 1 111111111111
-11:18:51,640 INFO [STDOUT] 33333333333 Begin Service 3 33333333333
+11:18:50,765 INFO [STDOUT] ** End Receive Order - Service 1 **
+11:18:51,640 INFO [STDOUT] ** Begin Credit Check - Service 3 **
11:18:51,640 INFO [STDOUT] In: Getting Started 'Receive Order'
11:18:51,640 INFO [STDOUT] Out: Getting Started 'Receive Order' 'Credit Check'
-11:18:51,640 INFO [STDOUT] 333333333333 End Service 3 333333333333
-11:18:52,312 INFO [STDOUT] 22222222222 Begin Service 2 22222222222
+11:18:51,640 INFO [STDOUT] ** End Credit Check - Service 3 **
+11:18:52,312 INFO [STDOUT] ** Begin Validate Order - Service 2 **
11:18:52,312 INFO [STDOUT] In: Getting Started 'Receive Order' 'Credit Check'
11:18:52,312 INFO [STDOUT] Out: Getting Started 'Receive Order' 'Credit Check'
'Validate Order'
-11:18:52,312 INFO [STDOUT] 222222222222 End Service 2 222222222222
-11:18:52,828 INFO [STDOUT] 44444444444 Begin Service 4 44444444444
+11:18:52,312 INFO [STDOUT] ** End Validate Order - Service 2 **
+11:18:52,828 INFO [STDOUT] ** Begin Inventory Check - Service 4 **
11:18:52,828 INFO [STDOUT] In: Getting Started 'Receive Order' 'Credit Check'
'Validate Order'
11:18:52,828 INFO [STDOUT] Out: Getting Started 'Receive Order' 'Credit Check'
'Validate Order' 'Inventory Check'
-11:18:52,828 INFO [STDOUT] 444444444444 End Service 4 444444444444
-11:18:53,359 INFO [STDOUT] 77777777777 Begin Service 7 77777777777
+11:18:52,828 INFO [STDOUT] ** End Inventory Check - Service 4 **
+11:18:53,359 INFO [STDOUT] ** Begin Atlanta - Service 7 **
11:18:53,359 INFO [STDOUT] In: Getting Started 'Receive Order' 'Credit Check'
'Validate Order' 'Inventory Check'
11:18:53,359 INFO [STDOUT] Out: Getting Started 'Receive Order' 'Credit Check'
'Validate Order' 'Inventory Check' 'Atlanta'
-11:18:53,359 INFO [STDOUT] 777777777777 End Service 7 777777777777
-11:18:53,734 INFO [STDOUT] 66666666666 Begin Service 6 66666666666
+11:18:53,359 INFO [STDOUT] ** End Atlanta - Service 7 **
+11:18:53,734 INFO [STDOUT] ** Begin Dallas - Service 6 **
11:18:53,734 INFO [STDOUT] In: Getting Started 'Receive Order' 'Credit Check'
'Validate Order' 'Inventory Check' 'Atlanta'
11:18:53,734 INFO [STDOUT] Out: Getting Started 'Receive Order' 'Credit Check'
'Validate Order' 'Inventory Check' 'Atlanta' 'Dallas'
-11:18:53,734 INFO [STDOUT] 666666666666 End Service 6 666666666666
-11:18:54,078 INFO [STDOUT] 55555555555 Begin Service 5 55555555555
+11:18:53,734 INFO [STDOUT] ** End Dallas - Service 6 **
+11:18:54,078 INFO [STDOUT] ** Begin Los Angeles - Service 5 **
11:18:54,093 INFO [STDOUT] In: Getting Started 'Receive Order' 'Credit Check'
'Validate Order' 'Inventory Check' 'Atlanta' 'Dallas'
11:18:54,093 INFO [STDOUT] Out: Getting Started 'Receive Order' 'Credit Check'
'Validate Order' 'Inventory Check' 'Atlanta' 'Dallas' 'Los Angeles'
-11:18:54,093 INFO [STDOUT] 555555555555 End Service 5 555555555555
+11:18:54,093 INFO [STDOUT] ** End Los Angeles - Service 5 **
11:18:54,234 INFO [STDOUT] Very simple BPM Process ActionHandler
11:18:54,453 INFO [MessageSpy] Body: Getting Started 'Receive Order' 'Credit C
heck' 'Validate Order' 'Inventory Check' 'Atlanta' 'Dallas' 'Los Angeles'
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/scripts/service6.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/scripts/service6.groovy 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/scripts/service6.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -8,4 +8,4 @@
println "Out: " + message.getBody().get()
-println "** Begin Dallas - Service 6 **"
\ No newline at end of file
+println "** End Dallas - Service 6 **"
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration2/test/SendJMSMessageDeploy.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration2/test/SendJMSMessageDeploy.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration2/test/SendJMSMessageDeploy.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -88,8 +88,8 @@
public static void main(String args[]) throws Exception
- {
- SendJMSMessageDeploy sm = new SendJMSMessageDeploy();
+ {
+ SendJMSMessageDeploy sm = new SendJMSMessageDeploy();
try {
sm.setupConnection();
sm.sendAMessage(args[0]);
@@ -99,8 +99,7 @@
"\n**** Exception: " + e.getMessage());
} finally {
sm.stop();
- }
-
+ }
}
}
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3
___________________________________________________________________
Name: svn:ignore
+ build
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -35,18 +35,19 @@
<echo>Use "ant deployProcess" followed by "ant startProcess"</echo>
</target>
- <target name="deployProcess" depends="compile" description="Sends a message to deploy the process definition">
- <echo>Sends a message to deploy the process definition</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.bpm_orchestration3.test.SendJMSMessage" failonerror="true">
- <arg value="queue/quickstart_bpm_orchestration3_deploy_Request_gw"/>
- <arg value="Hello Deploy"/>
- <classpath refid="exec-classpath"/>
- </java>
- </target>
+ <target name="deployProcess" description="deploys the process definition" depends="jbossesb-dependencies">
+ <echo>Deploy the process definition</echo>
+ <taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
+ <classpath refid="exec-classpath"/>
+ </taskdef>
+ <deployToServer>
+ <fileset dir="${basedir}/processDefinition" includes="*"/>
+ </deployToServer>
+ </target>
<target name="startProcess" depends="compile" description="Sends a message to start a new process instance">
<echo>Sends a message to start a new process instance</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.bpm_orchestration3.test.SendJMSMessage" failonerror="true">
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration3.test.SendJMSMessage" failonerror="true">
<arg value="queue/quickstart_bpm_orchestration3_start_Request_gw"/>
<arg value="Hello start"/>
<arg value="${token}"/>
@@ -60,11 +61,11 @@
<target name="signalProcess" depends="compile" description="Sends a message to signal a process instance">
<echo>Sends a message to signal a process instance</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.bpm_orchestration3.test.SendJMSMessage" failonerror="true">
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration3.test.SendJMSMessage" failonerror="true">
<arg value="queue/quickstart_bpm_orchestration3_signal_Request_gw"/>
<arg value="Hello Signal"/>
<arg value="${token}"/>
- <classpath refid="exec-classpath"/>
+ <classpath refid="exec-classpath"/>
</java>
</target>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -48,26 +48,6 @@
</providers>
<services>
- <service category="BPM_Orchestration3_Deploy_Service" name="Deploy_Service"
- description="BPM Orchestration Sample 3: Use this service to deploy a process instance">
- <listeners>
- <jms-listener name="JMS-Gateway" busidref="deployGwChannel"
- maxThreads="1"
- is-gateway="true" />
- <jms-listener name="ESB-Listener" busidref="deployEsbChannel"
- maxThreads="1"/>
- </listeners>
- <actions>
- <action name="DeployFromFile"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="DeployProcessDefinition" />
- <property name="process-definition-file" value="/processDefinition/processdefinition.xml" />
- </action>
- <action name="deployed-message" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="Process Definition Deployed" />
- </action>
- </actions>
- </service>
<service category="BPM_Orchestration3_Starter_Service" name="Starter_Service"
description="BPM Orchestration Sample 3: Use this service to start a process instance">
@@ -78,30 +58,24 @@
<jms-listener name="ESB-Listener" busidref="startEsbChannel"
maxThreads="1"/>
</listeners>
- <actions>
-
+ <actions mep="OneWay">
<action name="setupKey" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration3.esb_actions.SetupKey">
</action>
<action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message" value="After" />
<property name="printfull" value="true"/>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="start_a_new_process_instance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="StartProcessInstanceCommand" />
<property name="process-definition-name" value="bpm_orchestration3Process"/>
<property name="key" value="businessKey"/>
- <property name="object-paths">
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- <object-path esb="contentsAsString" bpm="theData" />
+ <property name="esbToBpmVars">
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ <mapping esb="contentsAsString" bpm="theData" />
</property>
</action>
- <!--
- <action name="dump3" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="After" />
- <property name="printfull" value="true"/>
- </action>
- -->
</actions>
</service>
@@ -114,7 +88,7 @@
<jms-listener name="ESB-Listener" busidref="signalEsbChannel"
maxThreads="1"/>
</listeners>
- <actions>
+ <actions mep="OneWay">
<!--
<action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message" value="SIGNAL" />
@@ -126,9 +100,9 @@
<action name="signal_a_process_instance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="SignalCommand" />
- <property name="object-paths">
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- <object-path esb="body" bpm="theData" />
+ <property name="esbToBpmVars">
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ <mapping esb="body" bpm="theData" />
</property>
</action>
@@ -137,7 +111,8 @@
<property name="message" value="After" />
<property name="printfull" value="true"/>
</action>
- -->
+ -->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -148,7 +123,7 @@
<jms-listener name="ESB-Listener" busidref="service1EsbChannel"
maxThreads="1"/>
</listeners>
- <actions>
+ <actions mep="OneWay">
<!--
<action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true"/>
@@ -164,6 +139,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration3_service1_Alert" />
</action>
-->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration3_Service2" name="Service2"
@@ -186,6 +162,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service2_Alert" />
</action>
-->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration3_Service3" name="Service3"
@@ -208,6 +185,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service3_Alert" />
</action>
-->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/gpd.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/gpd.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/gpd.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
-<root-container name="bpm_orchestration3Process" width="869" height="681">
- <node name="start-state1" x="115" y="32" width="132" height="36">
- <edge>
+<process-diagram name="bpm_orchestration3Process" width="728" height="728">
+ <node name="start-state1" x="178" y="60" width="140" height="40">
+ <transition>
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="end-state1" x="118" y="319" width="132" height="36"/>
- <node name="Service 1" x="116" y="95" width="132" height="36">
- <edge>
+ <node name="Service 1" x="183" y="160" width="140" height="40">
+ <transition>
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="Service 2" x="117" y="173" width="132" height="36">
- <edge>
+ <node name="Service 2" x="193" y="257" width="140" height="40">
+ <transition>
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
- <node name="Service 3" x="118" y="247" width="132" height="36">
- <edge>
+ <node name="Service 3" x="201" y="345" width="140" height="40">
+ <transition>
<label x="5" y="-10"/>
- </edge>
+ </transition>
</node>
-</root-container>
+ <node name="end-state1" x="205" y="444" width="140" height="40"/>
+</process-diagram>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/processdefinition.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/processdefinition.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/processdefinition.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<process-definition xmlns="" name="bpm_orchestration3Process">
+<process-definition name="bpm_orchestration3Process">
<start-state name="start-state1">
@@ -15,12 +15,12 @@
BPM_Orchestration3_Service1
</esbCategoryName>
<esbServiceName>Service1</esbServiceName>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody"/>
+ </esbToBpmVars>
</action>
<transition to="Service 2"></transition>
</node>
@@ -32,12 +32,12 @@
BPM_Orchestration3_Service2
</esbCategoryName>
<esbServiceName>Service2</esbServiceName>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ </esbToBpmVars>
</action>
<transition to="Service 3"></transition>
</node>
@@ -49,12 +49,12 @@
BPM_Orchestration3_Service3
</esbCategoryName>
<esbServiceName>Service3</esbServiceName>
- <jbpmToEsbVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="theBody" esb="BODY_CONTENT" />
- </returnVars>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
+ </esbToBpmVars>
</action>
<transition to="end-state1"></transition>
</node>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/processDefinition/processimage.jpg
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/readme.txt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -19,41 +19,41 @@
'Process Definition Deployed:' to appear on the console.
3. In Window1, type 'ant startProcess -Dtoken=Demo1'
Switch back to Application/ESB Server console and look for
- [STDOUT] ** Begin Service 1 **
- [STDOUT] In: Hello start
- [STDOUT] jbpmTokenId: 12
- [STDOUT] Out: Hello start 'Service 1'
- [STDOUT] ** End Service 1 **
- Note: "12" will be unique to your installation and will change with each process instance you start
- It is important to remember this number as it is used in the next step .
- 4. In Window1, type 'ant signalProcess -Dtoken=12'
+ [STDOUT] ** Begin Service 1 **
+ [STDOUT] In : Hello start
+ [STDOUT] Out: Hello start 'Service 1'
+ [STDOUT] ** End Service 1 **
+
+ 4. Enter the jBPM console (http://localhost:8080/jbpm-console/sa/processes.jsf), and
+ login. Once logged in, examine each process that you see using the "Examine" link
+ and find the "Instance ID" for the process that has a Key of "Demo1".
+ 5. In Window1, if the Instance ID you found in Step 4 was 1,
+ type 'ant -Dtoken=1 signalProcess'
+ Substitute whatever number you found for an instance id in the environment variable
+ part of that statement (-Dtoken=[Instance ID]).
Switch back to Application/ESB Server console and look for:
- [SetupSignal] --------------------------------
- [SetupSignal] jbpmTokenId: 12
- [SetupSignal] Body: Hello Signal
- [SetupSignal] --------------------------------
- [STDOUT] ** Begin Service 2 **
- [STDOUT] In: Hello Signal
- [STDOUT] jbpmTokenId: 12
- [STDOUT] Out: Hello Signal 'Service 2'
- [STDOUT] ** End Service 2 **
+ [SetupSignal] --------------------------------
+ [SetupSignal] jbpmTokenId: 1
+ [SetupSignal] Body: Hello Signal
+ [SetupSignal] --------------------------------
+ [STDOUT] ** Begin Service 2 **
+ [STDOUT] In: Hello Signal
+ [STDOUT] Out: Hello Signal 'Service 2'
+ [STDOUT] ** End Service 2 **
+ [STDOUT] ** Begin Service 3 **
+ [STDOUT] In: Hello Signal 'Service 2'
+ [STDOUT] Out: Hello Signal 'Service 2' 'Service 3'
+ [STDOUT] ** End Service 3 **
+ [SetupSignal] --------------------------------
+ [SetupSignal] jbpmTokenId: 1
+ [SetupSignal] Body: Hello Signal
+ [SetupSignal] --------------------------------
+
Note: The STDOUT messages are from the 3 groovy scripts representing the logic of
each service.
- 5. In Window1, type 'ant signalProcess -Dtoken=12'
- Switch back to Application/ESB Server console and look for:
- [SetupSignal] --------------------------------
- [SetupSignal] jbpmTokenId: 12
- [SetupSignal] Body: Hello Signal
- [SetupSignal] --------------------------------
- [STDOUT] ** Begin Service 3 **
- [STDOUT] In: Hello Signal
- [STDOUT] Out: Hello Signal 'Service 3'
- [STDOUT] ** End Service 3 **
- Note: this is the final service call and the process instance now waits at node 3.
- The next signal moves it to the end state.
- 6. In Window1, type 'ant signalProcess -Dtoken=12'
- 7. To undeploy the esb archive, type 'ant undeploy' ("Window1").
+ 6. To undeploy the esb archive, type 'ant undeploy' ("Window1").
+
Things to Consider:
===================
- Review the process definition, specifically one of the nodes like Service 1:
@@ -64,9 +64,9 @@
BPM_Orchestration3_Service1
</esbCategoryName>
<esbServiceName>Service1</esbServiceName>
- <jbpmToEsbVars>
+ <bpmToEsbVars>
<mapping jbpm="theBody" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
+ </bpmToEsbVars>
<returnVars>
<mapping jbpm="theBody" esb="BODY_CONTENT" />
</returnVars>
@@ -82,10 +82,6 @@
The secret to being able to wake up a sleeping process instance is the tokenid.
- When the process instance invokes an ESB Service it embeds "jbpmTokenId"
- into the message. It can be retrieved in a custom action or in this example's
- case groovy with - message.body.get("jbpmTokenId")
-
This example uses two custom actions to prepare the content needed to properly
interact with the jBPM business process. SetupKey.java and SetupSignal.java are
used to peel the businessKey and/or the token id out of the JMS message and place
@@ -99,8 +95,7 @@
Tip: If you use the jbpm-console (http://localhost:8080) and the Graphical Process
Designer provided by Red Hat Developer Studio then you can visually "see" the process
- moving from step to step to step with each command line signal.
+ moving from step to step to step with each command line signal.
-
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/scripts/service1.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/scripts/service1.groovy 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/scripts/service1.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -3,7 +3,6 @@
println "** Begin Service 1 **"
println "In: " + message.getBody().get()
-println "jbpmTokenId: " + message.body.get("jbpmTokenId")
message.getBody().add(message.getBody().get() + " 'Service 1' ")
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/scripts/service2.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/scripts/service2.groovy 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/scripts/service2.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -3,7 +3,6 @@
println "** Begin Service 2 **"
println "In: " + message.getBody().get()
-println "jbpmTokenId: " + message.body.get("jbpmTokenId")
message.getBody().add(message.getBody().get() + " 'Service 2' ")
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/esb_actions/SimpleJMSNotifier.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/esb_actions/SimpleJMSNotifier.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/esb_actions/SimpleJMSNotifier.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -37,6 +37,8 @@
import javax.naming.Context;
import javax.naming.InitialContext;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SimpleJMSNotifier extends AbstractActionLifecycle {
protected ConfigTree _config;
private Logger logger = Logger.getLogger(SimpleJMSNotifier.class);
@@ -65,6 +67,7 @@
QueueSender send = session.createSender(que);
TextMessage tm = session.createTextMessage((String)message.getBody().get());
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "BPMOrchestration3Test.log");
send.send(tm);
send.close();
@@ -80,4 +83,4 @@
queueName = _config.getAttribute("ALERT_QUEUE_NAME");
logger.info("Who to alert: " + queueName);
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -18,7 +18,7 @@
* (C) 2005-2006,
* @author JBoss Inc.
*/
-package org.jboss.soa.esb.samples.quickstart.bpm_orchestration3.test;
+package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration3.test;
import org.jgroups.protocols.JMS;
@@ -26,6 +26,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
@@ -68,6 +70,7 @@
ObjectMessage tm = session.createObjectMessage(msg);
if (tokenID != null && !tokenID.equals(""))
tm.setStringProperty("token",tokenID);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "BPMOrchestration3Test.log");
send.send(tm);
send.close();
}
@@ -92,4 +95,4 @@
}
-}
\ No newline at end of file
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4 (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4)
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4
___________________________________________________________________
Name: svn:ignore
+ build
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/CBRRules.drl
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/CBRRules.drl 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/CBRRules.drl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,40 +0,0 @@
-#created on: Oct 30, 2006
-package com.jboss.soa.esb.routing.cbr
-
-#list any import classes here.
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.jboss.soa.esb.store.OrderHeader;
-
-#declare any global variables here
-global java.util.List destinations;
-
-
-rule "Highest Priority Orders"
-
- when
- OrderHeader( orderPriority == 3 )
- then
- System.out.println("HIGHEST PRIORITY");
- destinations.add("SuperSpecialCustomerService");
-
-end
-
-rule "Medium Priority Orders"
-
- when
- OrderHeader( orderPriority == 2 )
- then
- System.out.println("Medium Priority");
- destinations.add("SpecialCustomerService");
-end
-
-rule "Low Priority Orders"
-
- when
- OrderHeader( orderPriority == 1 )
- then
- System.out.println("Low Priority");
- destinations.add("RegularCustomerService");
-end
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/CBRRules.drl (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/CBRRules.drl)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/CBRRules.drl (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/CBRRules.drl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,40 @@
+#created on: Oct 30, 2006
+package com.jboss.soa.esb.routing.cbr
+
+#list any import classes here.
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.store.OrderHeader;
+
+#declare any global variables here
+global java.util.List destinations;
+
+
+rule "Highest Priority Orders"
+
+ when
+ OrderHeader( orderPriority == 3 )
+ then
+ System.out.println("HIGHEST PRIORITY");
+ destinations.add("SuperSpecialCustomerService");
+
+end
+
+rule "Medium Priority Orders"
+
+ when
+ OrderHeader( orderPriority == 2 )
+ then
+ System.out.println("Medium Priority");
+ destinations.add("SpecialCustomerService");
+end
+
+rule "Low Priority Orders"
+
+ when
+ OrderHeader( orderPriority == 1 )
+ then
+ System.out.println("Low Priority");
+ destinations.add("RegularCustomerService");
+end
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Discount_Rules.drl
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/Discount_Rules.drl 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Discount_Rules.drl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,46 +0,0 @@
-#created on: Oct 30, 2006
-package com.jboss.soa.esb.routing.cbr
-
-#list any import classes here.
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.jboss.soa.esb.store.OrderHeader;
-import org.jboss.soa.esb.store.Customer;
-
-global java.util.List destinations;
-
-
-
-rule "Logging"
-salience 10
-when
- order: OrderHeader()
- customer: Customer()
-then
- System.out.println("Customer Status: " + customer.getStatus());
- System.out.println("Order Total: " + order.getTotalAmount());
-end
-
-rule "Customer Platinum Status"
-salience 20
- when
- customer: Customer(status > 50)
- order: OrderHeader(orderPriority == 3)
- then
- System.out.println("Platinum Customer - High Priority - Higher discount");
- order.setOrderDiscount(8.5);
-end
-
-rule "Customer Gold Status"
-salience 20
- when
- customer: Customer(status > 10, status <= 50)
- order: OrderHeader(orderPriority == 2)
- then
- System.out.println("Gold Customer - Medium Priority - discount ");
- order.setOrderDiscount(3.4);
-end
-
-
-
-
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Discount_Rules.drl (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/Discount_Rules.drl)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Discount_Rules.drl (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Discount_Rules.drl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,46 @@
+#created on: Oct 30, 2006
+package com.jboss.soa.esb.routing.cbr
+
+#list any import classes here.
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.store.OrderHeader;
+import org.jboss.soa.esb.store.Customer;
+
+global java.util.List destinations;
+
+
+
+rule "Logging"
+salience 10
+when
+ order: OrderHeader()
+ customer: Customer()
+then
+ System.out.println("Customer Status: " + customer.getStatus());
+ System.out.println("Order Total: " + order.getTotalAmount());
+end
+
+rule "Customer Platinum Status"
+salience 20
+ when
+ customer: Customer(status > 50)
+ order: OrderHeader(orderPriority == 3)
+ then
+ System.out.println("Platinum Customer - High Priority - Higher discount");
+ order.setOrderDiscount(8.5);
+end
+
+rule "Customer Gold Status"
+salience 20
+ when
+ customer: Customer(status > 10, status <= 50)
+ order: OrderHeader(orderPriority == 2)
+ then
+ System.out.println("Gold Customer - Medium Priority - discount ");
+ order.setOrderDiscount(3.4);
+end
+
+
+
+
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/MyRoutingRules.drl
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/MyRoutingRules.drl 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/MyRoutingRules.drl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,40 +0,0 @@
-#created on: Oct 30, 2006
-package com.jboss.soa.esb.routing.cbr
-
-#list any import classes here.
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.jboss.soa.esb.dvdstore.OrderHeader;
-
-#declare any global variables here
-global java.util.List destinations;
-
-
-rule "Highest Priority Orders"
-
- when
- OrderHeader( orderPriority == 3 )
- then
- System.out.println("HIGHEST PRIORITY");
- destinations.add("SuperSpecialCustomerService");
-
-end
-
-rule "Medium Priority Orders"
-
- when
- OrderHeader( orderPriority == 2 )
- then
- System.out.println("Medium Priority");
- destinations.add("SpecialCustomerService");
-end
-
-rule "Low Priority Orders"
-
- when
- OrderHeader( orderPriority == 1 )
- then
- System.out.println("Low Priority");
- destinations.add("RegularCustomerService");
-end
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/MyRoutingRules.drl (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/MyRoutingRules.drl)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/MyRoutingRules.drl (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/MyRoutingRules.drl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,40 @@
+#created on: Oct 30, 2006
+package com.jboss.soa.esb.routing.cbr
+
+#list any import classes here.
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.dvdstore.OrderHeader;
+
+#declare any global variables here
+global java.util.List destinations;
+
+
+rule "Highest Priority Orders"
+
+ when
+ OrderHeader( orderPriority == 3 )
+ then
+ System.out.println("HIGHEST PRIORITY");
+ destinations.add("SuperSpecialCustomerService");
+
+end
+
+rule "Medium Priority Orders"
+
+ when
+ OrderHeader( orderPriority == 2 )
+ then
+ System.out.println("Medium Priority");
+ destinations.add("SpecialCustomerService");
+end
+
+rule "Low Priority Orders"
+
+ when
+ OrderHeader( orderPriority == 1 )
+ then
+ System.out.println("Low Priority");
+ destinations.add("RegularCustomerService");
+end
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Priority_Rules.drl
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/Priority_Rules.drl 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Priority_Rules.drl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,43 +0,0 @@
-#created on: Oct 30, 2006
-package com.jboss.soa.esb.routing.cbr
-
-#list any import classes here.
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.jboss.soa.esb.store.OrderHeader;
-import org.jboss.soa.esb.store.Customer;
-
-global java.util.List destinations;
-
-
-
-rule "Logging"
-when
- order: OrderHeader()
- customer: Customer()
-then
- System.out.println("Customer Status: " + customer.getStatus());
- System.out.println("Order Total: " + order.getTotalAmount());
-end
-
-rule "Customer Platinum Status"
- when
- customer: Customer(status > 50)
- order: OrderHeader(totalAmount > 50)
- then
- System.out.println("Platinum Customer - High Priority");
- order.setOrderPriority(3);
-end
-
-rule "Customer Gold Status"
- when
- customer: Customer(status > 10, status <= 50)
- order: OrderHeader(totalAmount > 25)
- then
- System.out.println("Gold Customer - Medium Priority ");
- order.setOrderPriority(2);
-end
-
-
-
-
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Priority_Rules.drl (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/Priority_Rules.drl)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Priority_Rules.drl (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/Priority_Rules.drl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,43 @@
+#created on: Oct 30, 2006
+package com.jboss.soa.esb.routing.cbr
+
+#list any import classes here.
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.store.OrderHeader;
+import org.jboss.soa.esb.store.Customer;
+
+global java.util.List destinations;
+
+
+
+rule "Logging"
+when
+ order: OrderHeader()
+ customer: Customer()
+then
+ System.out.println("Customer Status: " + customer.getStatus());
+ System.out.println("Order Total: " + order.getTotalAmount());
+end
+
+rule "Customer Platinum Status"
+ when
+ customer: Customer(status > 50)
+ order: OrderHeader(totalAmount > 50)
+ then
+ System.out.println("Platinum Customer - High Priority");
+ order.setOrderPriority(3);
+end
+
+rule "Customer Gold Status"
+ when
+ customer: Customer(status > 10, status <= 50)
+ order: OrderHeader(totalAmount > 25)
+ then
+ System.out.println("Gold Customer - Medium Priority ");
+ order.setOrderPriority(2);
+end
+
+
+
+
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SampleOrder.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/SampleOrder.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SampleOrder.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,12 +0,0 @@
-<Order orderId="2" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0"
-netAmount="59.97" totalAmount="64.92" tax="4.95">
- <Customer userName="user1" firstName="Rex" lastName="Myers" state="SD"/>
- <OrderLines>
- <OrderLine position="1" quantity="1">
- <Product productId="364" title="Superman Returns" price="29.98"/>
- </OrderLine>
- <OrderLine position="2" quantity="1">
- <Product productId="299" title="Pulp Fiction" price="29.99"/>
- </OrderLine>
- </OrderLines>
-</Order>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SampleOrder.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/SampleOrder.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SampleOrder.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SampleOrder.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,12 @@
+<Order orderId="2" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0"
+netAmount="59.97" totalAmount="64.92" tax="4.95">
+ <Customer userName="user1" firstName="Rex" lastName="Myers" state="SD"/>
+ <OrderLines>
+ <OrderLine position="1" quantity="1">
+ <Product productId="364" title="Superman Returns" price="29.98"/>
+ </OrderLine>
+ <OrderLine position="2" quantity="1">
+ <Product productId="299" title="Pulp Fiction" price="29.99"/>
+ </OrderLine>
+ </OrderLines>
+</Order>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SamplePetsOrder.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/SamplePetsOrder.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SamplePetsOrder.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<Order orderId="1182" orderDate="Sat Oct 06 13:41:16 EDT 2007" status="P" totalPrice="188.29" username="j2ee" shipToFirstName="Sally" shipToLastName="Smith" shipState="CA">
- <LineItems>
- <LineItem lineNumber="1" quantity="2">
- <Item itemId="EST-1" listPrice="16.5" />
- </LineItem>
- <LineItem lineNumber="2" quantity="1">
- <Item itemId="EST-27" listPrice="155.29" />
- </LineItem>
- </LineItems>
-</Order>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SamplePetsOrder.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/SamplePetsOrder.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SamplePetsOrder.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/SamplePetsOrder.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<Order orderId="1182" orderDate="Sat Oct 06 13:41:16 EDT 2007" status="P" totalPrice="188.29" username="j2ee" shipToFirstName="Sally" shipToLastName="Smith" shipState="CA">
+ <LineItems>
+ <LineItem lineNumber="1" quantity="2">
+ <Item itemId="EST-1" listPrice="16.5" />
+ </LineItem>
+ <LineItem lineNumber="2" quantity="1">
+ <Item itemId="EST-27" listPrice="155.29" />
+ </LineItem>
+ </LineItems>
+</Order>
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/altered_jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/altered_jboss-esb.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/altered_jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,209 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
- parameterReloadSecs="5">
-
- <providers>
- <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
- jndi-URL="jnp://127.0.0.1:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
- jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
-
- <jms-bus busid="startGwChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_start_gw" />
- </jms-bus>
- <jms-bus busid="startEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_start_esb" />
- </jms-bus>
- <jms-bus busid="intakeServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_intake_service_esb" />
- </jms-bus>
- <jms-bus busid="discountServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_discount_service_esb" />
- </jms-bus>
- <jms-bus busid="shippingServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_shipping_service_esb" />
- </jms-bus>
- <jms-bus busid="conciergeServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_ConciergeManager" />
- </jms-bus>
- <jms-bus busid="distributionServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_DistributionManager" />
- </jms-bus>
- <jms-bus busid="basicShippingServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_BasicShipping" />
- </jms-bus>
-
- </jms-provider>
- </providers>
-
- <services>
- <!-- removed the deploy service, this process definition needs to be deployed by a .par and/or from
- the graphical process designer -->
- <service category="BPM_orchestration4_Starter_Service" name="Starter_Service"
- description="BPM Orchestration Sample 4: Use this service to start a process instance">
- <listeners>
- <jms-listener name="JMS-Gateway" busidref="startGwChannel"
- maxThreads="1"
- is-gateway="true" />
- <jms-listener name="ESB-Listener" busidref="startEsbChannel"
- maxThreads="1"/>
- </listeners>
- <actions>
-
- <action name="transformXML2POJO"
- class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
- <property name="resource-config"
- value="/smooks-res.xml" />
- </action>
- <!--
- <action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="After" />
- <property name="printfull" value="true"/>
- </action>
- -->
- <action name="SetupMessage"
- class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SetupMessage">
- <property name="status" value="60" /><!-- status was not in order XML -->
- </action>
-
- <action name="start_a_new_order_process"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="StartProcessInstanceCommand" />
- <property name="process-definition-name" value="bpm4_ESBOrderProcess"/>
- <property name="key" value="businessKey"/>
- <property name="object-paths">
- <object-path esb="body.entireOrder" bpm="entireOrder" />
- <object-path esb="body.order.orderId" bpm="order_orderid" />
-
-
- <object-path esb="body.customer.firstName" bpm="customer_firstName" />
- <object-path esb="body.customer.lastName" bpm="customer_lastName" />
- <object-path esb="body.customer.status" bpm="customer_status" />
- </property>
-
- </action>
- <!--
- <action name="dump3" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="After" />
- <property name="printfull" value="true"/>
- </action>
- -->
- </actions>
- </service>
- <!-- no external signal is necessary
- <service category="BPM_orchestration4_Signal_Service" name="Signal_Service"
- description="BPM Orchestration Sample 3: Use this service to signal a process instance">
- <listeners>
- <jms-listener name="JMS-Gateway" busidref="signalGwChannel"
- maxThreads="1"
- is-gateway="true" />
- <jms-listener name="ESB-Listener" busidref="signalEsbChannel"
- maxThreads="1"/>
- </listeners>
- <actions>
-
- <action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="SIGNAL" />
- <property name="printfull" value="true"/>
- </action>
-
- <action name="SetupSignal" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SetupSignal"/>
-
- <action name="signal_a_process_instance"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="SignalCommand" />
- <property name="object-paths">
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- <object-path esb="body" bpm="theData" />
- </property>
- </action>
-
-
- <action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="After" />
- <property name="printfull" value="true"/>
- </action>
-
- </actions>
- </service>
- -->
-
- <service category="BPM_Orchestration4" name="IntakeService"
- description="IntakeService">
- <listeners>
- <jms-listener name="ESB-Listener" busidref="intakeServiceEsbChannel"
- maxThreads="1"/>
- </listeners>
- <actions>
- <!--
- <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="printfull" value="true"/>
- </action>
- -->
-
- <action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script" value="/scripts/intake_service.groovy" />
- </action>
-
- <!--
- <action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
- <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_service1_Alert" />
- </action>
- -->
- </actions>
- </service>
- <service category="BPM_Orchestration4" name="DiscountService"
- description="DiscountService">
- <listeners>
- <jms-listener name="ESB-Listener" busidref="discountServiceEsbChannel"
- maxThreads="1"/>
- </listeners>
- <actions>
- <!--
- <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="printfull" value="true"/>
- </action>
- -->
- <action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script" value="/scripts/discount_service.groovy" />
- </action>
- <!--
- <action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
- <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service2_Alert" />
- </action>
- -->
- </actions>
- </service>
- <service category="BPM_Orchestration4" name="ShippingService"
- description="ShippingService">
- <listeners>
- <jms-listener name="ESB-Listener" busidref="shippingServiceEsbChannel"
- maxThreads="1"/>
- </listeners>
- <actions>
- <!--
- <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="printfull" value="true"/>
- </action>
- -->
- <action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script" value="/scripts/shipping_service.groovy" />
- </action>
- <!--
- <action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
- <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service3_Alert" />
- </action>
- -->
- </actions>
- </service>
-
- </services>
-
-</jbossesb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/altered_jboss-esb.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/altered_jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/altered_jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/altered_jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,209 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
+ parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+ jndi-URL="jnp://127.0.0.1:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+
+ <jms-bus busid="startGwChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_start_gw" />
+ </jms-bus>
+ <jms-bus busid="startEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_start_esb" />
+ </jms-bus>
+ <jms-bus busid="intakeServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_intake_service_esb" />
+ </jms-bus>
+ <jms-bus busid="discountServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_discount_service_esb" />
+ </jms-bus>
+ <jms-bus busid="shippingServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_shipping_service_esb" />
+ </jms-bus>
+ <jms-bus busid="conciergeServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_ConciergeManager" />
+ </jms-bus>
+ <jms-bus busid="distributionServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_DistributionManager" />
+ </jms-bus>
+ <jms-bus busid="basicShippingServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_BasicShipping" />
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+ <!-- removed the deploy service, this process definition needs to be deployed by a .par and/or from
+ the graphical process designer -->
+ <service category="BPM_orchestration4_Starter_Service" name="Starter_Service"
+ description="BPM Orchestration Sample 4: Use this service to start a process instance">
+ <listeners>
+ <jms-listener name="JMS-Gateway" busidref="startGwChannel"
+ maxThreads="1"
+ is-gateway="true" />
+ <jms-listener name="ESB-Listener" busidref="startEsbChannel"
+ maxThreads="1"/>
+ </listeners>
+ <actions>
+
+ <action name="transformXML2POJO"
+ class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+ <property name="resource-config"
+ value="/smooks-res.xml" />
+ </action>
+ <!--
+ <action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="After" />
+ <property name="printfull" value="true"/>
+ </action>
+ -->
+ <action name="SetupMessage"
+ class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SetupMessage">
+ <property name="status" value="60" /><!-- status was not in order XML -->
+ </action>
+
+ <action name="start_a_new_order_process"
+ class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
+ <property name="command" value="StartProcessInstanceCommand" />
+ <property name="process-definition-name" value="bpm4_ESBOrderProcess"/>
+ <property name="key" value="businessKey"/>
+ <property name="object-paths">
+ <object-path esb="body.entireOrder" bpm="entireOrder" />
+ <object-path esb="body.order.orderId" bpm="order_orderid" />
+
+
+ <object-path esb="body.customer.firstName" bpm="customer_firstName" />
+ <object-path esb="body.customer.lastName" bpm="customer_lastName" />
+ <object-path esb="body.customer.status" bpm="customer_status" />
+ </property>
+
+ </action>
+ <!--
+ <action name="dump3" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="After" />
+ <property name="printfull" value="true"/>
+ </action>
+ -->
+ </actions>
+ </service>
+ <!-- no external signal is necessary
+ <service category="BPM_orchestration4_Signal_Service" name="Signal_Service"
+ description="BPM Orchestration Sample 3: Use this service to signal a process instance">
+ <listeners>
+ <jms-listener name="JMS-Gateway" busidref="signalGwChannel"
+ maxThreads="1"
+ is-gateway="true" />
+ <jms-listener name="ESB-Listener" busidref="signalEsbChannel"
+ maxThreads="1"/>
+ </listeners>
+ <actions>
+
+ <action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="SIGNAL" />
+ <property name="printfull" value="true"/>
+ </action>
+
+ <action name="SetupSignal" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SetupSignal"/>
+
+ <action name="signal_a_process_instance"
+ class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
+ <property name="command" value="SignalCommand" />
+ <property name="object-paths">
+ <object-path esb="BODY_CONTENT" bpm="theBody" />
+ <object-path esb="body" bpm="theData" />
+ </property>
+ </action>
+
+
+ <action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="After" />
+ <property name="printfull" value="true"/>
+ </action>
+
+ </actions>
+ </service>
+ -->
+
+ <service category="BPM_Orchestration4" name="IntakeService"
+ description="IntakeService">
+ <listeners>
+ <jms-listener name="ESB-Listener" busidref="intakeServiceEsbChannel"
+ maxThreads="1"/>
+ </listeners>
+ <actions>
+ <!--
+ <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="true"/>
+ </action>
+ -->
+
+ <action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script" value="/scripts/intake_service.groovy" />
+ </action>
+
+ <!--
+ <action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
+ <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_service1_Alert" />
+ </action>
+ -->
+ </actions>
+ </service>
+ <service category="BPM_Orchestration4" name="DiscountService"
+ description="DiscountService">
+ <listeners>
+ <jms-listener name="ESB-Listener" busidref="discountServiceEsbChannel"
+ maxThreads="1"/>
+ </listeners>
+ <actions>
+ <!--
+ <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="true"/>
+ </action>
+ -->
+ <action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script" value="/scripts/discount_service.groovy" />
+ </action>
+ <!--
+ <action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
+ <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service2_Alert" />
+ </action>
+ -->
+ </actions>
+ </service>
+ <service category="BPM_Orchestration4" name="ShippingService"
+ description="ShippingService">
+ <listeners>
+ <jms-listener name="ESB-Listener" busidref="shippingServiceEsbChannel"
+ maxThreads="1"/>
+ </listeners>
+ <actions>
+ <!--
+ <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="true"/>
+ </action>
+ -->
+ <action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script" value="/scripts/shipping_service.groovy" />
+ </action>
+ <!--
+ <action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
+ <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service3_Alert" />
+ </action>
+ -->
+ </actions>
+ </service>
+
+ </services>
+
+</jbossesb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/build.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,75 +0,0 @@
-<project name="Quickstart_bpm_orchestration4" default="run" basedir=".">
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <property name="deploy.exploded" value="true"/>
-
- <property name="additional.deploys" value="Priority_Rules.drl,Discount_Rules.drl,CBRRules.drl,smooks-config.xml,scripts/**,transforms/**"/>
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
-
- <property name="project.process.dir" value="processDefinition"/>
-
- <target name="quickstart-specific-assemblies">
- <copy overwrite="true" file="${project.process.dir}/processdefinition.xml" todir="${classes}/${project.process.dir}" />
- <copy todir="${classes}">
- <fileset dir="${basedir}" includes="scripts/**/*"/>
- </copy>
- </target>
-
- <target name="run">
- <echo>Follow the instructions in the readme.</echo>
- </target>
-
- <target name="runtest">
- <echo>Follow the instructions in the readme.</echo>
- </target>
-
- <target name="deployProcess" description="deploys the process definition" depends="jbossesb-dependencies">
- <echo>Deploy the process definition</echo>
- <taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
- <classpath refid="exec-classpath"/>
- </taskdef>
- <deployToServer>
- <fileset dir="${basedir}/processDefinition" includes="*"/>
- </deployToServer>
- </target>
-
-
- <target name="startProcess" depends="compile" description="Sends a message to start the process instance">
- <echo>Sends a message to start the process instance</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.test.SendJMSMessageStart" failonerror="true">
- <arg value="SampleOrder.xml"/>
- <classpath refid="exec-classpath"/>
- </java>
- </target>
-
- <target name="startProcessPets" depends="compile" description="Sends a message to start the process instance">
- <echo>Sends a message to start the process instance</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.test.SendJMSMessageStart" failonerror="true">
- <arg value="SamplePetsOrder.xml"/>
- <classpath refid="exec-classpath"/>
- </java>
- </target>
-
- <target name="startMonitor" depends="compile" description="Sends a message to start the process instance">
- <echo>Starting the Swing-based Service Monitor</echo>
- <java fork="yes" classname="ServiceAlertMonitor" failonerror="true">
- <arg value="Monitor"/>
- <arg value="quickstart_bpm_orchestration4_monitor"/>
- <arg value="images/gear1.gif"/>
- <classpath refid="exec-classpath"/>
- </java>
- </target>
-
- <target name="display-instructions">
- <echo message='${line.separator}******************' />
- <echo>Quickstart deployed to target JBoss ESB/App Server at '${org.jboss.esb.server.deploy.dir}'.</echo>
- <echo>1. Carefully review the Readme.</echo>
- <echo message='******************' />
- </target>
-</project>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/build.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,75 @@
+<project name="Quickstart_bpm_orchestration4" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="deploy.exploded" value="true"/>
+
+ <property name="additional.deploys" value="Priority_Rules.drl,Discount_Rules.drl,CBRRules.drl,smooks-config.xml,scripts/**,transforms/**"/>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <property name="project.process.dir" value="processDefinition"/>
+
+ <target name="quickstart-specific-assemblies">
+ <copy overwrite="true" file="${project.process.dir}/processdefinition.xml" todir="${classes}/${project.process.dir}" />
+ <copy todir="${classes}">
+ <fileset dir="${basedir}" includes="scripts/**/*"/>
+ </copy>
+ </target>
+
+ <target name="run">
+ <echo>Follow the instructions in the readme.</echo>
+ </target>
+
+ <target name="runtest">
+ <echo>Follow the instructions in the readme.</echo>
+ </target>
+
+ <target name="deployProcess" description="deploys the process definition" depends="jbossesb-dependencies">
+ <echo>Deploy the process definition</echo>
+ <taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
+ <classpath refid="exec-classpath"/>
+ </taskdef>
+ <deployToServer>
+ <fileset dir="${basedir}/processDefinition" includes="*"/>
+ </deployToServer>
+ </target>
+
+
+ <target name="startProcess" depends="compile" description="Sends a message to start the process instance">
+ <echo>Sends a message to start the process instance</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.test.SendJMSMessageStart" failonerror="true">
+ <arg value="SampleOrder.xml"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="startProcessPets" depends="compile" description="Sends a message to start the process instance">
+ <echo>Sends a message to start the process instance</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.test.SendJMSMessageStart" failonerror="true">
+ <arg value="SamplePetsOrder.xml"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="startMonitor" depends="compile" description="Sends a message to start the process instance">
+ <echo>Starting the Swing-based Service Monitor</echo>
+ <java fork="yes" classname="ServiceAlertMonitor" failonerror="true">
+ <arg value="Monitor"/>
+ <arg value="quickstart_bpm_orchestration4_monitor"/>
+ <arg value="images/gear1.gif"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="display-instructions">
+ <echo message='${line.separator}******************' />
+ <echo>Quickstart deployed to target JBoss ESB/App Server at '${org.jboss.esb.server.deploy.dir}'.</echo>
+ <echo>1. Carefully review the Readme.</echo>
+ <echo message='******************' />
+ </target>
+</project>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/deployment.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/deployment.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jbossesb-deployment>
- <depends>jboss.esb:deployment=jbrules.esb</depends>
- <depends>jboss.esb:deployment=jbpm.esb</depends>
- <depends>jboss.esb:deployment=smooks.esb</depends>
-</jbossesb-deployment>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/deployment.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/deployment.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=jbrules.esb</depends>
+ <depends>jboss.esb:deployment=jbpm.esb</depends>
+ <depends>jboss.esb:deployment=smooks.esb</depends>
+</jbossesb-deployment>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/docs)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/Readme.odt
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/Readme.odt (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/docs/Readme.odt)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/Readme.pdf
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/docs/Readme.pdf (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/docs/Readme.pdf)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/images (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/images)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jbm-queue-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbm-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_start_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_start_gw"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_intake_service_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_intake_service_esb_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_discount_service_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_discount_service_esb_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_shipping_service_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_shipping_service_esb_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_monitor"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_ConciergeManager"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_DistributionManager"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_BasicShipping"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbm-queue-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbm-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_start_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_start_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_intake_service_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_intake_service_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_discount_service_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_discount_service_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_shipping_service_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_shipping_service_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_monitor"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_ConciergeManager"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_DistributionManager"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=quickstart_bpm_orchestration4_BasicShipping"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jbmq-queue-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbmq-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_start_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_start_gw">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_intake_service_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_intake_service_esb_reply">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_discount_service_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_discount_service_esb_reply">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_shipping_service_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_shipping_service_esb_reply">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_monitor">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpm_orchestration4_ConciergeManager">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpm_orchestration4_DistributionManager">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpm_orchestration4_BasicShipping">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-</server>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbmq-queue-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbmq-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_start_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_start_gw">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_intake_service_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_intake_service_esb_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_discount_service_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_discount_service_esb_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_shipping_service_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_shipping_service_esb_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=quickstart_bpm_orchestration4_monitor">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpm_orchestration4_ConciergeManager">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpm_orchestration4_DistributionManager">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpm_orchestration4_BasicShipping">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jboss-esb.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,286 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb
- xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
- parameterReloadSecs="5">
-
- <providers>
- <jms-provider name="JBossMQ"
- connection-factory="ConnectionFactory"
- jndi-URL="jnp://127.0.0.1:1099"
- jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
- jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
-
- <jms-bus busid="startGwChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_start_gw" />
- </jms-bus>
- <jms-bus busid="startEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_start_esb" />
- </jms-bus>
- <jms-bus busid="intakeServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_intake_service_esb" />
- </jms-bus>
- <jms-bus busid="discountServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_discount_service_esb" />
- </jms-bus>
- <jms-bus busid="shippingServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_shipping_service_esb" />
- </jms-bus>
- <jms-bus busid="conciergeServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_ConciergeManager" />
- </jms-bus>
- <jms-bus busid="distributionServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_DistributionManager" />
- </jms-bus>
- <jms-bus busid="basicShippingServiceEsbChannel">
- <jms-message-filter dest-type="QUEUE"
- dest-name="queue/quickstart_bpm_orchestration4_BasicShipping" />
- </jms-bus>
-
- </jms-provider>
- </providers>
-
- <services>
- <!-- removed the deploy service, the process definition needs to be deployed by a .par and/or from
- the graphical process designer -->
- <service category="BPM_orchestration4_Starter_Service"
- name="Starter_Service"
- description="BPM Orchestration Sample 4: Use this service to start a process instance">
- <listeners>
- <jms-listener name="JMS-Gateway"
- busidref="startGwChannel" maxThreads="1" is-gateway="true" />
- <jms-listener name="ESB-Listener"
- busidref="startEsbChannel" maxThreads="1" />
- </listeners>
- <actions>
- <action name="setup_key"
- class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script"
- value="/scripts/setup_key.groovy" />
- </action>
- <action name="start_a_new_order_process"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command"
- value="StartProcessInstanceCommand" />
- <property name="process-definition-name"
- value="bpm4_ESBOrderProcess" />
- <property name="key" value="body.businessKey" />
- <property name="esbToBpmVars">
- <mapping esb="BODY_CONTENT" bpm="entireOrderAsXML" />
- </property>
-
- </action>
- <action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="After" />
- <property name="printfull" value="true"/>
- </action>
- </actions>
- </service>
- <service category="BPM_Orchestration4" name="IntakeService"
- description="IntakeService: transforms, massages, calculates priority">
- <listeners>
- <jms-listener name="ESB-Listener"
- busidref="intakeServiceEsbChannel" maxThreads="1" />
- </listeners>
- <actions>
-
- <action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="INTAKE START" />
- <property name="printfull" value="true"/>
- </action>
-
- <action name="groovy"
- class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script"
- value="/scripts/intake_service.groovy" />
- </action>
-
- <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="printfull" value="true"/>
- </action>
-
- <!-- transform -->
- <action name="discover-message-origin" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script" value="/scripts/check-origin.groovy" />
- </action>
-
- <action name="transform" class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
- <property name="resource-config" value="/smooks-config.xml" />
- </action>
-
- <action name="SetupMessage"
- class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SetupMessage">
- <property name="status" value="60" />
- <!-- status was not in order XML, this is just for demo purposes -->
- </action>
-
- <action name="display"
- class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script"
- value="/scripts/display.groovy" />
- </action>
-
- <!-- Use the BRP to calculate the order priority -->
-
- <action
- class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
- name="BRP">
- <property name="ruleSet"
- value="Priority_Rules.drl" />
- <property name="ruleReload" value="true" />
- <property name="object-paths">
- <object-path esb="body.orderHeader" />
- <object-path esb="body.customer" />
- </property>
- </action>
- <action name="setupPriority"
- class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script"
- value="/scripts/setup_priority.groovy" />
- </action>
- <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
- <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
- <property name="PREPENDED_TEXT" value="Priority" />
- <property name="BODY_KEY" value="order_orderPriority" />
- </action>
- </actions>
- </service>
- <service category="BPM_Orchestration4" name="DiscountService"
- description="DiscountService">
- <listeners>
- <jms-listener name="ESB-Listener"
- busidref="discountServiceEsbChannel" maxThreads="1" />
- </listeners>
- <actions>
- <action name="groovy"
- class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script"
- value="/scripts/discount_service.groovy" />
- </action>
- <action name="display"
- class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script"
- value="/scripts/display.groovy" />
- </action>
-
- <action
- class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
- name="discount_calc">
- <property name="ruleSet"
- value="Discount_Rules.drl" />
- <property name="ruleReload" value="true" />
- <property name="object-paths">
- <object-path esb="body.orderHeader" />
- <object-path esb="body.customer" />
- </property>
- </action>
-
- <action name="setupDiscount"
- class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script"
- value="/scripts/setup_discount.groovy" />
- </action>
-
- <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
- <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
- <property name="PREPENDED_TEXT" value="Discount Service" />
- <property name="BODY_KEY" value="order_orderDiscount" />
- </action>
-
- </actions>
- </service>
-
- <service category="BPM_Orchestration4" name="ShippingService"
- description="ShippingService">
- <listeners>
- <jms-listener name="ESB-Listener"
- busidref="shippingServiceEsbChannel" maxThreads="1" />
- </listeners>
- <actions>
- <action name="groovy"
- class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
- <property name="script"
- value="/scripts/shipping_service.groovy" />
- </action>
-
- <action
- class="org.jboss.soa.esb.actions.ContentBasedRouter"
- name="ContentBasedRouter">
- <property name="ruleSet" value="CBRRules.drl" />
- <property name="ruleReload" value="true" />
- <property name="destinations">
- <route-to
- destination-name="SuperSpecialCustomerService"
- service-category="ConciergeManager" service-name="ConciergeService" />
- <route-to
- destination-name="SpecialCustomerService"
- service-category="DistributionManager" service-name="DistributionService" />
- <route-to
- destination-name="RegularCustomerService"
- service-category="BasicShipping" service-name="ShipperService" />
- </property>
- <property name="object-paths">
- <object-path esb="body.orderHeader" />
- <object-path esb="body.customer" />
- </property>
- </action>
-
- </actions>
- </service>
-
- <service category="ConciergeManager"
- name="ConciergeService" description="For highest priority customers">
- <listeners>
- <jms-listener name="conciergeServiceEsbChannel"
- busidref="conciergeServiceEsbChannel" maxThreads="1">
- </jms-listener>
- </listeners>
- <actions>
- <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
- <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
- <property name="PREPENDED_TEXT" value="Concierge:Highest Priority Customers/Orders" />
- <property name="BODY_KEY" value="orderHeader" />
- </action>
- </actions>
- </service>
-
- <service category="DistributionManager"
- name="DistributionService" description="For medium priority customers">
- <listeners>
- <jms-listener name="distributionServiceEsbChannel"
- busidref="distributionServiceEsbChannel" maxThreads="1">
- </jms-listener>
- </listeners>
- <actions>
- <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
- <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
- <property name="PREPENDED_TEXT" value="Distribution Manager:Medium Priority Customers/Orders" />
- <property name="BODY_KEY" value="orderHeader" />
- </action>
- </actions>
- </service>
- <service category="BasicShipping"
- name="ShipperService" description="For low priority customers">
- <listeners>
- <jms-listener name="basicShippingServiceEsbChannel"
- busidref="basicShippingServiceEsbChannel" maxThreads="1">
- </jms-listener>
- </listeners>
- <actions>
- <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
- <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
- <property name="PREPENDED_TEXT" value="Basic:Lowest Priority Customers/Orders" />
- <property name="BODY_KEY" value="orderHeader" />
- </action>
- </actions>
- </service>
-
- </services>
-
-</jbossesb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jboss-esb.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,286 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
+ xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
+ parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ"
+ connection-factory="ConnectionFactory"
+ jndi-URL="jnp://127.0.0.1:1099"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+
+ <jms-bus busid="startGwChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_start_gw" />
+ </jms-bus>
+ <jms-bus busid="startEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_start_esb" />
+ </jms-bus>
+ <jms-bus busid="intakeServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_intake_service_esb" />
+ </jms-bus>
+ <jms-bus busid="discountServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_discount_service_esb" />
+ </jms-bus>
+ <jms-bus busid="shippingServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_shipping_service_esb" />
+ </jms-bus>
+ <jms-bus busid="conciergeServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_ConciergeManager" />
+ </jms-bus>
+ <jms-bus busid="distributionServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_DistributionManager" />
+ </jms-bus>
+ <jms-bus busid="basicShippingServiceEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_bpm_orchestration4_BasicShipping" />
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+ <!-- removed the deploy service, the process definition needs to be deployed by a .par and/or from
+ the graphical process designer -->
+ <service category="BPM_orchestration4_Starter_Service"
+ name="Starter_Service"
+ description="BPM Orchestration Sample 4: Use this service to start a process instance">
+ <listeners>
+ <jms-listener name="JMS-Gateway"
+ busidref="startGwChannel" maxThreads="1" is-gateway="true" />
+ <jms-listener name="ESB-Listener"
+ busidref="startEsbChannel" maxThreads="1" />
+ </listeners>
+ <actions>
+ <action name="setup_key"
+ class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script"
+ value="/scripts/setup_key.groovy" />
+ </action>
+ <action name="start_a_new_order_process"
+ class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
+ <property name="command"
+ value="StartProcessInstanceCommand" />
+ <property name="process-definition-name"
+ value="bpm4_ESBOrderProcess" />
+ <property name="key" value="body.businessKey" />
+ <property name="esbToBpmVars">
+ <mapping esb="BODY_CONTENT" bpm="entireOrderAsXML" />
+ </property>
+
+ </action>
+ <action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="After" />
+ <property name="printfull" value="true"/>
+ </action>
+ </actions>
+ </service>
+ <service category="BPM_Orchestration4" name="IntakeService"
+ description="IntakeService: transforms, massages, calculates priority">
+ <listeners>
+ <jms-listener name="ESB-Listener"
+ busidref="intakeServiceEsbChannel" maxThreads="1" />
+ </listeners>
+ <actions>
+
+ <action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="INTAKE START" />
+ <property name="printfull" value="true"/>
+ </action>
+
+ <action name="groovy"
+ class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script"
+ value="/scripts/intake_service.groovy" />
+ </action>
+
+ <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="true"/>
+ </action>
+
+ <!-- transform -->
+ <action name="discover-message-origin" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script" value="/scripts/check-origin.groovy" />
+ </action>
+
+ <action name="transform" class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+ <property name="resource-config" value="/smooks-config.xml" />
+ </action>
+
+ <action name="SetupMessage"
+ class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SetupMessage">
+ <property name="status" value="60" />
+ <!-- status was not in order XML, this is just for demo purposes -->
+ </action>
+
+ <action name="display"
+ class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script"
+ value="/scripts/display.groovy" />
+ </action>
+
+ <!-- Use the BRP to calculate the order priority -->
+
+ <action
+ class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
+ name="BRP">
+ <property name="ruleSet"
+ value="Priority_Rules.drl" />
+ <property name="ruleReload" value="true" />
+ <property name="object-paths">
+ <object-path esb="body.orderHeader" />
+ <object-path esb="body.customer" />
+ </property>
+ </action>
+ <action name="setupPriority"
+ class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script"
+ value="/scripts/setup_priority.groovy" />
+ </action>
+ <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
+ <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
+ <property name="PREPENDED_TEXT" value="Priority" />
+ <property name="BODY_KEY" value="order_orderPriority" />
+ </action>
+ </actions>
+ </service>
+ <service category="BPM_Orchestration4" name="DiscountService"
+ description="DiscountService">
+ <listeners>
+ <jms-listener name="ESB-Listener"
+ busidref="discountServiceEsbChannel" maxThreads="1" />
+ </listeners>
+ <actions>
+ <action name="groovy"
+ class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script"
+ value="/scripts/discount_service.groovy" />
+ </action>
+ <action name="display"
+ class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script"
+ value="/scripts/display.groovy" />
+ </action>
+
+ <action
+ class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
+ name="discount_calc">
+ <property name="ruleSet"
+ value="Discount_Rules.drl" />
+ <property name="ruleReload" value="true" />
+ <property name="object-paths">
+ <object-path esb="body.orderHeader" />
+ <object-path esb="body.customer" />
+ </property>
+ </action>
+
+ <action name="setupDiscount"
+ class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script"
+ value="/scripts/setup_discount.groovy" />
+ </action>
+
+ <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
+ <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
+ <property name="PREPENDED_TEXT" value="Discount Service" />
+ <property name="BODY_KEY" value="order_orderDiscount" />
+ </action>
+
+ </actions>
+ </service>
+
+ <service category="BPM_Orchestration4" name="ShippingService"
+ description="ShippingService">
+ <listeners>
+ <jms-listener name="ESB-Listener"
+ busidref="shippingServiceEsbChannel" maxThreads="1" />
+ </listeners>
+ <actions>
+ <action name="groovy"
+ class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script"
+ value="/scripts/shipping_service.groovy" />
+ </action>
+
+ <action
+ class="org.jboss.soa.esb.actions.ContentBasedRouter"
+ name="ContentBasedRouter">
+ <property name="ruleSet" value="CBRRules.drl" />
+ <property name="ruleReload" value="true" />
+ <property name="destinations">
+ <route-to
+ destination-name="SuperSpecialCustomerService"
+ service-category="ConciergeManager" service-name="ConciergeService" />
+ <route-to
+ destination-name="SpecialCustomerService"
+ service-category="DistributionManager" service-name="DistributionService" />
+ <route-to
+ destination-name="RegularCustomerService"
+ service-category="BasicShipping" service-name="ShipperService" />
+ </property>
+ <property name="object-paths">
+ <object-path esb="body.orderHeader" />
+ <object-path esb="body.customer" />
+ </property>
+ </action>
+
+ </actions>
+ </service>
+
+ <service category="ConciergeManager"
+ name="ConciergeService" description="For highest priority customers">
+ <listeners>
+ <jms-listener name="conciergeServiceEsbChannel"
+ busidref="conciergeServiceEsbChannel" maxThreads="1">
+ </jms-listener>
+ </listeners>
+ <actions>
+ <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
+ <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
+ <property name="PREPENDED_TEXT" value="Concierge:Highest Priority Customers/Orders" />
+ <property name="BODY_KEY" value="orderHeader" />
+ </action>
+ </actions>
+ </service>
+
+ <service category="DistributionManager"
+ name="DistributionService" description="For medium priority customers">
+ <listeners>
+ <jms-listener name="distributionServiceEsbChannel"
+ busidref="distributionServiceEsbChannel" maxThreads="1">
+ </jms-listener>
+ </listeners>
+ <actions>
+ <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
+ <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
+ <property name="PREPENDED_TEXT" value="Distribution Manager:Medium Priority Customers/Orders" />
+ <property name="BODY_KEY" value="orderHeader" />
+ </action>
+ </actions>
+ </service>
+ <service category="BasicShipping"
+ name="ShipperService" description="For low priority customers">
+ <listeners>
+ <jms-listener name="basicShippingServiceEsbChannel"
+ busidref="basicShippingServiceEsbChannel" maxThreads="1">
+ </jms-listener>
+ </listeners>
+ <actions>
+ <action name="monitor" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions.SimpleJMSNotifier">
+ <property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration4_monitor" />
+ <property name="PREPENDED_TEXT" value="Basic:Lowest Priority Customers/Orders" />
+ <property name="BODY_KEY" value="orderHeader" />
+ </action>
+ </actions>
+ </service>
+
+ </services>
+
+</jbossesb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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,
- @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
- These options are described in the JBossESB manual.
- Defaults are provided here for convenience only.
-
- Please read through this file prior to using the system, and consider
- updating the specified entries.
--->
-<esb
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
- <properties name="core">
- <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
- <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
- </properties>
- <properties name="registry">
- <property name="org.jboss.soa.esb.registry.queryManagerURI"
- value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
- value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
- <property name="org.jboss.soa.esb.registry.implementationClass"
- value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
- <property name="org.jboss.soa.esb.registry.factoryClass"
- value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
- <property name="org.jboss.soa.esb.registry.user"
- value="jbossesb"/>
- <property name="org.jboss.soa.esb.registry.password"
- value="password"/>
- <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
- <property name="org.jboss.soa.esb.scout.proxy.transportClass"
- value="org.apache.ws.scout.transport.RMITransport"/>
- </properties>
- <properties name="transports" depends="core">
- <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
- <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
- <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
- </properties>
- <properties name="connection">
- <property name="min-pool-size" value="5"/>
- <property name="max-pool=size" value="10"/>
- <property name="blocking-timeout-millis" value="5000"/>
- <property name="abandoned-connection-timeout" value="10000"/>
- <property name="abandoned-connection-time-interval" value="30000"/>
- </properties>
- <properties name="dbstore">
- <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
- <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
- <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
- <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
- <!--table managed by pool to test for valid connections - created by pool automatically -->
- <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
- <!-- # of milliseconds to timeout waiting for a connection from pool -->
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
- </properties>
- <properties name="messagerouting">
- <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
- </properties>
-</esb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jndi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jndi.properties 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jndi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jndi.properties (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/jndi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jndi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/jndi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/juddi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/juddi.properties 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/juddi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
-
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/juddi.properties (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/juddi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/juddi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/juddi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/lib (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/lib)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/log4j.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/log4j.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/log4j.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
- <param name="Threshold" value="INFO"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <!-- A size based file rolling appender -->
- <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="File" value="./listener.log"/>
- <param name="Append" value="false"/>
- <param name="MaxFileSize" value="500KB"/>
- <param name="MaxBackupIndex" value="1"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jboss">
- <priority value="WARN"/>
- </category>
- <category name="org.jboss.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.jboss.internal.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.apache">
- <priority value="ERROR"/>
- </category>
- <category name="quickstart">
- <priority value="DEBUG"/>
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/log4j.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/log4j.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/log4j.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="DEBUG"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/Review_Order.xhtml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition/Review_Order.xhtml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/Review_Order.xhtml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,84 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
-
-<!-- the DOCTYPE means we are required to use html for a root element -->
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:c="http://java.sun.com/jstl/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:tf="http://jbpm.org/jsf/tf"
- xmlns:jbpm="http://jbpm.org/jsf">
-
- <ui:component>
-
- <jbpm:dataform>
-
- <f:facet name="header">
- <h:outputText value="#{taskName}"/>
- </f:facet>
-
- <!-- TASKFORM ROWS -->
- <jbpm:datacell>
- <f:facet name="header">
- <h:outputText value="customer_firstName"/>
- </f:facet>
- <h:inputText value="#{var['customer_firstName']}" />
- </jbpm:datacell>
- <jbpm:datacell>
- <f:facet name="header">
- <h:outputText value="customer_lastName"/>
- </f:facet>
- <h:inputText value="#{var['customer_lastName']}" />
- </jbpm:datacell>
- <jbpm:datacell>
- <f:facet name="header">
- <h:outputText value="customer_status"/>
- </f:facet>
- <h:inputText value="#{var['customer_status']}" />
- </jbpm:datacell>
- <jbpm:datacell>
- <f:facet name="header">
- <h:outputText value="order_totalamount"/>
- </f:facet>
- <h:inputText value="#{var['order_totalamount']}" />
- </jbpm:datacell>
- <jbpm:datacell>
- <f:facet name="header">
- <h:outputText value="order_priority"/>
- </f:facet>
- <h:inputText value="#{var['order_priority']}" />
- </jbpm:datacell>
- <jbpm:datacell>
- <f:facet name="header">
- <h:outputText value="order_orderid"/>
- </f:facet>
- <h:inputText value="#{var['order_orderid']}" />
- </jbpm:datacell>
- <jbpm:datacell>
- <f:facet name="header">
- <h:outputText value="order_discount"/>
- </f:facet>
- <h:inputText value="#{var['order_discount']}" />
- </jbpm:datacell>
- <jbpm:datacell>
- <f:facet name="header">
- <h:outputText value="entireOrder"/>
- </f:facet>
- <h:inputText value="#{var['entireOrderAsXML']}" />
- </jbpm:datacell>
-
- <jbpm:datacell>
- <f:facet name="header">
- <h:outputText value="Actions"/>
- </f:facet>
- <!-- TASKFORM BUTTONS -->
- <tf:saveButton value="Save"/>
- <tf:cancelButton value="Cancel"/>
- <tf:transitionButton value="Save and Close"/>
- </jbpm:datacell>
-
- </jbpm:dataform>
-
- </ui:component>
-
-</html>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/Review_Order.xhtml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition/Review_Order.xhtml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/Review_Order.xhtml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/Review_Order.xhtml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,84 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
+
+<!-- the DOCTYPE means we are required to use html for a root element -->
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:tf="http://jbpm.org/jsf/tf"
+ xmlns:jbpm="http://jbpm.org/jsf">
+
+ <ui:component>
+
+ <jbpm:dataform>
+
+ <f:facet name="header">
+ <h:outputText value="#{taskName}"/>
+ </f:facet>
+
+ <!-- TASKFORM ROWS -->
+ <jbpm:datacell>
+ <f:facet name="header">
+ <h:outputText value="customer_firstName"/>
+ </f:facet>
+ <h:inputText value="#{var['customer_firstName']}" />
+ </jbpm:datacell>
+ <jbpm:datacell>
+ <f:facet name="header">
+ <h:outputText value="customer_lastName"/>
+ </f:facet>
+ <h:inputText value="#{var['customer_lastName']}" />
+ </jbpm:datacell>
+ <jbpm:datacell>
+ <f:facet name="header">
+ <h:outputText value="customer_status"/>
+ </f:facet>
+ <h:inputText value="#{var['customer_status']}" />
+ </jbpm:datacell>
+ <jbpm:datacell>
+ <f:facet name="header">
+ <h:outputText value="order_totalamount"/>
+ </f:facet>
+ <h:inputText value="#{var['order_totalamount']}" />
+ </jbpm:datacell>
+ <jbpm:datacell>
+ <f:facet name="header">
+ <h:outputText value="order_priority"/>
+ </f:facet>
+ <h:inputText value="#{var['order_priority']}" />
+ </jbpm:datacell>
+ <jbpm:datacell>
+ <f:facet name="header">
+ <h:outputText value="order_orderid"/>
+ </f:facet>
+ <h:inputText value="#{var['order_orderid']}" />
+ </jbpm:datacell>
+ <jbpm:datacell>
+ <f:facet name="header">
+ <h:outputText value="order_discount"/>
+ </f:facet>
+ <h:inputText value="#{var['order_discount']}" />
+ </jbpm:datacell>
+ <jbpm:datacell>
+ <f:facet name="header">
+ <h:outputText value="entireOrder"/>
+ </f:facet>
+ <h:inputText value="#{var['entireOrderAsXML']}" />
+ </jbpm:datacell>
+
+ <jbpm:datacell>
+ <f:facet name="header">
+ <h:outputText value="Actions"/>
+ </f:facet>
+ <!-- TASKFORM BUTTONS -->
+ <tf:saveButton value="Save"/>
+ <tf:cancelButton value="Cancel"/>
+ <tf:transitionButton value="Save and Close"/>
+ </jbpm:datacell>
+
+ </jbpm:dataform>
+
+ </ui:component>
+
+</html>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/forms.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition/forms.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/forms.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<forms>
- <form task="Order Review" form="Review_Order.xhtml"/>
- <form task="Discount Review" form="Review_Order.xhtml"/>
-</forms>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/forms.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition/forms.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/forms.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/forms.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<forms>
+ <form task="Order Review" form="Review_Order.xhtml"/>
+ <form task="Discount Review" form="Review_Order.xhtml"/>
+</forms>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/gpd.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition/gpd.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/gpd.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process-diagram name="bpm4_ESBOrderProcess" width="694" height="607">
- <node name="start" x="1" y="11" width="140" height="40">
- <transition name="">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="Intake Order" x="41" y="87" width="140" height="40">
- <transition name="">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="Review Order" x="241" y="86" width="140" height="40">
- <transition name="">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="Calculate Discount" x="40" y="155" width="140" height="40">
- <transition name="">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="Review Discount" x="239" y="155" width="140" height="40">
- <transition name="">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="Ship It" x="40" y="226" width="140" height="40">
- <transition name="">
- <label x="5" y="-10"/>
- </transition>
- </node>
- <node name="end" x="8" y="317" width="140" height="40"/>
-</process-diagram>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/gpd.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition/gpd.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/gpd.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/gpd.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-diagram name="bpm4_ESBOrderProcess" width="694" height="607">
+ <node name="start" x="1" y="11" width="140" height="40">
+ <transition name="">
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="Intake Order" x="41" y="87" width="140" height="40">
+ <transition name="">
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="Review Order" x="241" y="86" width="140" height="40">
+ <transition name="">
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="Calculate Discount" x="40" y="155" width="140" height="40">
+ <transition name="">
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="Review Discount" x="239" y="155" width="140" height="40">
+ <transition name="">
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="Ship It" x="40" y="226" width="140" height="40">
+ <transition name="">
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="end" x="8" y="317" width="140" height="40"/>
+</process-diagram>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processdefinition.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition/processdefinition.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processdefinition.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process-definition
- name="bpm4_ESBOrderProcess">
- <start-state name="start">
- <transition name="" to="Intake Order"></transition>
- </start-state>
-
- <node name="Intake Order">
-
- <action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
- <esbCategoryName>BPM_Orchestration4</esbCategoryName>
- <esbServiceName>IntakeService</esbServiceName>
- <!-- async call of IntakeService -->
- <bpmToEsbVars>
- <mapping bpm="entireOrderAsXML" esb="BODY_CONTENT" />
- </bpmToEsbVars>
- <esbToBpmVars>
- <mapping esb="body.entireOrderAsXML" bpm="entireOrderAsXML" />
- <mapping esb="body.orderHeader" bpm="entireOrderAsObject" />
- <mapping esb="body.customer" bpm="entireCustomerAsObject" />
- <mapping esb="body.order_orderId" bpm="order_orderid" />
- <mapping esb="body.order_totalAmount" bpm="order_totalamount" />
- <mapping esb="body.order_orderPriority" bpm="order_priority" />
- <mapping esb="body.customer_firstName" bpm="customer_firstName" />
- <mapping esb="body.customer_lastName" bpm="customer_lastName" />
- <mapping esb="body.customer_status" bpm="customer_status" />
- </esbToBpmVars>
- </action>
-
- <transition name="" to="Review Order"></transition>
- </node>
-
- <task-node name="Review Order">
- <task name="Order Review">
- <assignment actor-id="user"></assignment>
- <controller>
- <variable name="customer_firstName" access="read,write,required"></variable>
- <variable name="customer_lastName" access="read,write,required"></variable>
- <variable name="customer_status" access="read"></variable>
- <variable name="order_totalamount" access="read"></variable>
- <variable name="order_priority" access="read"></variable>
- <variable name="order_orderid" access="read"></variable>
- <variable name="order_discount" access="read"></variable>
- <variable name="entireOrderAsXML" access="read"></variable>
- </controller>
- </task>
- <transition name="" to="Calculate Discount"></transition>
- </task-node>
-
- <node name="Calculate Discount">
-
- <action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
- <esbCategoryName>BPM_Orchestration4</esbCategoryName>
- <esbServiceName>DiscountService</esbServiceName>
- <bpmToEsbVars>
- <mapping bpm="entireCustomerAsObject" esb="customer" />
- <mapping bpm="entireOrderAsObject" esb="orderHeader" />
- <mapping bpm="entireOrderAsXML" esb="BODY_CONTENT" />
- </bpmToEsbVars>
- <esbToBpmVars>
- <mapping bpm="entireOrderAsObject" esb="order" />
- <mapping esb="body.order_orderDiscount" bpm="order_discount" />
- </esbToBpmVars>
- </action>
-
- <transition name="" to="Review Discount"></transition>
- </node>
-
- <task-node name="Review Discount">
- <task name="Discount Review">
- <assignment actor-id="manager"></assignment>
- </task>
- <transition name="" to="Ship It"></transition>
- </task-node>
-
- <node name="Ship It">
- <transition name="" to="end">
- <action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbNotifier">
- <esbCategoryName>BPM_Orchestration4</esbCategoryName>
- <esbServiceName>ShippingService</esbServiceName>
- <bpmToEsbVars><mapping bpm="entireCustomerAsObject" esb="customer" />
- <mapping bpm="entireOrderAsObject" esb="orderHeader" />
- <mapping bpm="entireOrderAsXML" esb="entireOrderAsXML" />
- </bpmToEsbVars>
- </action>
- </transition>
- </node>
-
- <end-state name="end"></end-state>
-
-</process-definition>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processdefinition.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition/processdefinition.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processdefinition.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processdefinition.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ name="bpm4_ESBOrderProcess">
+ <start-state name="start">
+ <transition name="" to="Intake Order"></transition>
+ </start-state>
+
+ <node name="Intake Order">
+
+ <action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbCategoryName>BPM_Orchestration4</esbCategoryName>
+ <esbServiceName>IntakeService</esbServiceName>
+ <!-- async call of IntakeService -->
+ <bpmToEsbVars>
+ <mapping bpm="entireOrderAsXML" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="body.entireOrderAsXML" bpm="entireOrderAsXML" />
+ <mapping esb="body.orderHeader" bpm="entireOrderAsObject" />
+ <mapping esb="body.customer" bpm="entireCustomerAsObject" />
+ <mapping esb="body.order_orderId" bpm="order_orderid" />
+ <mapping esb="body.order_totalAmount" bpm="order_totalamount" />
+ <mapping esb="body.order_orderPriority" bpm="order_priority" />
+ <mapping esb="body.customer_firstName" bpm="customer_firstName" />
+ <mapping esb="body.customer_lastName" bpm="customer_lastName" />
+ <mapping esb="body.customer_status" bpm="customer_status" />
+ </esbToBpmVars>
+ </action>
+
+ <transition name="" to="Review Order"></transition>
+ </node>
+
+ <task-node name="Review Order">
+ <task name="Order Review">
+ <assignment actor-id="user"></assignment>
+ <controller>
+ <variable name="customer_firstName" access="read,write,required"></variable>
+ <variable name="customer_lastName" access="read,write,required"></variable>
+ <variable name="customer_status" access="read"></variable>
+ <variable name="order_totalamount" access="read"></variable>
+ <variable name="order_priority" access="read"></variable>
+ <variable name="order_orderid" access="read"></variable>
+ <variable name="order_discount" access="read"></variable>
+ <variable name="entireOrderAsXML" access="read"></variable>
+ </controller>
+ </task>
+ <transition name="" to="Calculate Discount"></transition>
+ </task-node>
+
+ <node name="Calculate Discount">
+
+ <action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbCategoryName>BPM_Orchestration4</esbCategoryName>
+ <esbServiceName>DiscountService</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="entireCustomerAsObject" esb="customer" />
+ <mapping bpm="entireOrderAsObject" esb="orderHeader" />
+ <mapping bpm="entireOrderAsXML" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping bpm="entireOrderAsObject" esb="order" />
+ <mapping esb="body.order_orderDiscount" bpm="order_discount" />
+ </esbToBpmVars>
+ </action>
+
+ <transition name="" to="Review Discount"></transition>
+ </node>
+
+ <task-node name="Review Discount">
+ <task name="Discount Review">
+ <assignment actor-id="manager"></assignment>
+ </task>
+ <transition name="" to="Ship It"></transition>
+ </task-node>
+
+ <node name="Ship It">
+ <transition name="" to="end">
+ <action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbNotifier">
+ <esbCategoryName>BPM_Orchestration4</esbCategoryName>
+ <esbServiceName>ShippingService</esbServiceName>
+ <bpmToEsbVars><mapping bpm="entireCustomerAsObject" esb="customer" />
+ <mapping bpm="entireOrderAsObject" esb="orderHeader" />
+ <mapping bpm="entireOrderAsXML" esb="entireOrderAsXML" />
+ </bpmToEsbVars>
+ </action>
+ </transition>
+ </node>
+
+ <end-state name="end"></end-state>
+
+</process-definition>
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processimage.jpg
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/processDefinition/processimage.jpg (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/processDefinition/processimage.jpg)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/readme.txt
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/readme.txt 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,11 +0,0 @@
-Overview:
-=========
- Review the docs/Readme.pdf
-
-To Run standalone mode:
-=======================
- Do not run standalone.
-
-To Run '.esb' archive mode:
-===========================
- Review the docs/Readme.pdf
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/readme.txt (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/readme.txt)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,11 @@
+Overview:
+=========
+ Review the docs/Readme.pdf
+
+To Run standalone mode:
+=======================
+ Do not run standalone.
+
+To Run '.esb' archive mode:
+===========================
+ Review the docs/Readme.pdf
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/check-origin.groovy
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/check-origin.groovy 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/check-origin.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,11 +0,0 @@
-
-def messageText = message.getBody().get();
-def order = new XmlParser().parseText(messageText);
-
-if(order.OrderLines.size() == 1) {
- message.getProperties().setProperty("from", "dvdstore");
-} else if(order.LineItems.size() == 1) {
- message.getProperties().setProperty("from", "petstore");
-}
-
-println "Message from: " + message.getProperties().getProperty("from");
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/check-origin.groovy (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/check-origin.groovy)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/check-origin.groovy (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/check-origin.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,11 @@
+
+def messageText = message.getBody().get();
+def order = new XmlParser().parseText(messageText);
+
+if(order.OrderLines.size() == 1) {
+ message.getProperties().setProperty("from", "dvdstore");
+} else if(order.LineItems.size() == 1) {
+ message.getProperties().setProperty("from", "petstore");
+}
+
+println "Message from: " + message.getProperties().getProperty("from");
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/discount_service.groovy
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/discount_service.groovy 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/discount_service.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,9 +0,0 @@
-import org.jboss.soa.esb.message.*
-
-println " Begin Discount Service "
-
-println "default location: " + message.body.get()
-println "Order Header: " + message.body.get("orderHeader")
-println "Customer: " + message.body.get("customer")
-
-println " End Discount Service "
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/discount_service.groovy (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/discount_service.groovy)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/discount_service.groovy (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/discount_service.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,9 @@
+import org.jboss.soa.esb.message.*
+
+println " Begin Discount Service "
+
+println "default location: " + message.body.get()
+println "Order Header: " + message.body.get("orderHeader")
+println "Customer: " + message.body.get("customer")
+
+println " End Discount Service "
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/display.groovy
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/display.groovy 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/display.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,6 +0,0 @@
-import org.jboss.soa.esb.message.*
-
-println " == BEGIN =="
-println "orderHeader: " + message.body.get("orderHeader")
-println "customer: " + message.body.get("customer")
-println " == END =="
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/display.groovy (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/display.groovy)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/display.groovy (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/display.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,6 @@
+import org.jboss.soa.esb.message.*
+
+println " == BEGIN =="
+println "orderHeader: " + message.body.get("orderHeader")
+println "customer: " + message.body.get("customer")
+println " == END =="
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/fixer.groovy
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/fixer.groovy 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/fixer.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,11 +0,0 @@
-import org.jboss.soa.esb.message.*
-
-println "*********** BEGIN FIXER ***********"
-
-println "In: " + new String(message.body.contents)
-
-message.body.add(new String(message.body.contents))
-
-println "Out: " + new String(message.body.get())
-
-println "************ END FIXER ************"
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/fixer.groovy (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/fixer.groovy)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/fixer.groovy (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/fixer.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,11 @@
+import org.jboss.soa.esb.message.*
+
+println "*********** BEGIN FIXER ***********"
+
+println "In: " + new String(message.body.contents)
+
+message.body.add(new String(message.body.contents))
+
+println "Out: " + new String(message.body.get())
+
+println "************ END FIXER ************"
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/intake_service.groovy
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/intake_service.groovy 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/intake_service.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,5 +0,0 @@
-import org.jboss.soa.esb.message.*
-
-println " == Begin Intake Service =="
-println "DEFAULT: " + message.body.get()
-println " == End Intake Service =="
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/intake_service.groovy (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/intake_service.groovy)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/intake_service.groovy (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/intake_service.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,5 @@
+import org.jboss.soa.esb.message.*
+
+println " == Begin Intake Service =="
+println "DEFAULT: " + message.body.get()
+println " == End Intake Service =="
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_discount.groovy
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/setup_discount.groovy 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_discount.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,12 +0,0 @@
-import org.jboss.soa.esb.message.*
-import org.jboss.soa.esb.store.OrderHeader
-
-println "*********** BEGIN ORDER DISCOUNT FIXER ***********"
-
-println "Order: " + message.body.get("orderHeader")
-order = (OrderHeader) message.body.get("orderHeader")
-
-message.body.add("order_orderDiscount",order.getOrderDiscount())
-
-
-println "************ END ORDER DISCOUNT FIXER ************"
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_discount.groovy (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/setup_discount.groovy)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_discount.groovy (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_discount.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,12 @@
+import org.jboss.soa.esb.message.*
+import org.jboss.soa.esb.store.OrderHeader
+
+println "*********** BEGIN ORDER DISCOUNT FIXER ***********"
+
+println "Order: " + message.body.get("orderHeader")
+order = (OrderHeader) message.body.get("orderHeader")
+
+message.body.add("order_orderDiscount",order.getOrderDiscount())
+
+
+println "************ END ORDER DISCOUNT FIXER ************"
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_key.groovy
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/setup_key.groovy 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_key.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,11 +0,0 @@
-import org.jboss.soa.esb.message.*
-
-println "*********** BEGIN ORDER KEY SETUP ***********"
-
-def messageText = message.getBody().get();
-def order = new XmlParser().parseText(messageText);
-def key = order['@orderId']
-println "Key: " + key
-message.getBody().add("businessKey",key);
-
-println "************ END ORDER KEY SETUP ************"
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_key.groovy (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/setup_key.groovy)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_key.groovy (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_key.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,11 @@
+import org.jboss.soa.esb.message.*
+
+println "*********** BEGIN ORDER KEY SETUP ***********"
+
+def messageText = message.getBody().get();
+def order = new XmlParser().parseText(messageText);
+def key = order['@orderId']
+println "Key: " + key
+message.getBody().add("businessKey",key);
+
+println "************ END ORDER KEY SETUP ************"
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_priority.groovy
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/setup_priority.groovy 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_priority.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,12 +0,0 @@
-import org.jboss.soa.esb.message.*
-import org.jboss.soa.esb.store.OrderHeader
-
-println "*********** BEGIN ORDER PRIORITY FIXER ***********"
-
-println "Order: " + message.body.get("orderHeader")
-order = (OrderHeader) message.body.get("orderHeader")
-
-message.body.add("order_orderPriority",order.getOrderPriority())
-
-
-println "************ END ORDER PRIORITY FIXER ************"
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_priority.groovy (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/setup_priority.groovy)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_priority.groovy (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/setup_priority.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,12 @@
+import org.jboss.soa.esb.message.*
+import org.jboss.soa.esb.store.OrderHeader
+
+println "*********** BEGIN ORDER PRIORITY FIXER ***********"
+
+println "Order: " + message.body.get("orderHeader")
+order = (OrderHeader) message.body.get("orderHeader")
+
+message.body.add("order_orderPriority",order.getOrderPriority())
+
+
+println "************ END ORDER PRIORITY FIXER ************"
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/shipping_service.groovy
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/shipping_service.groovy 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/shipping_service.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,9 +0,0 @@
-import org.jboss.soa.esb.message.*
-
-println " Begin Shipping Service "
-
-println "Original XML: " + message.body.get("entireOrderAsXML")
-println "Customer: " + message.body.get("customer")
-println "Order: " + message.body.get("orderHeader")
-
-println " End Shipping Service "
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/shipping_service.groovy (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/scripts/shipping_service.groovy)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/shipping_service.groovy (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/scripts/shipping_service.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,9 @@
+import org.jboss.soa.esb.message.*
+
+println " Begin Shipping Service "
+
+println "Original XML: " + message.body.get("entireOrderAsXML")
+println "Customer: " + message.body.get("customer")
+println "Order: " + message.body.get("orderHeader")
+
+println " End Shipping Service "
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/smooks-config.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/smooks-config.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/smooks-config.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
-
- <import file="classpath:/transforms/from-dvdstore.xml" />
- <import file="classpath:/transforms/from-petstore.xml" />
-
-</smooks-resource-list>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/smooks-config.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/smooks-config.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/smooks-config.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/smooks-config.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+ <import file="classpath:/transforms/from-dvdstore.xml" />
+ <import file="classpath:/transforms/from-petstore.xml" />
+
+</smooks-resource-list>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4 (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SetupMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SetupMessage.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SetupMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,70 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions;
-
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.store.Customer;
-import org.jboss.soa.esb.store.OrderHeader;
-import org.apache.log4j.Logger;
-
-public class SetupMessage extends AbstractActionPipelineProcessor {
- private Logger logger = Logger.getLogger(SetupMessage.class);
- private int status = 0;
-
- public Message process(Message message) throws ActionProcessingException {
-
- OrderHeader order = (OrderHeader) message.getBody().get("orderHeader");
- Customer customer = (Customer) message.getBody().get("customer");
- //List orderItems = (List) message.getBody().get("orderItemList");
-
- customer.setStatus(status);
-
- logger.info("--------------------------------");
- logger.info("Customer: " + customer);
- logger.info("Order: " + order);
- logger.info("businessKey: " + order.getOrderId());
- logger.info("--------------------------------");
-
- message.getBody().add("entireOrderAsXML", message.getBody().get());
- message.getBody().add("order_orderId", order.getOrderId());
- message.getBody().add("order_orderPriority", order.getOrderPriority());
- message.getBody().add("order_totalAmount", order.getTotalAmount());
- message.getBody().add("order_discount", order.getOrderDiscount());
- message.getBody().add("businessKey", order.getOrderId());
-
- message.getBody().add("customer_firstName", customer.getFirstName());
- message.getBody().add("customer_lastName", customer.getLastName());
- message.getBody().add("customer_status", customer.getStatus());
-
- logger.info("Moved the transformed Order Header and Customer");
-
- return message;
- }
-
- public SetupMessage(ConfigTree configTree) { // demo purposes, passed in
- // from the jboss-esb.xml
- status = Integer.parseInt(configTree.getAttribute("status"));
- }
-
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SetupMessage.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SetupMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SetupMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SetupMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,70 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.store.Customer;
+import org.jboss.soa.esb.store.OrderHeader;
+import org.apache.log4j.Logger;
+
+public class SetupMessage extends AbstractActionPipelineProcessor {
+ private Logger logger = Logger.getLogger(SetupMessage.class);
+ private int status = 0;
+
+ public Message process(Message message) throws ActionProcessingException {
+
+ OrderHeader order = (OrderHeader) message.getBody().get("orderHeader");
+ Customer customer = (Customer) message.getBody().get("customer");
+ //List orderItems = (List) message.getBody().get("orderItemList");
+
+ customer.setStatus(status);
+
+ logger.info("--------------------------------");
+ logger.info("Customer: " + customer);
+ logger.info("Order: " + order);
+ logger.info("businessKey: " + order.getOrderId());
+ logger.info("--------------------------------");
+
+ message.getBody().add("entireOrderAsXML", message.getBody().get());
+ message.getBody().add("order_orderId", order.getOrderId());
+ message.getBody().add("order_orderPriority", order.getOrderPriority());
+ message.getBody().add("order_totalAmount", order.getTotalAmount());
+ message.getBody().add("order_discount", order.getOrderDiscount());
+ message.getBody().add("businessKey", order.getOrderId());
+
+ message.getBody().add("customer_firstName", customer.getFirstName());
+ message.getBody().add("customer_lastName", customer.getLastName());
+ message.getBody().add("customer_status", customer.getStatus());
+
+ logger.info("Moved the transformed Order Header and Customer");
+
+ return message;
+ }
+
+ public SetupMessage(ConfigTree configTree) { // demo purposes, passed in
+ // from the jboss-esb.xml
+ status = Integer.parseInt(configTree.getAttribute("status"));
+ }
+
+}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SimpleJMSNotifier.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SimpleJMSNotifier.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SimpleJMSNotifier.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,94 +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,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.apache.log4j.Logger;
-
-import java.util.Properties;
-
-import javax.jms.TextMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-public class SimpleJMSNotifier extends AbstractActionLifecycle {
- protected ConfigTree _config;
- private Logger logger = Logger.getLogger(SimpleJMSNotifier.class);
- String queueName = "quickstart_bpm_orchestration4_monitor";
- String prependedText = "";
- String bodyKey ="";
- public Message process(Message message) throws Exception {
- QueueConnection conn;
- QueueSession session;
- Queue que;
-
- Properties properties1 = new Properties();
- properties1.put(Context.INITIAL_CONTEXT_FACTORY,
- "org.jnp.interfaces.NamingContextFactory");
- properties1.put(Context.URL_PKG_PREFIXES,
- "org.jboss.naming:org.jnp.interfaces");
- properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
- InitialContext iniCtx = new InitialContext(properties1);
-
- Object tmp = iniCtx.lookup("ConnectionFactory");
- QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
- conn = qcf.createQueueConnection();
- que = (Queue) iniCtx.lookup("queue/" + queueName);
- session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- conn.start();
- //logger.info("Connection Started");
-
- QueueSender send = session.createSender(que);
- String msg = "";
-
- if (bodyKey == null || bodyKey.equals("")) {
- msg = prependedText + "\n" + message.getBody().get();
- } else {
- msg = prependedText+ "\n" + message.getBody().get(bodyKey);
- }
-
- TextMessage tm = session.createTextMessage(msg);
- send.send(tm);
- send.close();
-
- conn.stop();
- session.close();
- conn.close();
-
- return message;
- }
-
- public SimpleJMSNotifier(ConfigTree config) {
- _config = config;
- queueName = _config.getAttribute("ALERT_QUEUE_NAME");
- prependedText = _config.getAttribute("PREPENDED_TEXT");
- bodyKey = _config.getAttribute("BODY_KEY");
- logger.info("Who to alert: " + queueName);
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SimpleJMSNotifier.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SimpleJMSNotifier.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SimpleJMSNotifier.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/esb_actions/SimpleJMSNotifier.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,94 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.esb_actions;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.apache.log4j.Logger;
+
+import java.util.Properties;
+
+import javax.jms.TextMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+public class SimpleJMSNotifier extends AbstractActionLifecycle {
+ protected ConfigTree _config;
+ private Logger logger = Logger.getLogger(SimpleJMSNotifier.class);
+ String queueName = "quickstart_bpm_orchestration4_monitor";
+ String prependedText = "";
+ String bodyKey ="";
+ public Message process(Message message) throws Exception {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/" + queueName);
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ //logger.info("Connection Started");
+
+ QueueSender send = session.createSender(que);
+ String msg = "";
+
+ if (bodyKey == null || bodyKey.equals("")) {
+ msg = prependedText + "\n" + message.getBody().get();
+ } else {
+ msg = prependedText+ "\n" + message.getBody().get(bodyKey);
+ }
+
+ TextMessage tm = session.createTextMessage(msg);
+ send.send(tm);
+ send.close();
+
+ conn.stop();
+ session.close();
+ conn.close();
+
+ return message;
+ }
+
+ public SimpleJMSNotifier(ConfigTree config) {
+ _config = config;
+ queueName = _config.getAttribute("ALERT_QUEUE_NAME");
+ prependedText = _config.getAttribute("PREPENDED_TEXT");
+ bodyKey = _config.getAttribute("BODY_KEY");
+ logger.info("Who to alert: " + queueName);
+ }
+}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessage.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,85 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.test;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-public class SendJMSMessage {
- QueueConnection conn;
- QueueSession session;
- Queue que;
-
- public void setupConnection(String queueName) throws JMSException, NamingException
- {
- InitialContext iniCtx = new InitialContext();
- Object tmp = iniCtx.lookup("ConnectionFactory");
- QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
- conn = qcf.createQueueConnection();
- que = (Queue) iniCtx.lookup(queueName);
- session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- conn.start();
- System.out.println("Connection Started");
- }
-
- public void stop() throws JMSException
- {
- conn.stop();
- session.close();
- conn.close();
- }
-
- public void sendAMessage(String msg, String tokenID) throws JMSException {
-
- QueueSender send = session.createSender(que);
- ObjectMessage tm = session.createObjectMessage(msg);
- if (tokenID != null && !tokenID.equals(""))
- tm.setStringProperty("token",tokenID);
- send.send(tm);
- send.close();
- }
-
-
- public static void main(String args[]) throws Exception
- {
- SendJMSMessage sm = new SendJMSMessage();
- try {
- sm.setupConnection(args[0]);
- if (args.length < 3)
- sm.sendAMessage(args[1],null);
- else
- sm.sendAMessage(args[1],args[2]);
- } catch (Exception e) {
- System.out.println(e);
- } finally {
- sm.stop();
- }
-
- }
-
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessage.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,85 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.test;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+ public void setupConnection(String queueName) throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup(queueName);
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg, String tokenID) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ if (tokenID != null && !tokenID.equals(""))
+ tm.setStringProperty("token",tokenID);
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ try {
+ sm.setupConnection(args[0]);
+ if (args.length < 3)
+ sm.sendAMessage(args[1],null);
+ else
+ sm.sendAMessage(args[1],args[2]);
+ } catch (Exception e) {
+ System.out.println(e);
+ } finally {
+ sm.stop();
+ }
+
+ }
+
+}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessageStart.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessageStart.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessageStart.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,110 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.test;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.jms.JMSException;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueSession;
-import javax.jms.QueueSender;
-import javax.jms.ObjectMessage;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-
-public class SendJMSMessageStart {
- QueueConnection conn;
- QueueSession session;
- Queue que;
-
-
- public void setupConnection() throws JMSException, NamingException
- {
- InitialContext iniCtx = new InitialContext();
- Object tmp = iniCtx.lookup("ConnectionFactory");
- QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
- conn = qcf.createQueueConnection();
- que = (Queue) iniCtx.lookup("queue/quickstart_bpm_orchestration4_start_gw");
- session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- conn.start();
- System.out.println("Connection Started");
- }
-
- public void stop() throws JMSException
- {
- conn.stop();
- session.close();
- conn.close();
- }
-
- public void sendAMessage(String msg) throws JMSException {
-
- QueueSender send = session.createSender(que);
- ObjectMessage tm = session.createObjectMessage(msg);
- send.send(tm);
- send.close();
- }
- public String readAsciiFile(String fileName) throws IOException {
- FileReader fr = null;
- char[] thechars = null;
-
- try {
- File thefile = new File( fileName );
- fr = new FileReader( thefile );
- int size = (int) thefile.length();
- thechars = new char[size];
-
- int count, index = 0;
-
- // read in the bytes from the input stream
- while( ( count = fr.read( thechars, index, size ) ) > 0 ) {
- size -= count;
- index += count;
- }
- } catch(Exception e) {
- System.out.println(e);
- }
- finally {
- if( fr != null )
- fr.close();
- }
- return new String(thechars);
-
- } // readAsciiFile
-
- public static void main(String args[]) throws Exception
- {
- SendJMSMessageStart sm = new SendJMSMessageStart();
- sm.setupConnection();
- String fileContent = sm.readAsciiFile(args[0]);
- System.out.println("---------------------------------------------");
- System.out.println(fileContent);
- System.out.println("---------------------------------------------");
- sm.sendAMessage(fileContent);
- sm.stop();
-
- }
-
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessageStart.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessageStart.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessageStart.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration4/test/SendJMSMessageStart.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,110 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.test;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.jms.JMSException;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueSession;
+import javax.jms.QueueSender;
+import javax.jms.ObjectMessage;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class SendJMSMessageStart {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_bpm_orchestration4_start_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ }
+ public String readAsciiFile(String fileName) throws IOException {
+ FileReader fr = null;
+ char[] thechars = null;
+
+ try {
+ File thefile = new File( fileName );
+ fr = new FileReader( thefile );
+ int size = (int) thefile.length();
+ thechars = new char[size];
+
+ int count, index = 0;
+
+ // read in the bytes from the input stream
+ while( ( count = fr.read( thechars, index, size ) ) > 0 ) {
+ size -= count;
+ index += count;
+ }
+ } catch(Exception e) {
+ System.out.println(e);
+ }
+ finally {
+ if( fr != null )
+ fr.close();
+ }
+ return new String(thechars);
+
+ } // readAsciiFile
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessageStart sm = new SendJMSMessageStart();
+ sm.setupConnection();
+ String fileContent = sm.readAsciiFile(args[0]);
+ System.out.println("---------------------------------------------");
+ System.out.println(fileContent);
+ System.out.println("---------------------------------------------");
+ sm.sendAMessage(fileContent);
+ sm.stop();
+
+ }
+
+}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/Customer.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/Customer.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/Customer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,107 +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,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.store;
-
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class Customer implements Serializable{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- // <Customer userName="user1" firstName="Harry" lastName="Potter" state="SD"/>
- private String userName;
- private String firstName;
- private String lastName;
- private String state;
- private int status;
-
- public void setStatus(int status) {
- this.status = status;
- }
- public int getStatus() {
- return this.status;
- }
- /**
- * @return Returns the firstName.
- */
- public String getFirstName() {
- return firstName;
- }
- /**
- * @param firstName The firstName to set.
- */
- public void setFirstName(String firstName) {
- //System.out.println("**** firstName: " + firstName);
- this.firstName = firstName;
- }
- /**
- * @return Returns the lastName.
- */
- public String getLastName() {
- return lastName;
- }
- /**
- * @param lastName The lastName to set.
- */
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
- /**
- * @return Returns the state.
- */
- public String getState() {
- return state;
- }
- /**
- * @param state The state to set.
- */
- public void setState(String state) {
- this.state = state;
- }
- /**
- * @return Returns the userName.
- */
- public String getUserName() {
- return userName;
- }
- /**
- * @param userName The userName to set.
- */
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return userName + "," + firstName + "," + lastName + "," + state;
- }
-
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/Customer.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/Customer.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/Customer.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/Customer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,107 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.store;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class Customer implements Serializable{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ // <Customer userName="user1" firstName="Harry" lastName="Potter" state="SD"/>
+ private String userName;
+ private String firstName;
+ private String lastName;
+ private String state;
+ private int status;
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+ public int getStatus() {
+ return this.status;
+ }
+ /**
+ * @return Returns the firstName.
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+ /**
+ * @param firstName The firstName to set.
+ */
+ public void setFirstName(String firstName) {
+ //System.out.println("**** firstName: " + firstName);
+ this.firstName = firstName;
+ }
+ /**
+ * @return Returns the lastName.
+ */
+ public String getLastName() {
+ return lastName;
+ }
+ /**
+ * @param lastName The lastName to set.
+ */
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+ /**
+ * @return Returns the state.
+ */
+ public String getState() {
+ return state;
+ }
+ /**
+ * @param state The state to set.
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+ /**
+ * @return Returns the userName.
+ */
+ public String getUserName() {
+ return userName;
+ }
+ /**
+ * @param userName The userName to set.
+ */
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return userName + "," + firstName + "," + lastName + "," + state;
+ }
+
+
+}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderHeader.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderHeader.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderHeader.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,139 +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,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.store;
-
-import java.util.Calendar;
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class OrderHeader implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- // <Order orderId="1" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0" netAmount="59.97" totalAmount="64.92" tax="4.95">
- private String orderId;
- private Calendar orderDate;
- private String statusCode;
- private double netAmount;
- private double totalAmount;
- private double tax;
- private double orderDiscount;
- private int orderPriority;
-
- public void setOrderPriority(int orderPriority) {
- this.orderPriority = orderPriority;
- }
- public int getOrderPriority() {
- return this.orderPriority;
- }
-
- public void setOrderDiscount(double orderDiscount) {
- this.orderDiscount = orderDiscount;
- }
- public double getOrderDiscount() {
- return orderDiscount;
- }
- /**
- * @return Returns the netAmount.
- */
- public double getNetAmount() {
- return netAmount;
- }
- /**
- * @param netAmount The netAmount to set.
- */
- public void setNetAmount(double netAmount) {
- this.netAmount = netAmount;
- }
- /**
- * @return Returns the orderDate.
- */
- public Calendar getOrderDate() {
- return orderDate;
- }
- /**
- * @param orderDate The orderDate to set.
- */
- public void setOrderDate(Calendar orderDate) {
- this.orderDate = orderDate;
- }
- /**
- * @return Returns the orderId.
- */
- public String getOrderId() {
- return orderId;
- }
- /**
- * @param orderId The orderId to set.
- */
- public void setOrderId(String orderId) {
- this.orderId = orderId;
- }
- /**
- * @return Returns the statusCode.
- */
- public String getStatusCode() {
- return statusCode;
- }
- /**
- * @param statusCode The statusCode to set.
- */
- public void setStatusCode(String statusCode) {
- this.statusCode = statusCode;
- }
- /**
- * @return Returns the tax.
- */
- public double getTax() {
- return tax;
- }
- /**
- * @param tax The tax to set.
- */
- public void setTax(double tax) {
- this.tax = tax;
- }
- /**
- * @return Returns the totalAmount.
- */
- public double getTotalAmount() {
- return totalAmount;
- }
- /**
- * @param totalAmount The totalAmount to set.
- */
- public void setTotalAmount(double totalAmount) {
- this.totalAmount = totalAmount;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return orderId + ", " + (orderDate == null?null:orderDate.getTime()) + ", " + statusCode + ", " + netAmount + ", " + totalAmount + ", " + tax + ", ";
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderHeader.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderHeader.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderHeader.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderHeader.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,139 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.store;
+
+import java.util.Calendar;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class OrderHeader implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ // <Order orderId="1" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0" netAmount="59.97" totalAmount="64.92" tax="4.95">
+ private String orderId;
+ private Calendar orderDate;
+ private String statusCode;
+ private double netAmount;
+ private double totalAmount;
+ private double tax;
+ private double orderDiscount;
+ private int orderPriority;
+
+ public void setOrderPriority(int orderPriority) {
+ this.orderPriority = orderPriority;
+ }
+ public int getOrderPriority() {
+ return this.orderPriority;
+ }
+
+ public void setOrderDiscount(double orderDiscount) {
+ this.orderDiscount = orderDiscount;
+ }
+ public double getOrderDiscount() {
+ return orderDiscount;
+ }
+ /**
+ * @return Returns the netAmount.
+ */
+ public double getNetAmount() {
+ return netAmount;
+ }
+ /**
+ * @param netAmount The netAmount to set.
+ */
+ public void setNetAmount(double netAmount) {
+ this.netAmount = netAmount;
+ }
+ /**
+ * @return Returns the orderDate.
+ */
+ public Calendar getOrderDate() {
+ return orderDate;
+ }
+ /**
+ * @param orderDate The orderDate to set.
+ */
+ public void setOrderDate(Calendar orderDate) {
+ this.orderDate = orderDate;
+ }
+ /**
+ * @return Returns the orderId.
+ */
+ public String getOrderId() {
+ return orderId;
+ }
+ /**
+ * @param orderId The orderId to set.
+ */
+ public void setOrderId(String orderId) {
+ this.orderId = orderId;
+ }
+ /**
+ * @return Returns the statusCode.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+ /**
+ * @param statusCode The statusCode to set.
+ */
+ public void setStatusCode(String statusCode) {
+ this.statusCode = statusCode;
+ }
+ /**
+ * @return Returns the tax.
+ */
+ public double getTax() {
+ return tax;
+ }
+ /**
+ * @param tax The tax to set.
+ */
+ public void setTax(double tax) {
+ this.tax = tax;
+ }
+ /**
+ * @return Returns the totalAmount.
+ */
+ public double getTotalAmount() {
+ return totalAmount;
+ }
+ /**
+ * @param totalAmount The totalAmount to set.
+ */
+ public void setTotalAmount(double totalAmount) {
+ this.totalAmount = totalAmount;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return orderId + ", " + (orderDate == null?null:orderDate.getTime()) + ", " + statusCode + ", " + netAmount + ", " + totalAmount + ", " + tax + ", ";
+ }
+}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderItem.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderItem.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderItem.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,114 +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,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.store;
-
-import java.io.Serializable;
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class OrderItem implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- // <OrderLine position="1" quantity="1">
- // <Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
- // </OrderLine>
- private int position;
- private int quantity;
- private String productId;
- private String title;
- private double price;
-
- /**
- * @return Returns the position.
- */
- public int getPosition() {
- return position;
- }
- /**
- * @param position The position to set.
- */
- public void setPosition(int position) {
- //System.out.println("**** position: " + position);
- this.position = position;
- }
- /**
- * @return Returns the price.
- */
- public double getPrice() {
- return price;
- }
- /**
- * @param price The price to set.
- */
- public void setPrice(double price) {
- //System.out.println("**** price: " + price);
- this.price = price;
- }
- /**
- * @return Returns the productId.
- */
- public String getProductId() {
- return productId;
- }
- /**
- * @param productId The productId to set.
- */
- public void setProductId(String productId) {
- this.productId = productId;
- }
- /**
- * @return Returns the quantity.
- */
- public int getQuantity() {
- return quantity;
- }
- /**
- * @param quantity The quantity to set.
- */
- public void setQuantity(int quantity) {
- this.quantity = quantity;
- }
- /**
- * @return Returns the title.
- */
- public String getTitle() {
- return title;
- }
- /**
- * @param title The title to set.
- */
- public void setTitle(String title) {
- this.title = title;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return position + "," + quantity + "," + productId + "," + title + "," + price;
-
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderItem.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderItem.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderItem.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/OrderItem.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,114 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.store;
+
+import java.io.Serializable;
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class OrderItem implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ // <OrderLine position="1" quantity="1">
+ // <Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+ // </OrderLine>
+ private int position;
+ private int quantity;
+ private String productId;
+ private String title;
+ private double price;
+
+ /**
+ * @return Returns the position.
+ */
+ public int getPosition() {
+ return position;
+ }
+ /**
+ * @param position The position to set.
+ */
+ public void setPosition(int position) {
+ //System.out.println("**** position: " + position);
+ this.position = position;
+ }
+ /**
+ * @return Returns the price.
+ */
+ public double getPrice() {
+ return price;
+ }
+ /**
+ * @param price The price to set.
+ */
+ public void setPrice(double price) {
+ //System.out.println("**** price: " + price);
+ this.price = price;
+ }
+ /**
+ * @return Returns the productId.
+ */
+ public String getProductId() {
+ return productId;
+ }
+ /**
+ * @param productId The productId to set.
+ */
+ public void setProductId(String productId) {
+ this.productId = productId;
+ }
+ /**
+ * @return Returns the quantity.
+ */
+ public int getQuantity() {
+ return quantity;
+ }
+ /**
+ * @param quantity The quantity to set.
+ */
+ public void setQuantity(int quantity) {
+ this.quantity = quantity;
+ }
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title The title to set.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return position + "," + quantity + "," + productId + "," + title + "," + price;
+
+ }
+}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/StoreAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/StoreAction.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/StoreAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,71 +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,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.store;
-
-import java.util.List;
-
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Store action.
- * <p/>
- * This action uses bean value objects that were prepopulated by Smooks in an earlier action on the pipline.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class StoreAction extends AbstractActionPipelineProcessor {
-
- public StoreAction(ConfigTree configTree) { }
-
- public Message process(Message message) throws ActionProcessingException {
-
- StringBuffer results = new StringBuffer();
- // "order", "customer", "orderItem" is set in the smooks config file: from-dvdstore.xml
- OrderHeader header = (OrderHeader) message.getBody().get("orderHeader");
- Customer customer = (Customer) message.getBody().get("customer");
- List orderItems = (List) message.getBody().get("orderItemList");
- // System.out.println("************************\n\n");
- // System.out.println(header.toString());
- // System.out.println(customer.toString());
- // System.out.println(orderItems.toString());
- // System.out.println("************************\n\n");
- results.append("Demonstrates Smooks ability to rip the XML into Objects\n");
- results.append("********** StoreAction - Order Value Objects Populated ***********\n");
- results.append("Header: " + header + "\n");
- results.append("Customer: " + customer + "\n");
- if(orderItems != null) {
- results.append("Order Items (" + orderItems.size() + "):\n");
- for(int i = 0; i < orderItems.size(); i++) {
- results.append("\t" + i + ": " + orderItems.get(i) + "\n");
- }
- }
- results.append("\n****************************************************************** ");
- message.getBody().add("OrderHeader",header);
- message.getBody().add("Customer",customer);
- message.getBody().add("OrderItems",orderItems);
- // Take this "parsed" and reformatted output
- message.getBody().add(results.toString());
- return message;
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/StoreAction.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/StoreAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/StoreAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/src/org/jboss/soa/esb/store/StoreAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,71 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.store;
+
+import java.util.List;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Store action.
+ * <p/>
+ * This action uses bean value objects that were prepopulated by Smooks in an earlier action on the pipline.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class StoreAction extends AbstractActionPipelineProcessor {
+
+ public StoreAction(ConfigTree configTree) { }
+
+ public Message process(Message message) throws ActionProcessingException {
+
+ StringBuffer results = new StringBuffer();
+ // "order", "customer", "orderItem" is set in the smooks config file: from-dvdstore.xml
+ OrderHeader header = (OrderHeader) message.getBody().get("orderHeader");
+ Customer customer = (Customer) message.getBody().get("customer");
+ List orderItems = (List) message.getBody().get("orderItemList");
+ // System.out.println("************************\n\n");
+ // System.out.println(header.toString());
+ // System.out.println(customer.toString());
+ // System.out.println(orderItems.toString());
+ // System.out.println("************************\n\n");
+ results.append("Demonstrates Smooks ability to rip the XML into Objects\n");
+ results.append("********** StoreAction - Order Value Objects Populated ***********\n");
+ results.append("Header: " + header + "\n");
+ results.append("Customer: " + customer + "\n");
+ if(orderItems != null) {
+ results.append("Order Items (" + orderItems.size() + "):\n");
+ for(int i = 0; i < orderItems.size(); i++) {
+ results.append("\t" + i + ": " + orderItems.get(i) + "\n");
+ }
+ }
+ results.append("\n****************************************************************** ");
+ message.getBody().add("OrderHeader",header);
+ message.getBody().add("Customer",customer);
+ message.getBody().add("OrderItems",orderItems);
+ // Take this "parsed" and reformatted output
+ message.getBody().add(results.toString());
+ return message;
+ }
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/transforms)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-dvdstore.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/transforms/from-dvdstore.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-dvdstore.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,54 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd"
- default-target-profile="from:dvdstore">
-
- <!-- Populate the OrderHeader -->
- <resource-config selector="order">
- <resource>org.milyn.javabean.BeanPopulator</resource>
- <param name="beanId">orderHeader</param>
- <param name="beanClass">org.jboss.soa.esb.store.OrderHeader</param>
- <param name="bindings">
- <binding property="orderId" selector="Order @orderId" />
- <binding property="orderDate" selector="Order @orderDate" type="LongDate"/>
- <binding property="statusCode" selector="Order @statusCode" />
- <binding property="netAmount" selector="Order @netAmount" type="Double" />
- <binding property="totalAmount" selector="Order @totalAmount" type="Double" />
- <binding property="tax" selector="Order @tax" type="Double" />
- </param>
- </resource-config>
-
- <!-- Populate the Customer -->
- <resource-config selector="order customer">
- <resource>org.milyn.javabean.BeanPopulator</resource>
- <param name="beanId">customer</param>
- <param name="beanClass">org.jboss.soa.esb.store.Customer</param>
- <param name="bindings">
- <binding property="userName" selector="order customer @userName" />
- <binding property="firstName" selector="order customer @firstName" />
- <binding property="lastName" selector="order customer @lastName" />
- <binding property="state" selector="order customer @state" />
- </param>
- </resource-config>
-
- <!-- Populate the OrderItem list -->
- <resource-config selector="order orderlines orderline">
- <resource>org.milyn.javabean.BeanPopulator</resource>
- <param name="beanId">orderItem</param>
- <param name="beanClass">org.jboss.soa.esb.store.OrderItem</param>
- <param name="addToList">true</param>
- <param name="bindings">
- <binding property="position" selector="order orderlines orderline @position" type="Integer" />
- <binding property="quantity" selector="order orderlines orderline @quantity" type="Integer" />
- <binding property="productId" selector="order orderlines orderline product @productId" />
- <binding property="title" selector="order orderlines orderline product @title" />
- <binding property="price" selector="order orderlines orderline product @price" type="Double" />
- </param>
- </resource-config>
-
-
- <resource-config selector="decoder:LongDate">
- <resource>org.milyn.javabean.decoders.CalendarDecoder</resource>
- <param name="format">EEE MMM dd HH:mm:ss z yyyy</param>
- </resource-config>
-
-</smooks-resource-list>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-dvdstore.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/transforms/from-dvdstore.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-dvdstore.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-dvdstore.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,54 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd"
+ default-target-profile="from:dvdstore">
+
+ <!-- Populate the OrderHeader -->
+ <resource-config selector="order">
+ <resource>org.milyn.javabean.BeanPopulator</resource>
+ <param name="beanId">orderHeader</param>
+ <param name="beanClass">org.jboss.soa.esb.store.OrderHeader</param>
+ <param name="bindings">
+ <binding property="orderId" selector="Order @orderId" />
+ <binding property="orderDate" selector="Order @orderDate" type="LongDate"/>
+ <binding property="statusCode" selector="Order @statusCode" />
+ <binding property="netAmount" selector="Order @netAmount" type="Double" />
+ <binding property="totalAmount" selector="Order @totalAmount" type="Double" />
+ <binding property="tax" selector="Order @tax" type="Double" />
+ </param>
+ </resource-config>
+
+ <!-- Populate the Customer -->
+ <resource-config selector="order customer">
+ <resource>org.milyn.javabean.BeanPopulator</resource>
+ <param name="beanId">customer</param>
+ <param name="beanClass">org.jboss.soa.esb.store.Customer</param>
+ <param name="bindings">
+ <binding property="userName" selector="order customer @userName" />
+ <binding property="firstName" selector="order customer @firstName" />
+ <binding property="lastName" selector="order customer @lastName" />
+ <binding property="state" selector="order customer @state" />
+ </param>
+ </resource-config>
+
+ <!-- Populate the OrderItem list -->
+ <resource-config selector="order orderlines orderline">
+ <resource>org.milyn.javabean.BeanPopulator</resource>
+ <param name="beanId">orderItem</param>
+ <param name="beanClass">org.jboss.soa.esb.store.OrderItem</param>
+ <param name="addToList">true</param>
+ <param name="bindings">
+ <binding property="position" selector="order orderlines orderline @position" type="Integer" />
+ <binding property="quantity" selector="order orderlines orderline @quantity" type="Integer" />
+ <binding property="productId" selector="order orderlines orderline product @productId" />
+ <binding property="title" selector="order orderlines orderline product @title" />
+ <binding property="price" selector="order orderlines orderline product @price" type="Double" />
+ </param>
+ </resource-config>
+
+
+ <resource-config selector="decoder:LongDate">
+ <resource>org.milyn.javabean.decoders.CalendarDecoder</resource>
+ <param name="format">EEE MMM dd HH:mm:ss z yyyy</param>
+ </resource-config>
+
+</smooks-resource-list>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-petstore.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/transforms/from-petstore.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-petstore.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,52 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd"
- default-target-profile="from:petstore">
-
- <!-- Populate the OrderHeader -->
- <resource-config selector="order">
- <resource>org.milyn.javabean.BeanPopulator</resource>
- <param name="beanId">orderHeader</param>
- <param name="beanClass">org.jboss.soa.esb.store.OrderHeader</param>
- <param name="bindings">
- <binding property="orderId" selector="Order @orderId" />
- <binding property="orderDate" selector="Order @orderDate" type="LongDate"/>
- <binding property="statusCode" selector="Order @status" />
- <binding property="totalAmount" selector="Order @totalPrice" type="Double" />
- </param>
- </resource-config>
-
- <!-- Populate the Customer -->
- <resource-config selector="order">
- <resource>org.milyn.javabean.BeanPopulator</resource>
- <param name="beanId">customer</param>
- <param name="beanClass">org.jboss.soa.esb.store.Customer</param>
- <param name="bindings">
- <binding property="userName" selector="order @username" />
- <binding property="firstName" selector="order @shipToFirstName" />
- <binding property="lastName" selector="order @shipToLastName" />
- <binding property="state" selector="order @shipState" />
- </param>
- </resource-config>
-
- <!-- Populate the OrderItem list -->
- <resource-config selector="order LineItems LineItem">
- <resource>org.milyn.javabean.BeanPopulator</resource>
- <param name="beanId">orderItem</param>
- <param name="beanClass">org.jboss.soa.esb.store.OrderItem</param>
- <param name="addToList">true</param>
- <param name="bindings">
- <binding property="position" selector="LineItem @lineNumber" type="Integer" />
- <binding property="quantity" selector="LineItem @quantity" type="Integer" />
- <binding property="productId" selector="LineItem Item @itemId" />
- <binding property="price" selector="LineItem Item @listPrice" type="Double" />
- <binding property="title" selector="LineItem Item @name" />
- </param>
- </resource-config>
-
-
- <resource-config selector="decoder:LongDate">
- <resource>org.milyn.javabean.decoders.CalendarDecoder</resource>
- <param name="format">EEE MMM dd HH:mm:ss z yyyy</param>
- </resource-config>
-
-</smooks-resource-list>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-petstore.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/bpm_orchestration4/transforms/from-petstore.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-petstore.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration4/transforms/from-petstore.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,52 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd"
+ default-target-profile="from:petstore">
+
+ <!-- Populate the OrderHeader -->
+ <resource-config selector="order">
+ <resource>org.milyn.javabean.BeanPopulator</resource>
+ <param name="beanId">orderHeader</param>
+ <param name="beanClass">org.jboss.soa.esb.store.OrderHeader</param>
+ <param name="bindings">
+ <binding property="orderId" selector="Order @orderId" />
+ <binding property="orderDate" selector="Order @orderDate" type="LongDate"/>
+ <binding property="statusCode" selector="Order @status" />
+ <binding property="totalAmount" selector="Order @totalPrice" type="Double" />
+ </param>
+ </resource-config>
+
+ <!-- Populate the Customer -->
+ <resource-config selector="order">
+ <resource>org.milyn.javabean.BeanPopulator</resource>
+ <param name="beanId">customer</param>
+ <param name="beanClass">org.jboss.soa.esb.store.Customer</param>
+ <param name="bindings">
+ <binding property="userName" selector="order @username" />
+ <binding property="firstName" selector="order @shipToFirstName" />
+ <binding property="lastName" selector="order @shipToLastName" />
+ <binding property="state" selector="order @shipState" />
+ </param>
+ </resource-config>
+
+ <!-- Populate the OrderItem list -->
+ <resource-config selector="order LineItems LineItem">
+ <resource>org.milyn.javabean.BeanPopulator</resource>
+ <param name="beanId">orderItem</param>
+ <param name="beanClass">org.jboss.soa.esb.store.OrderItem</param>
+ <param name="addToList">true</param>
+ <param name="bindings">
+ <binding property="position" selector="LineItem @lineNumber" type="Integer" />
+ <binding property="quantity" selector="LineItem @quantity" type="Integer" />
+ <binding property="productId" selector="LineItem Item @itemId" />
+ <binding property="price" selector="LineItem Item @listPrice" type="Double" />
+ <binding property="title" selector="LineItem Item @name" />
+ </param>
+ </resource-config>
+
+
+ <resource-config selector="decoder:LongDate">
+ <resource>org.milyn.javabean.decoders.CalendarDecoder</resource>
+ <param name="format">EEE MMM dd HH:mm:ss z yyyy</param>
+ </resource-config>
+
+</smooks-resource-list>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -113,6 +113,7 @@
<object-path esb="body.customer" />
</property>
</action>
+
</actions>
</service>
<service category="ConciergeManager"
@@ -127,6 +128,7 @@
class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
<property name="stuff" value="Concierge"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -142,6 +144,7 @@
class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
<property name="stuff" value="Distribution"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BasicShipping"
@@ -156,6 +159,7 @@
class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
<property name="stuff" value="Shipping"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -20,6 +20,7 @@
*/
package org.jboss.soa.esb.samples.quickstart.businessrules.test;
+import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.jms.JMSException;
@@ -33,7 +34,10 @@
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.util.Properties;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
@@ -42,7 +46,14 @@
public void setupConnection() throws JMSException, NamingException
{
- InitialContext iniCtx = new InitialContext();
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
@@ -63,6 +74,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "BusinessRulesServiceTest.log");
send.send(tm);
send.close();
}
@@ -107,4 +119,4 @@
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -150,10 +150,12 @@
<!-- soap config -->
<fileset dir="${org.jboss.esb.server.server}/deploy/soap.esb" includes="*.jar"/>
<pathelement location="${org.jboss.esb.server.server}/deploy/soap.esb"/>
+ <fileset dir="${org.jboss.esb.server.server}/lib" includes="activation.jar, mail.jar, jboss-ejb3x.jar"/>
<!-- general libs -->
<pathelement location="${org.jboss.esb.server.home}/lib/commons-logging.jar"/>
<pathelement location="${org.jboss.esb.server.home}/lib/commons-codec.jar"/>
<pathelement location="${org.jboss.esb.server.home}/lib/jboss-system.jar"/>
+ <pathelement location="${org.jboss.esb.server.home}/lib/jboss-xml-binding.jar"/>
</path>
</target>
@@ -173,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" />
@@ -235,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" />
@@ -245,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="." />
@@ -258,6 +275,7 @@
<path refid="compile-classpath" />
<pathelement location="${pwd}/anttasks/classes" />
</path>
+ <property name="exec-classpath" refid="exec-classpath"/>
</target>
<!-- ==================================================================== -->
@@ -275,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">
@@ -445,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"/>
@@ -479,19 +497,21 @@
<fail unless="quickstart.ftp.config" message="Please configure ftp properties in quickstart.properties"/>
</target>
- <target name="assert-jbossremoting-2.2.2.SP1-plus">
+ <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>
<echo message="JBR Version String: '${jbr-version-string}'."/>
<condition property="is-valid-jbr-version">
- <or>
- <contains string="${jbr-version-string}" substring="2.2.2.SP1" />
- <contains string="${jbr-version-string}" substring="2.2.2.SP2" />
- </or>
+ <and>
+ <contains string="${jbr-version-string}" substring="2.2.2.SP" />
+ <not>
+ <contains string="${jbr-version-string}" substring="2.2.2.SP1 " />
+ </not>
+ </and>
</condition>
- <fail unless="is-valid-jbr-version" message="Invalid version of JBossRemoting installed on target server. Please install version 2.2.2.SP2: http://repository.jboss.org/jboss/remoting/2.2.2.SP2/lib/jboss-remoting.jar" />
+ <fail unless="is-valid-jbr-version" message="Invalid version of JBossRemoting installed on target server. Please install version 2.2.2.SP2 or higher: http://repository.jboss.org/jboss/remoting/" />
</target>
<!-- ==================================================================== -->
@@ -506,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/trunk/product/samples/quickstarts/custom_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/custom_action/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/custom_action/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -69,6 +69,7 @@
<property name="information" value="Hola Mundo" />
<property name="repeatCount" value="5"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -51,8 +51,13 @@
<!-- Send message to My Action -->
<action name="MyFailingAction" class="org.jboss.soa.esb.samples.quickstart.deadletter.MyFailingAsyncAction"/>
<action name="MyFailingSyncAction" class="org.jboss.soa.esb.samples.quickstart.deadletter.MyFailingSyncAction"/>
- </actions>
- </service>
+ <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="true"/>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+
+ </actions>
+ </service>
</services>
</jbossesb>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,6 +21,7 @@
package org.jboss.soa.esb.samples.quickstart.deadletter;
import java.net.URI;
+import java.util.Date;
import java.util.Map;
import org.apache.log4j.Logger;
@@ -31,6 +32,7 @@
import org.jboss.soa.esb.client.ServiceInvoker;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.services.persistence.MessageStore;
import org.jboss.soa.esb.services.persistence.MessageStoreException;
@@ -44,6 +46,9 @@
protected ConfigTree _config;
private Logger logger = Logger.getLogger(this.getClass());
+ private static final String ID = "ASYNC-ID" ;
+ private static final String DATE = "ASYNC-DATE" ;
+
public MyFailingAsyncAction(ConfigTree config) {
_config = config;
}
@@ -61,7 +66,10 @@
//the jbossesb.esb an by default it stores the message in the
//MessageStore under the DLQ categorization.
MessageStore ms = MessageStoreFactory.getInstance().getMessageStore();
-
+ Message rdlvrMessage = null;
+
+ message.getBody().add(ID, "ID:" + Integer.toHexString(System.identityHashCode(message))) ;
+ message.getBody().add(DATE, new Date()) ;
try {
//empty out the DLQ
Map<URI, Message> messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_RDLVR);
@@ -84,9 +92,9 @@
rdlvrMessageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_RDLVR);
}
for (URI key : rdlvrMessageMap.keySet()) {
- Message rdlvrMessage = rdlvrMessageMap.get(key);
+ rdlvrMessage = rdlvrMessageMap.get(key);
logger.info("*******************************");
- logger.info("Message in the RDLVR should be the same message: " + message.getBody().toString().equals(rdlvrMessage.getBody().toString()));
+ logger.info("Message in the RDLVR should be the same message: " + compare(message.getBody(), rdlvrMessage.getBody()));
logger.info("Message=" + message.getBody());
logger.info("rdlvrMessage=" + rdlvrMessage.getBody());
logger.info("*******************************");
@@ -98,8 +106,21 @@
} catch (MessageDeliverException mde) {
throw new ActionProcessingException(mde.getMessage(), mde);
}
- return message;
+ return rdlvrMessage;
}
+
+ private static boolean compare(final Body lhs, final Body rhs)
+ {
+ return compare(ID, lhs, rhs) && compare(DATE, lhs, rhs) ;
+ }
+
+ private static boolean compare(final String name, final Body lhs, final Body rhs)
+ {
+ final Object lhsObject = lhs.get(name) ;
+ final Object rhsObject = rhs.get(name) ;
+
+ return ((lhsObject != null) && lhsObject.equals(rhsObject)) ;
+ }
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,6 +21,7 @@
package org.jboss.soa.esb.samples.quickstart.deadletter;
import java.net.URI;
+import java.util.Date;
import java.util.Map;
import org.apache.log4j.Logger;
@@ -32,6 +33,7 @@
import org.jboss.soa.esb.couriers.FaultMessageException;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.services.persistence.MessageStore;
import org.jboss.soa.esb.services.persistence.MessageStoreException;
@@ -45,6 +47,9 @@
protected ConfigTree _config;
private Logger logger = Logger.getLogger(this.getClass());
+
+ private static final String ID = "SYNC-ID" ;
+ private static final String DATE = "SYNC-DATE" ;
public MyFailingSyncAction(ConfigTree config) {
_config = config;
@@ -63,7 +68,9 @@
//the jbossesb.esb an by default it stores the message in the
//MessageStore under the DLQ categorization.
MessageStore ms = MessageStoreFactory.getInstance().getMessageStore();
-
+ Message dlqMessage = null;
+ message.getBody().add(ID, "ID:" + Integer.toHexString(System.identityHashCode(message))) ;
+ message.getBody().add(DATE, new Date()) ;
try {
//empty out the DLQ
Map<URI, Message> messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);
@@ -90,9 +97,9 @@
messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);
}
for (URI key : messageMap.keySet()) {
- Message dlqMessage = messageMap.get(key);
+ dlqMessage = messageMap.get(key);
logger.info("*******************************");
- logger.info("Message in the DLQ queue should be the same message: " + message.getBody().toString().equals(dlqMessage.getBody().toString()));
+ logger.info("Message in the DLQ queue should be the same message: " + compare(message.getBody(), dlqMessage.getBody()));
logger.info("Message=" + message.getBody());
logger.info("dlqMessage=" + dlqMessage.getBody());
logger.info("*******************************");
@@ -105,8 +112,20 @@
} catch (FaultMessageException fme) {
throw new ActionProcessingException(fme.getMessage(), fme);
}
- return message;
+ return dlqMessage;
}
-
-}
\ No newline at end of file
+
+ private static boolean compare(final Body lhs, final Body rhs)
+ {
+ return compare(ID, lhs, rhs) && compare(DATE, lhs, rhs) ;
+ }
+
+ private static boolean compare(final String name, final Body lhs, final Body rhs)
+ {
+ final Object lhsObject = lhs.get(name) ;
+ final Object rhsObject = rhs.get(name) ;
+
+ return ((lhsObject != null) && lhsObject.equals(rhsObject)) ;
+ }
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,6 +21,7 @@
package org.jboss.soa.esb.samples.quickstart.deadletter.test;
import java.util.Date;
+import java.util.Properties;
import javax.jms.JMSException;
import javax.jms.ObjectMessage;
@@ -29,6 +30,7 @@
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
+import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
@@ -42,7 +44,14 @@
public void setupConnection() throws JMSException, NamingException
{
- InitialContext iniCtx = new InitialContext();
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+
+ InitialContext iniCtx = new InitialContext(properties1);
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
Modified: labs/jbossesb/trunk/product/samples/quickstarts/exceptions_faults/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/exceptions_faults/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/exceptions_faults/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -12,7 +12,7 @@
<echo>Runs Test JMS Sender</echo>
<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.exceptions.test.SendJMSMessage" failonerror="true">
<arg value="queue/quickstart_exceptions_faults_GW"/>
- <arg value="LostMessageService"/>
+ <arg value="ExceptionCaughtService"/>
<arg value="Via Gateway"/>
<classpath refid="exec-classpath"/>
</java>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/exceptions_faults/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/exceptions_faults/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/exceptions_faults/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -60,6 +60,9 @@
<action name="A Good Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
process="displayMessage" >
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logException" value="true"/>
+ </action>
<action name="Bad Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
process="causesMyException" >
</action>
@@ -95,13 +98,13 @@
process="displayMessage" >
<property name="exceptionMethod" value="catchesException" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logException" value="true"/>
+ </action>
<action name="Bad Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
- process="causesException" >
- </action>
+ process="causesException"/>
<action name="Never Reached" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
- process="displayMessage" >
- </action>
-
+ process="displayMessage"/>
</actions>
</service>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -71,6 +71,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="notificationAction"
class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
@@ -101,6 +102,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="notificationAction"
class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
@@ -131,6 +133,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<!-- Inject the transformer actions here -->
Modified: labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/src/org/jboss/soa/esb/samples/quickstart/funcbr/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/src/org/jboss/soa/esb/samples/quickstart/funcbr/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/src/org/jboss/soa/esb/samples/quickstart/funcbr/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -29,11 +29,16 @@
import javax.jms.QueueSession;
import javax.jms.QueueSender;
import javax.jms.ObjectMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.util.Properties;
+
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
@@ -42,7 +47,14 @@
public void setupConnection() throws JMSException, NamingException
{
- InitialContext iniCtx = new InitialContext();
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
@@ -60,12 +72,13 @@
}
public void sendAMessage(String msg) throws JMSException {
-
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty("jbesbfilename", "FunCBRTest.log");
send.send(tm);
send.close();
}
+
public String readAsciiFile(String fileName) throws IOException {
FileReader fr = null;
char[] thechars = null;
@@ -107,4 +120,4 @@
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/groovy_gateway/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/groovy_gateway/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/groovy_gateway/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -30,6 +30,8 @@
<actions mep="RequestResponse">
<action name="greeting1" class="org.jboss.soa.esb.samples.quickstart.groovygateway.GreeterAction"/>
<action name="greeting2" class="org.jboss.soa.esb.samples.quickstart.groovygateway.AnotherAction"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -47,7 +47,7 @@
<property name="printfull" value="true"/>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -51,8 +51,6 @@
<property name="exceptionMethod" value="exceptionHandler"/>
</action>
- <!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
<action name="notificationAction"
class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
@@ -65,7 +63,9 @@
</target>
</NotificationList>
</property>
- </action>
+ </action>
+ <!-- The next action is for Continuous Integration testing -->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/src/org/jboss/soa/esb/samples/quickstart/helloworldaction/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/src/org/jboss/soa/esb/samples/quickstart/helloworldaction/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/src/org/jboss/soa/esb/samples/quickstart/helloworldaction/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -30,6 +30,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
@@ -59,6 +61,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "HelloWorldActionTest.log");
send.send(tm);
send.close();
}
@@ -73,4 +76,4 @@
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -62,7 +62,7 @@
<property name="printfull" value="true"/>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore" />
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,4 +1,6 @@
<project name="Quickstart_helloworld_file_notifier" default="run" basedir=".">
+
+ <property environment="env" />
<description>
${ant.project.name}
@@ -10,10 +12,12 @@
<target name="config">
<property name="results.dir" location="."/>
+ <echoproperties/>
<copy file="jboss-esb-unfiltered.xml"
tofile="jboss-esb.xml" overwrite="true">
<filterset>
<filter token="results.dir" value="file:///${results.dir}"/>
+ <filter token="tmp.dir" value="${java.io.tmpdir}"/>
</filterset>
</copy>
</target>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/jboss-esb-unfiltered.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/jboss-esb-unfiltered.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -98,6 +98,7 @@
<target class="NotifyConsole"/>
<target class="NotifyFiles">
<file append="false" URI="@results.dir@/results.log"/>
+ <file append="false" URI="@tmp.dir@/HelloWorldFileNotifierTest.log"/>
</target>
</NotificationList>
<NotificationList type="err">
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldfilenotifier/MyJMSListenerAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldfilenotifier/MyJMSListenerAction.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldfilenotifier/MyJMSListenerAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -30,7 +30,6 @@
protected ConfigTree _config;
public MyJMSListenerAction(ConfigTree config) { _config = config; }
-
public Message displayMessage(Message message) throws Exception{
@@ -38,8 +37,5 @@
System.out.println("Body: " + message.getBody().get());
System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
return message;
-
}
-
-
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldfilenotifier/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldfilenotifier/test/SendEsbMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldfilenotifier/test/SendEsbMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -58,10 +58,9 @@
esbMessage.getHeader().setCall(call);
// set body contents with args[2], and send
- esbMessage.getBody().add(args[2].getBytes());
+ esbMessage.getBody().add(args[2]);
new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
-
}
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -13,8 +13,9 @@
status-column="STATUS_COL"
order-by="DATA_COLUMN"
where-condition="DATA_COLUMN like 'data%'"
-
+ message-column="message"
message-id-column="UNIQUE_ID"
+ insert-timestamp-column="TIMESTAMP_COL"
/>
</sql-bus>
</sql-provider>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/hsqldb/create.sql
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/hsqldb/create.sql 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/src/hsqldb/create.sql 2008-03-04 16:24:20 UTC (rev 18679)
@@ -2,5 +2,6 @@
(
unique_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
data_column VARCHAR(255) NOT NULL,
-status_col VARCHAR(255) NOT NULL
+status_col VARCHAR(255) NOT NULL,
+timestamp_col VARCHAR(255)
);
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/build.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,54 +0,0 @@
-<project name="Quickstart_helloworld_topic_notifier" default="run" basedir=".">
-
- <property environment="env" />
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
-
- <target name="config">
- <property name="results.dir" location="."/>
- <echoproperties/>
- <copy file="jboss-esb-unfiltered.xml"
- tofile="jboss-esb.xml" overwrite="true">
- <filterset>
- <filter token="results.dir" value="file:///${results.dir}"/>
- <filter token="tmp.dir" value="${java.io.tmpdir}"/>
- </filterset>
- </copy>
- </target>
-
- <target name="runtest" depends="compile"
- description="sends a JMS message to queue/quickstart_helloworld_topic_notifier_Request_gw">
- <echo>Runs Test JMS Sender</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier.test.SendJMSMessage" failonerror="true">
- <arg value="Hello World"/>
- <classpath refid="exec-classpath"/>
- </java>
- </target>
-
- <target name="receive" depends="compile"
- description="Receives ESB message from topic">
- <echo>Runs Test ESB Message Receiver</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier.ReceiveJMSMessage" failonerror="true">
- <arg value="/topic/helloworldtopic"/> <!-- topicName -->
- <arg value="non-durable"/> <!-- create a non-durable topic -->
- <classpath refid="exec-classpath"/>
- </java>
- </target>
-
- <target name="receive-durable" depends="compile"
- description="Receives ESB message from topic">
- <echo>Runs Test ESB Message Receiver</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier.ReceiveJMSMessage" failonerror="true">
- <arg value="/topic/helloworldtopic"/> <!-- topicName -->
- <arg value="durable"/> <!-- create a durable topic -->
- <classpath refid="exec-classpath"/>
- </java>
-
- </target>
-</project>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/build.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,54 @@
+<project name="Quickstart_helloworld_topic_notifier" default="run" basedir=".">
+
+ <property environment="env" />
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="config">
+ <property name="results.dir" location="."/>
+ <echoproperties/>
+ <copy file="jboss-esb-unfiltered.xml"
+ tofile="jboss-esb.xml" overwrite="true">
+ <filterset>
+ <filter token="results.dir" value="file:///${results.dir}"/>
+ <filter token="tmp.dir" value="${java.io.tmpdir}"/>
+ </filterset>
+ </copy>
+ </target>
+
+ <target name="runtest" depends="compile"
+ description="sends a JMS message to queue/quickstart_helloworld_topic_notifier_Request_gw">
+ <echo>Runs Test JMS Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier.test.SendJMSMessage" failonerror="true">
+ <arg value="Hello World"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="receive" depends="compile"
+ description="Receives ESB message from topic">
+ <echo>Runs Test ESB Message Receiver</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier.ReceiveJMSMessage" failonerror="true">
+ <arg value="/topic/helloworldtopic"/> <!-- topicName -->
+ <arg value="non-durable"/> <!-- create a non-durable topic -->
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="receive-durable" depends="compile"
+ description="Receives ESB message from topic">
+ <echo>Runs Test ESB Message Receiver</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier.ReceiveJMSMessage" failonerror="true">
+ <arg value="/topic/helloworldtopic"/> <!-- topicName -->
+ <arg value="durable"/> <!-- create a durable topic -->
+ <classpath refid="exec-classpath"/>
+ </java>
+
+ </target>
+</project>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,4 +0,0 @@
-<jbossesb-deployment>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_gw</depends>
- <depends>jboss.esb.quickstart.destination:service=Topic,name=helloworldtopic</depends>
-</jbossesb-deployment>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,4 @@
+<jbossesb-deployment>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_gw</depends>
+ <depends>jboss.esb.quickstart.destination:service=Topic,name=helloworldtopic</depends>
+</jbossesb-deployment>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.TopicService"
- name="jboss.esb.quickstart.destination:service=Topic,name=helloworldtopic"
- xmbean-dd="xmdesc/Topic-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <attribute name="SecurityConfig">
- <security>
- <role name="guest" read="true" write="true" create="true"/>
- </security>
- </attribute>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_gw"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.TopicService"
+ name="jboss.esb.quickstart.destination:service=Topic,name=helloworldtopic"
+ xmbean-dd="xmdesc/Topic-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <attribute name="SecurityConfig">
+ <security>
+ <role name="guest" read="true" write="true" create="true"/>
+ </security>
+ </attribute>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_gw">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Topic"
- name="jboss.esb.quickstart.destination:service=Topic,name=helloworldtopic">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_topic_notifier_Request_gw">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Topic"
+ name="jboss.esb.quickstart.destination:service=Topic,name=helloworldtopic">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,59 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
- <providers>
- <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
- jndi-URL="jnp://127.0.0.1:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
- jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
-
- <jms-bus busid="quickstartNotifierChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_helloworld_topic_notifier_Request_gw"
- />
- </jms-bus>
- <jms-bus busid="quickstartEsbChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_helloworld_topic_notifier_Request_esb"
- />
- </jms-bus>
- </jms-provider>
- </providers>
-
- <services>
- <service
- category="routerToFile"
- name="FileRouterListener"
- description="Static route file destination">
- <listeners>
- <jms-listener name="helloWorldNotifier"
- busidref="quickstartNotifierChannel"
- maxThreads="1"
- is-gateway="true"
- />
- <jms-listener name="helloWorld"
- busidref="quickstartEsbChannel"
- maxThreads="1"
- />
- </listeners>
- <actions>
- <action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
- <property name="okMethod" value="notifyOK" />
- <property name="notification-details">
- <NotificationList type="ok">
- <target class="NotifyConsole"/>
- <target class="NotifyFiles">
- <file append="false" URI="@results.dir@/results.log"/>
- <file append="false" URI="@tmp.dir@/HelloWorldFileNotifierTest.log"/>
- </target>
- <target class="NotifyTopics">
- <topic jndiName="topic/helloworldtopic"/>
- </target>
- </NotificationList>
- </property>
- </action>
- </actions>
- </service>
- </services>
-</jbossesb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,59 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+ jndi-URL="jnp://127.0.0.1:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+
+ <jms-bus busid="quickstartNotifierChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_helloworld_topic_notifier_Request_gw"
+ />
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_helloworld_topic_notifier_Request_esb"
+ />
+ </jms-bus>
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service
+ category="routerToFile"
+ name="FileRouterListener"
+ description="Static route file destination">
+ <listeners>
+ <jms-listener name="helloWorldNotifier"
+ busidref="quickstartNotifierChannel"
+ maxThreads="1"
+ is-gateway="true"
+ />
+ <jms-listener name="helloWorld"
+ busidref="quickstartEsbChannel"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions>
+ <action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
+ <property name="okMethod" value="notifyOK" />
+ <property name="notification-details">
+ <NotificationList type="ok">
+ <target class="NotifyConsole"/>
+ <target class="NotifyFiles">
+ <file append="false" URI="@results.dir@/results.log"/>
+ <file append="false" URI="@tmp.dir@/HelloWorldFileNotifierTest.log"/>
+ </target>
+ <target class="NotifyTopics">
+ <topic jndiName="topic/helloworldtopic"/>
+ </target>
+ </NotificationList>
+ </property>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,59 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
- <providers>
- <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
- jndi-URL="jnp://127.0.0.1:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
- jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
-
- <jms-bus busid="quickstartNotifierChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_helloworld_topic_notifier_Request_gw"
- />
- </jms-bus>
- <jms-bus busid="quickstartEsbChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_helloworld_topic_notifier_Request_esb"
- />
- </jms-bus>
- </jms-provider>
- </providers>
-
- <services>
- <service
- category="routerToFile"
- name="FileRouterListener"
- description="Static route file destination">
- <listeners>
- <jms-listener name="helloWorldNotifier"
- busidref="quickstartNotifierChannel"
- maxThreads="1"
- is-gateway="true"
- />
- <jms-listener name="helloWorld"
- busidref="quickstartEsbChannel"
- maxThreads="1"
- />
- </listeners>
- <actions>
- <action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
- <property name="okMethod" value="notifyOK" />
- <property name="notification-details">
- <NotificationList type="ok">
- <target class="NotifyConsole"/>
- <target class="NotifyFiles">
- <file append="false" URI="file:////Users/tcunning/src/esb/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_topic_notifier/results.log"/>
- <file append="false" URI="/tmp/HelloWorldFileNotifierTest.log"/>
- </target>
- <target class="NotifyTopics">
- <topic jndiName="topic/helloworldtopic"/>
- </target>
- </NotificationList>
- </property>
- </action>
- </actions>
- </service>
- </services>
-</jbossesb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,59 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+ jndi-URL="jnp://127.0.0.1:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+
+ <jms-bus busid="quickstartNotifierChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_helloworld_topic_notifier_Request_gw"
+ />
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_helloworld_topic_notifier_Request_esb"
+ />
+ </jms-bus>
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service
+ category="routerToFile"
+ name="FileRouterListener"
+ description="Static route file destination">
+ <listeners>
+ <jms-listener name="helloWorldNotifier"
+ busidref="quickstartNotifierChannel"
+ maxThreads="1"
+ is-gateway="true"
+ />
+ <jms-listener name="helloWorld"
+ busidref="quickstartEsbChannel"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions>
+ <action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
+ <property name="okMethod" value="notifyOK" />
+ <property name="notification-details">
+ <NotificationList type="ok">
+ <target class="NotifyConsole"/>
+ <target class="NotifyFiles">
+ <file append="false" URI="file:////Users/tcunning/src/esb/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_topic_notifier/results.log"/>
+ <file append="false" URI="/tmp/HelloWorldFileNotifierTest.log"/>
+ </target>
+ <target class="NotifyTopics">
+ <topic jndiName="topic/helloworldtopic"/>
+ </target>
+ </NotificationList>
+ </property>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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,
- @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
- These options are described in the JBossESB manual.
- Defaults are provided here for convenience only.
-
- Please read through this file prior to using the system, and consider
- updating the specified entries.
--->
-<esb
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
- <properties name="core">
- <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
- <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
- </properties>
- <properties name="registry">
- <property name="org.jboss.soa.esb.registry.queryManagerURI"
- value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
- value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
- <property name="org.jboss.soa.esb.registry.implementationClass"
- value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
- <property name="org.jboss.soa.esb.registry.factoryClass"
- value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
- <property name="org.jboss.soa.esb.registry.user"
- value="jbossesb"/>
- <property name="org.jboss.soa.esb.registry.password"
- value="password"/>
- <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
- <property name="org.jboss.soa.esb.scout.proxy.transportClass"
- value="org.apache.ws.scout.transport.RMITransport"/>
- </properties>
- <properties name="transports" depends="core">
- <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
- <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
- <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
- </properties>
- <properties name="connection">
- <property name="min-pool-size" value="5"/>
- <property name="max-pool=size" value="10"/>
- <property name="blocking-timeout-millis" value="5000"/>
- <property name="abandoned-connection-timeout" value="10000"/>
- <property name="abandoned-connection-time-interval" value="30000"/>
- </properties>
- <properties name="dbstore">
- <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
- <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
- <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
- <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
- <!--table managed by pool to test for valid connections - created by pool automatically -->
- <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
- <!-- # of milliseconds to timeout waiting for a connection from pool -->
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
- </properties>
- <properties name="messagerouting">
- <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
- </properties>
-</esb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
-
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/lib (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/lib)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
- <param name="Threshold" value="INFO"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <!-- A size based file rolling appender -->
- <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="File" value="./listener.log"/>
- <param name="Append" value="false"/>
- <param name="MaxFileSize" value="500KB"/>
- <param name="MaxBackupIndex" value="1"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jboss">
- <priority value="WARN"/>
- </category>
- <category name="org.jboss.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.jboss.internal.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.apache">
- <priority value="ERROR"/>
- </category>
- <category name="quickstart">
- <priority value="DEBUG"/>
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="DEBUG"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/readme.txt
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/readme.txt 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,38 +0,0 @@
-Overview:
-=========
- The purpose of the helloworld topic notifier quickstart sample is to
- show how to use the Notifier to pass messages to a topic. This QuickStart
- sends a message to a queue and the Notifier will pass it to the topic using
- NotifyTopics. A small utility is included that listens to the topic.
-
- If you wish to view the messages sent to the jmx-console, attach a durable
- subscriber by using the "ant receive-durable" target, and then find the
- subscription id by invoking the "listAllSubscriptionAsHTML()" method.
-
-Running this quickstart:
-========================
- Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
- and a more detailed description of the different ways to run the quickstarts.
-
-To Run standalone mode:
-=======================
- 1. In a command terminal window in the quickstart folder type
- 'ant deploy-jms-dests'.
- 2. In a command terminal window in this folder ("Window1"), type 'ant run'.
- 3. Open another command terminal window in this folder ("Window2"), type
- 'ant receive'.
- 4. Open another command terminal window in this folder ("Window2"), type
- 'ant runtest'.
- 5. Switch back to "Window2" to see the output from the ESB
- 6. When finished, interrupt the ESB using Ctrl-C and, in this folder
- ("Window1"), type 'ant undeploy-jms-dests'.
-
-To Run '.esb' archive mode:
-===========================
- 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
- 2. Open another command terminal window in this folder ("Window2"), type
- 'ant receive'.
- 3. Open another command terminal window in this folder ("Window3"), type
- 'ant runtest'.
- 4. Switch back to Application Server console to see the output from the ESB
- 5. In this folder ("Window1"), type 'ant undeploy'.
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/readme.txt (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/readme.txt)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,38 @@
+Overview:
+=========
+ The purpose of the helloworld topic notifier quickstart sample is to
+ show how to use the Notifier to pass messages to a topic. This QuickStart
+ sends a message to a queue and the Notifier will pass it to the topic using
+ NotifyTopics. A small utility is included that listens to the topic.
+
+ If you wish to view the messages sent to the jmx-console, attach a durable
+ subscriber by using the "ant receive-durable" target, and then find the
+ subscription id by invoking the "listAllSubscriptionAsHTML()" method.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed description of the different ways to run the quickstarts.
+
+To Run standalone mode:
+=======================
+ 1. In a command terminal window in the quickstart folder type
+ 'ant deploy-jms-dests'.
+ 2. In a command terminal window in this folder ("Window1"), type 'ant run'.
+ 3. Open another command terminal window in this folder ("Window2"), type
+ 'ant receive'.
+ 4. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 5. Switch back to "Window2" to see the output from the ESB
+ 6. When finished, interrupt the ESB using Ctrl-C and, in this folder
+ ("Window1"), type 'ant undeploy-jms-dests'.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window2"), type
+ 'ant receive'.
+ 3. Open another command terminal window in this folder ("Window3"), type
+ 'ant runtest'.
+ 4. Switch back to Application Server console to see the output from the ESB
+ 5. In this folder ("Window1"), type 'ant undeploy'.
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,41 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MyJMSListenerAction extends AbstractActionLifecycle
-{
-
- protected ConfigTree _config;
-
- public MyJMSListenerAction(ConfigTree config) { _config = config; }
-
- public Message displayMessage(Message message) throws Exception{
-
- System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
- System.out.println("Body: " + message.getBody().get());
- System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
- return message;
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,41 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyJMSListenerAction extends AbstractActionLifecycle
+{
+
+ protected ConfigTree _config;
+
+ public MyJMSListenerAction(ConfigTree config) { _config = config; }
+
+ public Message displayMessage(Message message) throws Exception{
+
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ System.out.println("Body: " + message.getBody().get());
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ return message;
+ }
+}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,118 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier;
-
-import java.util.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- * JMS Message Receiver.
- * <p/>
- *
- * A small utility that subscribes to a topic and creates a listener that prints message content.
- *
- * @author <a href="mailto:daniel.bevenius at redpill.se">Daniel Bevenius</a>
- * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
- * @since Version 4.2
- */
-public class ReceiveJMSMessage {
- TopicConnection topicConn;
- TopicSession topicSession;
- Topic topic;
- TopicConnectionFactory topicFactory;
-
- MessageListener ml = null;
-
- /**
- * Inner class listener that prints out message contents.
- */
- public static class ExListener implements MessageListener {
- public void onMessage(Message msg) {
- TextMessage tm = (TextMessage) msg;
- try {
- System.out.println("onMessage, control channel recv text=" + tm.getText());
- } catch (Throwable t) {
- t.printStackTrace();
- }
- } /* method */
- } /* class */
-
- /**
- * Creates a subscriber and attaches a listener
- * @param topicName topic name
- */
- public void receiveOne(String topicName, boolean isDurable)
- {
- TopicSubscriber subscriber = null;
- Properties properties1 = new Properties();
- properties1.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
- properties1.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
- properties1.put(Context.PROVIDER_URL, "jnp://localhost:1099");
- try {
- InitialContext iniCtx = new InitialContext(properties1);
- topicFactory = (TopicConnectionFactory) iniCtx.lookup("ConnectionFactory");
- topic = (Topic) iniCtx.lookup(topicName);
-
- topicConn = topicFactory.createTopicConnection("guest", "guest");
- topicConn.setClientID("clientid");
- topicSession = topicConn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
- if (isDurable) {
- subscriber = topicSession.createDurableSubscriber(topic, "testsub", null, false);
- } else {
- subscriber = topicSession.createSubscriber(topic);
- }
- ml = new ExListener();
- subscriber.setMessageListener(ml);
- topicConn.start();
- } catch (JMSException e) {
- e.printStackTrace();
- } catch (NamingException e) {
- e.printStackTrace();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public static void main(String args[]) throws Exception
- {
- if (args.length < 2) {
- System.err.println("Usage: java ReceiveJMSMessage <topic-name> [durable|non-durable]");
- System.exit(-1);
- }
- ReceiveJMSMessage rm = new ReceiveJMSMessage();
- rm.receiveOne(args[0], args[1].equals("durable"));
- while (true) {
- }
- }
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,118 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.jms.TopicSession;
+import javax.jms.TopicSubscriber;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ * JMS Message Receiver.
+ * <p/>
+ *
+ * A small utility that subscribes to a topic and creates a listener that prints message content.
+ *
+ * @author <a href="mailto:daniel.bevenius at redpill.se">Daniel Bevenius</a>
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
+public class ReceiveJMSMessage {
+ TopicConnection topicConn;
+ TopicSession topicSession;
+ Topic topic;
+ TopicConnectionFactory topicFactory;
+
+ MessageListener ml = null;
+
+ /**
+ * Inner class listener that prints out message contents.
+ */
+ public static class ExListener implements MessageListener {
+ public void onMessage(Message msg) {
+ TextMessage tm = (TextMessage) msg;
+ try {
+ System.out.println("onMessage, control channel recv text=" + tm.getText());
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ } /* method */
+ } /* class */
+
+ /**
+ * Creates a subscriber and attaches a listener
+ * @param topicName topic name
+ */
+ public void receiveOne(String topicName, boolean isDurable)
+ {
+ TopicSubscriber subscriber = null;
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://localhost:1099");
+ try {
+ InitialContext iniCtx = new InitialContext(properties1);
+ topicFactory = (TopicConnectionFactory) iniCtx.lookup("ConnectionFactory");
+ topic = (Topic) iniCtx.lookup(topicName);
+
+ topicConn = topicFactory.createTopicConnection("guest", "guest");
+ topicConn.setClientID("clientid");
+ topicSession = topicConn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
+ if (isDurable) {
+ subscriber = topicSession.createDurableSubscriber(topic, "testsub", null, false);
+ } else {
+ subscriber = topicSession.createSubscriber(topic);
+ }
+ ml = new ExListener();
+ subscriber.setMessageListener(ml);
+ topicConn.start();
+ } catch (JMSException e) {
+ e.printStackTrace();
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void main(String args[]) throws Exception
+ {
+ if (args.length < 2) {
+ System.err.println("Usage: java ReceiveJMSMessage <topic-name> [durable|non-durable]");
+ System.exit(-1);
+ }
+ ReceiveJMSMessage rm = new ReceiveJMSMessage();
+ rm.receiveOne(args[0], args[1].equals("durable"));
+ while (true) {
+ }
+ }
+
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,66 +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.samples.quickstart.helloworldtopicnotifier.test;
-
-import java.net.URI;
-import java.util.UUID;
-
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.client.ServiceInvoker;
-
-/**
- * Standalone class with to send ESB messages to a 'known' [category,name].
- * <p/> arg0 - service category
- * <br/>arg1 - service name
- * <br/>arg2 - Text of message to send
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- *
- */
-public class SendEsbMessage
-{
- public static void main(String args[]) throws Exception
- {
-// Setting the ConnectionFactory such that it will use scout
- System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
-
- if (args.length < 3)
- {
- System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
- }
- // Create a message, assign it a UID, and fill in call information
- Message esbMessage = MessageFactory.getInstance().getMessage();
- Call call = new Call();
- call.setMessageID(new URI(UUID.randomUUID().toString()));
- esbMessage.getHeader().setCall(call);
-
- // set body contents with args[2], and send
- esbMessage.getBody().add(args[2]);
-
- new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
- }
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,66 @@
+/*
+ * 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.samples.quickstart.helloworldtopicnotifier.test;
+
+import java.net.URI;
+import java.util.UUID;
+
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+/**
+ * Standalone class with to send ESB messages to a 'known' [category,name].
+ * <p/> arg0 - service category
+ * <br/>arg1 - service name
+ * <br/>arg2 - Text of message to send
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ *
+ */
+public class SendEsbMessage
+{
+ public static void main(String args[]) throws Exception
+ {
+// Setting the ConnectionFactory such that it will use scout
+ System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+
+ if (args.length < 3)
+ {
+ System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
+ }
+ // Create a message, assign it a UID, and fill in call information
+ Message esbMessage = MessageFactory.getInstance().getMessage();
+ Call call = new Call();
+ call.setMessageID(new URI(UUID.randomUUID().toString()));
+ esbMessage.getHeader().setCall(call);
+
+ // set body contents with args[2], and send
+ esbMessage.getBody().add(args[2]);
+
+ new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
+ }
+
+}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,94 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier.test;
-
-import java.util.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- * JMS Message Sender.
- * <p/>
- *
- * A small utility that sends a message to a queue.
- *
- * @author <a href="mailto:daniel.bevenius at redpill.se">Daniel Bevenius</a>
- * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
- * @since Version 4.2
- */
-public class SendJMSMessage {
- QueueConnection conn;
- QueueSession session;
- Queue que;
-
- public void setupConnection() throws JMSException, NamingException
- {
- Properties properties1 = new Properties();
- properties1.put(Context.INITIAL_CONTEXT_FACTORY,
- "org.jnp.interfaces.NamingContextFactory");
- properties1.put(Context.URL_PKG_PREFIXES,
- "org.jboss.naming:org.jnp.interfaces");
- properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
- InitialContext iniCtx = new InitialContext(properties1);
-
- Object tmp = iniCtx.lookup("ConnectionFactory");
- QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
- conn = qcf.createQueueConnection();
- que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_topic_notifier_Request_gw");
- session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- conn.start();
- System.out.println("Connection Started");
- }
-
- public void stop() throws JMSException
- {
- conn.stop();
- session.close();
- conn.close();
- }
-
- public void sendAMessage(String msg) throws JMSException {
-
- QueueSender send = session.createSender(que);
- ObjectMessage tm = session.createObjectMessage(msg);
- send.send(tm);
- send.close();
- }
-
-
- public static void main(String args[]) throws Exception
- {
- SendJMSMessage sm = new SendJMSMessage();
- sm.setupConnection();
- sm.sendAMessage(args[0]);
- sm.stop();
-
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,94 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworldtopicnotifier.test;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ * JMS Message Sender.
+ * <p/>
+ *
+ * A small utility that sends a message to a queue.
+ *
+ * @author <a href="mailto:daniel.bevenius at redpill.se">Daniel Bevenius</a>
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_topic_notifier_Request_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/build.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,145 +0,0 @@
-<project name="Quickstart_helloworld_TX_SQL_action" default="run" basedir=".">
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <property name="additional.deploys" value="jbossesb-service.xml" />
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
-
- <target name="quickstart-specific-assemblies" description="Quickstart specific assemblies">
- </target>
-
- <target name="quickstart-specific-deploys" description="Quickstart specific deploys">
- <copy file="quickstart-ds.xml"
- todir="${org.jboss.esb.server.deploy.dir}"
- overwrite="false"/>
- </target>
-
- <target name="runtest" depends="dependencies" description="Insert row data into sql table polled by gateway">
- <property name="hsqldb.jar"
- value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
- <echo>Insert row data into sql table polled by gateway</echo>
- <sql
- driver="org.hsqldb.jdbcDriver"
- url="jdbc:hsqldb:hsql://localhost:1703"
- userid="sa"
- autocommit="true"
- password="">
- <classpath>
- <pathelement path="${hsqldb.jar}"/>
- </classpath>
- <transaction src="populate.sql"/>
- </sql>
- </target>
-
- <target name="create" depends="dependencies" description="create table tx_esb_messages">
- <property name="hsqldb.jar"
- value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
- <echo>create table tx_esb_messages</echo>
- <sql
- print="true"
- driver="org.hsqldb.jdbcDriver"
- url="jdbc:hsqldb:hsql://localhost:1703"
- userid="sa"
- autocommit="true"
- password="">
- <classpath>
- <pathelement path="${hsqldb.jar}"/>
- </classpath>
- <transaction>
- create table tx_esb_messages(MESSAGE_ID varchar, STATUS_COL varchar NOT NULL, TIMESTAMP_COL bigint, DATA_COL varchar NOT NULL);
- </transaction>
- </sql>
-
- </target>
-
- <target name="drop" depends="dependencies" description="drop table tx_esb_messages">
- <property name="hsqldb.jar"
- value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
- <echo>drop table tx_esb_messages</echo>
- <sql
- print="true"
- driver="org.hsqldb.jdbcDriver"
- url="jdbc:hsqldb:hsql://localhost:1703"
- userid="sa"
- autocommit="true"
- password="">
- <classpath>
- <pathelement path="${hsqldb.jar}"/>
- </classpath>
- <transaction>
- drop table tx_esb_messages
- </transaction>
- </sql>
-
- </target>
-
- <target name="drop2" depends="dependencies" description="drop table gateway_table">
- <property name="hsqldb.jar"
- value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
- <echo>drop table gateway_table</echo>
- <sql
- print="true"
- driver="org.hsqldb.jdbcDriver"
- url="jdbc:hsqldb:hsql://localhost:1703"
- userid="sa"
- autocommit="true"
- password="">
- <classpath>
- <pathelement path="${hsqldb.jar}"/>
- </classpath>
- <transaction>
- drop table gateway_table
- </transaction>
- </sql>
-
- </target>
-
- <target name="select" depends="dependencies" description="select * from gateway_table">
- <property name="hsqldb.jar"
- value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
- <echo>Select * from gateway_table</echo>
- <sql
- print="true"
- driver="org.hsqldb.jdbcDriver"
- url="jdbc:hsqldb:hsql://localhost:1703"
- userid="sa"
- autocommit="true"
- password="">
- <classpath>
- <pathelement path="${hsqldb.jar}"/>
- </classpath>
- <transaction>
- select * from tx_esb_messages
- </transaction>
- </sql>
- <sql
- print="true"
- driver="org.hsqldb.jdbcDriver"
- url="jdbc:hsqldb:hsql://localhost:1703"
- userid="sa"
- autocommit="true"
- password="">
- <classpath>
- <pathelement path="${hsqldb.jar}"/>
- </classpath>
- <transaction>
- select * from gateway_table
- </transaction>
- </sql>
-
- </target>
-
- <target name="deploy-jms-dests">
- <echo message="This quickstart doesn't use any JMS Destinations. No JMS deployments required." />
- </target>
-
- <target name="undeploy-jms-dests">
- <echo message="This quickstart doesn't use any JMS Destinations. No JMS undeployments required." />
- </target>
-
-</project>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/build.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,145 @@
+<project name="Quickstart_helloworld_TX_SQL_action" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="additional.deploys" value="jbossesb-service.xml" />
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="quickstart-specific-assemblies" description="Quickstart specific assemblies">
+ </target>
+
+ <target name="quickstart-specific-deploys" description="Quickstart specific deploys">
+ <copy file="quickstart-ds.xml"
+ todir="${org.jboss.esb.server.deploy.dir}"
+ overwrite="false"/>
+ </target>
+
+ <target name="runtest" depends="dependencies" description="Insert row data into sql table polled by gateway">
+ <property name="hsqldb.jar"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+ <echo>Insert row data into sql table polled by gateway</echo>
+ <sql
+ driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ userid="sa"
+ autocommit="true"
+ password="">
+ <classpath>
+ <pathelement path="${hsqldb.jar}"/>
+ </classpath>
+ <transaction src="populate.sql"/>
+ </sql>
+ </target>
+
+ <target name="create" depends="dependencies" description="create table tx_esb_messages">
+ <property name="hsqldb.jar"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+ <echo>create table tx_esb_messages</echo>
+ <sql
+ print="true"
+ driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ userid="sa"
+ autocommit="true"
+ password="">
+ <classpath>
+ <pathelement path="${hsqldb.jar}"/>
+ </classpath>
+ <transaction>
+ create table tx_esb_messages(MESSAGE_ID varchar, STATUS_COL varchar NOT NULL, TIMESTAMP_COL bigint, DATA_COL varchar NOT NULL);
+ </transaction>
+ </sql>
+
+ </target>
+
+ <target name="drop" depends="dependencies" description="drop table tx_esb_messages">
+ <property name="hsqldb.jar"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+ <echo>drop table tx_esb_messages</echo>
+ <sql
+ print="true"
+ driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ userid="sa"
+ autocommit="true"
+ password="">
+ <classpath>
+ <pathelement path="${hsqldb.jar}"/>
+ </classpath>
+ <transaction>
+ drop table tx_esb_messages
+ </transaction>
+ </sql>
+
+ </target>
+
+ <target name="drop2" depends="dependencies" description="drop table gateway_table">
+ <property name="hsqldb.jar"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+ <echo>drop table gateway_table</echo>
+ <sql
+ print="true"
+ driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ userid="sa"
+ autocommit="true"
+ password="">
+ <classpath>
+ <pathelement path="${hsqldb.jar}"/>
+ </classpath>
+ <transaction>
+ drop table gateway_table
+ </transaction>
+ </sql>
+
+ </target>
+
+ <target name="select" depends="dependencies" description="select * from gateway_table">
+ <property name="hsqldb.jar"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+ <echo>Select * from gateway_table</echo>
+ <sql
+ print="true"
+ driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ userid="sa"
+ autocommit="true"
+ password="">
+ <classpath>
+ <pathelement path="${hsqldb.jar}"/>
+ </classpath>
+ <transaction>
+ select * from tx_esb_messages
+ </transaction>
+ </sql>
+ <sql
+ print="true"
+ driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ userid="sa"
+ autocommit="true"
+ password="">
+ <classpath>
+ <pathelement path="${hsqldb.jar}"/>
+ </classpath>
+ <transaction>
+ select * from gateway_table
+ </transaction>
+ </sql>
+
+ </target>
+
+ <target name="deploy-jms-dests">
+ <echo message="This quickstart doesn't use any JMS Destinations. No JMS deployments required." />
+ </target>
+
+ <target name="undeploy-jms-dests">
+ <echo message="This quickstart doesn't use any JMS Destinations. No JMS undeployments required." />
+ </target>
+
+</project>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,67 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
- <providers>
- <sql-provider name="GatewaySQLprovider"
- url="jdbc:hsqldb:hsql://localhost:1703"
- driver="org.hsqldb.jdbcDriver"
- username="sa"
- password="">
- <sql-bus busid="helloSQLChannel" >
- <sql-message-filter
- tablename="GATEWAY_TABLE"
- status-column="STATUS_COL"
- order-by="DATA_COLUMN"
- where-condition="DATA_COLUMN like 'data%'"
- message-column="message"
- message-id-column="UNIQUE_ID"
- insert-timestamp-column="TIMESTAMP_COL"
- />
- </sql-bus>
- </sql-provider>
-
- <sql-provider name="SQLprovider"
- url="jdbc:hsqldb:hsql://localhost:1703"
- datasource="java:/QuickstartDB">
- <sql-bus busid="TxHelloSQLChannel" >
- <sql-message-filter
- tablename="TX_ESB_MESSAGES"
- message-id-column="MESSAGE_ID"
- status-column="STATUS_COL"
- insert-timestamp-column="TIMESTAMP_COL"
- message-column="DATA_COL"
- />
- </sql-bus>
- </sql-provider>
-
- </providers>
-
- <services>
- <service
- category="myCategory"
- name="myTxListener"
- description="Hello World TX SQL Action (esb jdbc listener)">
- <listeners>
- <sql-listener name="SqlGateway"
- busidref="helloSQLChannel"
- maxThreads="1"
- is-gateway="true"/>
- <sql-listener name="TxSqlListener"
- busidref="TxHelloSQLChannel"
- maxThreads="1">
- <property name="transacted" value="true"/>
- </sql-listener>
- </listeners>
- <actions mep="OneWay">
- <action name="action1"
- class="org.jboss.soa.esb.samples.quickstart.helloworldtxsqlaction.MyAction"
- process="displayMessage"
- />
- <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln" />
- </actions>
-
- </service>
- </services>
-
-</jbossesb>
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,67 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <sql-provider name="GatewaySQLprovider"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ driver="org.hsqldb.jdbcDriver"
+ username="sa"
+ password="">
+ <sql-bus busid="helloSQLChannel" >
+ <sql-message-filter
+ tablename="GATEWAY_TABLE"
+ status-column="STATUS_COL"
+ order-by="DATA_COLUMN"
+ where-condition="DATA_COLUMN like 'data%'"
+ message-column="message"
+ message-id-column="UNIQUE_ID"
+ insert-timestamp-column="TIMESTAMP_COL"
+ />
+ </sql-bus>
+ </sql-provider>
+
+ <sql-provider name="SQLprovider"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ datasource="java:/QuickstartDB">
+ <sql-bus busid="TxHelloSQLChannel" >
+ <sql-message-filter
+ tablename="TX_ESB_MESSAGES"
+ message-id-column="MESSAGE_ID"
+ status-column="STATUS_COL"
+ insert-timestamp-column="TIMESTAMP_COL"
+ message-column="DATA_COL"
+ />
+ </sql-bus>
+ </sql-provider>
+
+ </providers>
+
+ <services>
+ <service
+ category="myCategory"
+ name="myTxListener"
+ description="Hello World TX SQL Action (esb jdbc listener)">
+ <listeners>
+ <sql-listener name="SqlGateway"
+ busidref="helloSQLChannel"
+ maxThreads="1"
+ is-gateway="true"/>
+ <sql-listener name="TxSqlListener"
+ busidref="TxHelloSQLChannel"
+ maxThreads="1">
+ <property name="transacted" value="true"/>
+ </sql-listener>
+ </listeners>
+ <actions mep="OneWay">
+ <action name="action1"
+ class="org.jboss.soa.esb.samples.quickstart.helloworldtxsqlaction.MyAction"
+ process="displayMessage"
+ />
+ <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln" />
+ </actions>
+
+ </service>
+ </services>
+
+</jbossesb>
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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,
- @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
- These options are described in the JBossESB manual.
- Defaults are provided here for convenience only.
-
- Please read through this file prior to using the system, and consider
- updating the specified entries.
--->
-<esb
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
- <properties name="core">
- <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
- <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
- </properties>
- <properties name="registry">
- <property name="org.jboss.soa.esb.registry.queryManagerURI"
- value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
- value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
- <property name="org.jboss.soa.esb.registry.implementationClass"
- value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
- <property name="org.jboss.soa.esb.registry.factoryClass"
- value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
- <property name="org.jboss.soa.esb.registry.user"
- value="jbossesb"/>
- <property name="org.jboss.soa.esb.registry.password"
- value="password"/>
- <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
- <property name="org.jboss.soa.esb.scout.proxy.transportClass"
- value="org.apache.ws.scout.transport.RMITransport"/>
- </properties>
- <properties name="transports" depends="core">
- <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
- <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
- <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
- </properties>
- <properties name="connection">
- <property name="min-pool-size" value="5"/>
- <property name="max-pool=size" value="10"/>
- <property name="blocking-timeout-millis" value="5000"/>
- <property name="abandoned-connection-timeout" value="10000"/>
- <property name="abandoned-connection-time-interval" value="30000"/>
- </properties>
- <properties name="dbstore">
- <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
- <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
- <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
- <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
- <!--table managed by pool to test for valid connections - created by pool automatically -->
- <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
- <!-- # of milliseconds to timeout waiting for a connection from pool -->
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
- </properties>
- <properties name="messagerouting">
- <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
- </properties>
-</esb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
- <mbean code="org.jboss.internal.soa.esb.dependencies.DatabaseInitializer"
- name="jboss.esb:service=QuickstartDatabaseInitializer">
- <attribute name="Datasource">java:/QuickstartDB</attribute>
- <attribute name="ExistsSql">select * from gateway_table</attribute>
- <attribute name="SqlFiles">
- hsqldb/create.sql
- </attribute>
- <depends>jboss.jca:name=QuickstartDB,service=DataSourceBinding</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <mbean code="org.jboss.internal.soa.esb.dependencies.DatabaseInitializer"
+ name="jboss.esb:service=QuickstartDatabaseInitializer">
+ <attribute name="Datasource">java:/QuickstartDB</attribute>
+ <attribute name="ExistsSql">select * from gateway_table</attribute>
+ <attribute name="SqlFiles">
+ hsqldb/create.sql
+ </attribute>
+ <depends>jboss.jca:name=QuickstartDB,service=DataSourceBinding</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
-
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/lib (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/lib)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <!-- A size based file rolling appender -->
- <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="File" value="./listener.log"/>
- <param name="Append" value="false"/>
- <param name="MaxFileSize" value="500KB"/>
- <param name="MaxBackupIndex" value="1"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jboss">
- <priority value="WARN"/>
- </category>
- <category name="org.jboss.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.jboss.internal.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.apache">
- <priority value="ERROR"/>
- </category>
- <category name="quickstart">
- <priority value="INFO"/>
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,6 +0,0 @@
-insert into gateway_table(data_column, status_col) values('data 111111','P');
-insert into gateway_table(data_column, status_col) values('data 22','P');
-insert into gateway_table(data_column, status_col) values('data 333333333333111111','P');
-insert into gateway_table(data_column, status_col) values('data d d d d','P');
-insert into gateway_table(data_column, status_col) values('do not consume', 'P');
-insert into gateway_table(data_column, status_col) values('data last record','P');
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,6 @@
+insert into gateway_table(data_column, status_col) values('data 111111','P');
+insert into gateway_table(data_column, status_col) values('data 22','P');
+insert into gateway_table(data_column, status_col) values('data 333333333333111111','P');
+insert into gateway_table(data_column, status_col) values('data d d d d','P');
+insert into gateway_table(data_column, status_col) values('do not consume', 'P');
+insert into gateway_table(data_column, status_col) values('data last record','P');
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <jndi-name>QuickstartDB</jndi-name>
- <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1703</connection-url>
- <driver-class>org.hsqldb.jdbcDriver</driver-class>
- <user-name>sa</user-name>
- <password></password>
- <min-pool-size>5</min-pool-size>
- <max-pool-size>20</max-pool-size>
- <idle-timeout-minutes>0</idle-timeout-minutes>
- <depends>jboss:service=Hypersonic</depends>
- <prepared-statement-cache-size>32</prepared-statement-cache-size>
- </local-tx-datasource>
-
- <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
- <mbean code="org.jboss.jdbc.HypersonicDatabase"
- name="jboss:service=Hypersonic">
- <attribute name="Port">1703</attribute>
- <attribute name="BindAddress">${jboss.bind.address}</attribute>
- <attribute name="Database">QuickstartDB</attribute>
- <attribute name="Silent">true</attribute>
- <attribute name="Trace">false</attribute>
- <attribute name="No_system_exit">true</attribute>
- </mbean>
-</datasources>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>QuickstartDB</jndi-name>
+ <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1703</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ <min-pool-size>5</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <idle-timeout-minutes>0</idle-timeout-minutes>
+ <depends>jboss:service=Hypersonic</depends>
+ <prepared-statement-cache-size>32</prepared-statement-cache-size>
+ </local-tx-datasource>
+
+ <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
+ <mbean code="org.jboss.jdbc.HypersonicDatabase"
+ name="jboss:service=Hypersonic">
+ <attribute name="Port">1703</attribute>
+ <attribute name="BindAddress">${jboss.bind.address}</attribute>
+ <attribute name="Database">QuickstartDB</attribute>
+ <attribute name="Silent">true</attribute>
+ <attribute name="Trace">false</attribute>
+ <attribute name="No_system_exit">true</attribute>
+ </mbean>
+</datasources>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,33 +0,0 @@
-Overview:
-=========
- This quickstart demonstrates an SQL listener.
-
-Running this quickstart:
-========================
- Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
- and a more detailed descripton of the different ways to run the quickstarts.
-
- NOTE:
- 1. This quickstart uses hsqldb so that it can be deployed without any
- setup required.
- 2. "ant select" will show you the contents of the database table. The
- <sql-message-filter> defined has a where-condition, so one of the rows
- that the table is populated with will never be processed. There
- should be one remaining row for each time the table is populated.
- 3. run 'ant create' after deploying.
-
-To Run standalone mode:
-=======================
- 1. In a command terminal window in this folder ("Window1"), type 'ant run'.
- 2. Open another command terminal window in this folder ("Window2"), type
- 'ant runtest'.
- 3. Switch back to "Window1" to see the output from the ESB
- 4. When finished, interrupt the ESB using Ctrl-C.
-
-To Run '.esb' archive mode:
-===========================
- 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
- 2. Open another command terminal window in this folder ("Window2"), type
- 'ant runtest'.
- 3. Switch back to Application Server console to see the output from the ESB
- 4. In this folder ("Window1"), type 'ant undeploy'.
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,33 @@
+Overview:
+=========
+ This quickstart demonstrates an SQL listener.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+ NOTE:
+ 1. This quickstart uses hsqldb so that it can be deployed without any
+ setup required.
+ 2. "ant select" will show you the contents of the database table. The
+ <sql-message-filter> defined has a where-condition, so one of the rows
+ that the table is populated with will never be processed. There
+ should be one remaining row for each time the table is populated.
+ 3. run 'ant create' after deploying.
+
+To Run standalone mode:
+=======================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant run'.
+ 2. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 3. Switch back to "Window1" to see the output from the ESB
+ 4. When finished, interrupt the ESB using Ctrl-C.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 3. Switch back to Application Server console to see the output from the ESB
+ 4. In this folder ("Window1"), type 'ant undeploy'.
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,6 +0,0 @@
-create table gateway_table
-(
-unique_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
-data_column VARCHAR(255) NOT NULL,
-status_col VARCHAR(255) NOT NULL
-);
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,6 @@
+create table gateway_table
+(
+unique_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+data_column VARCHAR(255) NOT NULL,
+status_col VARCHAR(255) NOT NULL
+);
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldsqlaction (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldsqlaction)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,89 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.helloworldtxsqlaction;
-
-import java.util.Map;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.body.content.BytesBody;
-
-public class MyAction extends AbstractActionLifecycle
-{
- private static int checkIter = 0;
-
- protected ConfigTree _config;
-
- public MyAction(ConfigTree config) { _config = config; }
-
- public Message noOperation(Message message) { return message; }
-
- @SuppressWarnings("unchecked")
- public Message displayMessage(Message message) throws Exception{
- boolean problem = false;
-
- logHeader();
- Map<String,Object> rowData =(Map)message.getBody().get();
- StringBuffer results = new StringBuffer();
- for (Map.Entry<String,Object> curr : rowData.entrySet()) {
- results.append("column "+curr.getKey()+" = <" + curr.getValue()+">");
-
- if (curr.getValue().equals("data 22"))
- {
- System.out.println("DATA READ: "+curr.getValue());
-
- if (checkIter++ < 2)
- problem = true;
- }
- }
- System.out.println(results.toString());
- logFooter();
-
- // Set message properties and message body so that SystemPrintln will display message
- message.getProperties().setProperty("jbesbfilename", "helloworldTxSQlAction.log");
- message.getBody().add(results.toString());
-
- if (problem)
- System.out.println("Will rollback transaction. Expect to see record again!");
- else
- System.out.println("Will commit transaction. Will not see record again!");
-
- if (!problem)
- return message;
- else
- {
- System.out.println("BAD READ ON DATA!");
-
- throw new RuntimeException();
- }
- }
-
- // This makes it easier to read on the console
- private void logHeader() {
- System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
- }
- private void logFooter() {
- System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
- }
-
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,89 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworldtxsqlaction;
+
+import java.util.Map;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.body.content.BytesBody;
+
+public class MyAction extends AbstractActionLifecycle
+{
+ private static int checkIter = 0;
+
+ protected ConfigTree _config;
+
+ public MyAction(ConfigTree config) { _config = config; }
+
+ public Message noOperation(Message message) { return message; }
+
+ @SuppressWarnings("unchecked")
+ public Message displayMessage(Message message) throws Exception{
+ boolean problem = false;
+
+ logHeader();
+ Map<String,Object> rowData =(Map)message.getBody().get();
+ StringBuffer results = new StringBuffer();
+ for (Map.Entry<String,Object> curr : rowData.entrySet()) {
+ results.append("column "+curr.getKey()+" = <" + curr.getValue()+">");
+
+ if (curr.getValue().equals("data 22"))
+ {
+ System.out.println("DATA READ: "+curr.getValue());
+
+ if (checkIter++ < 2)
+ problem = true;
+ }
+ }
+ System.out.println(results.toString());
+ logFooter();
+
+ // Set message properties and message body so that SystemPrintln will display message
+ message.getProperties().setProperty("jbesbfilename", "helloworldTxSQlAction.log");
+ message.getBody().add(results.toString());
+
+ if (problem)
+ System.out.println("Will rollback transaction. Expect to see record again!");
+ else
+ System.out.println("Will commit transaction. Will not see record again!");
+
+ if (!problem)
+ return message;
+ else
+ {
+ System.out.println("BAD READ ON DATA!");
+
+ throw new RuntimeException();
+ }
+ }
+
+ // This makes it easier to read on the console
+ private void logHeader() {
+ System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ }
+ private void logFooter() {
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
+ }
+
+}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/samples/quickstarts/jms_secured/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_secured/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_secured/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -47,7 +47,7 @@
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -9,10 +9,8 @@
<import file="../conf/base-build.xml"/>
<target name="runtest" depends="compile" description="Send a message to the JMS Topic">
- <java fork="yes" classname="org.jboss.soa.esb.testutils.JMSUtil" failonerror="true"
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.jmstopic.SendJMSMessage" failonerror="true"
classpathref="exec-classpath">
- <arg value="quickstart_jmstopic_topic"/>
- <arg value="topic"/>
<arg value="Hello"/>
</java>
</target>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -72,6 +72,7 @@
</listeners>
<actions mep="OneWay">
<action name="target" class="org.jboss.soa.esb.samples.quickstart.jmstopic.TargetServiceAction" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/MessageAugmentor.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/MessageAugmentor.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/MessageAugmentor.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -28,11 +28,6 @@
import org.jboss.soa.esb.client.ServiceInvoker;
import org.jboss.soa.esb.message.Message;
-import java.util.List;
-import java.util.ArrayList;
-
-import junit.framework.TestCase;
-
/**
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
*/
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,84 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.jmstopic;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSubscriber;
+import javax.jms.TopicSession;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ TopicConnectionFactory tcf;
+ TopicSession session;
+ Topic topic;
+ TopicConnection tc;
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ tcf = (TopicConnectionFactory) iniCtx.lookup("ConnectionFactory");
+ topic = (Topic) iniCtx.lookup("/topic/quickstart_jmstopic_topic");
+ }
+
+ public void stop() throws JMSException
+ {
+ tc.stop();
+ session.close();
+ tc.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+ tc = tcf.createTopicConnection();
+ session = tc.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
+ TopicPublisher tp = session.createPublisher(topic);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ tp.publish(tm);
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/build.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,70 +0,0 @@
-<project name="Quickstart_JMS_Transacted" default="deploy" basedir=".">
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <property name="additional.deploys" value="jbossesb-service.xml" />
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
-
- <target name="quickstart-specific-deploys">
- <copy file="quickstart-ds.xml"
- todir="${org.jboss.esb.server.deploy.dir}"
- overwrite="false"/>
- </target>
-
- <target name="quickstart-specific-undeploys">
- <delete file="${org.jboss.esb.server.deploy.dir}/quickstart-ds.xml"/>
- </target>
-
- <target name="runtest" depends="compile"
- description="sends a JMS message to queue/quickstart_jms_transacted_Request_gw">
- <echo>Runs Test JMS Sender</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.jmstransacted.test.SendJMSMessage" failonerror="true">
- <arg value="Hello Transacted JMS World]"/>
- <classpath refid="exec-classpath"/>
- </java>
- </target>
-
- <target name="select" depends="dependencies" description="select * from jsm_transacted_table">
- <property name="hsqldb.jar"
- value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
- <echo>Select * from jms_transacted_table</echo>
- <sql
- print="true"
- driver="org.hsqldb.jdbcDriver"
- url="jdbc:hsqldb:hsql://localhost:1703"
- userid="sa"
- autocommit="true"
- password="">
- <classpath>
- <pathelement path="${hsqldb.jar}"/>
- </classpath>
- <transaction>
- select data_column from jms_transacted_table
- </transaction>
- </sql>
-
- </target>
-
- <target name="truncate" depends="dependencies" description="delete from jms_transacted_table">
- <property name="hsqldb.jar"
- value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
- <echo>Delete from jms_transacted_table </echo>
- <sql
- print="true"
- driver="org.hsqldb.jdbcDriver"
- url="jdbc:hsqldb:hsql://localhost:1703"
- userid="sa"
- autocommit="true"
- password="">
- <classpath>
- <pathelement path="${hsqldb.jar}"/>
- </classpath>
- <transaction>delete from jms_transacted_table</transaction>
- </sql>
- </target>
-</project>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/build.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,70 @@
+<project name="Quickstart_JMS_Transacted" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="additional.deploys" value="jbossesb-service.xml" />
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="quickstart-specific-deploys">
+ <copy file="quickstart-ds.xml"
+ todir="${org.jboss.esb.server.deploy.dir}"
+ overwrite="false"/>
+ </target>
+
+ <target name="quickstart-specific-undeploys">
+ <delete file="${org.jboss.esb.server.deploy.dir}/quickstart-ds.xml"/>
+ </target>
+
+ <target name="runtest" depends="compile"
+ description="sends a JMS message to queue/quickstart_jms_transacted_Request_gw">
+ <echo>Runs Test JMS Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.jmstransacted.test.SendJMSMessage" failonerror="true">
+ <arg value="Hello Transacted JMS World]"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="select" depends="dependencies" description="select * from jsm_transacted_table">
+ <property name="hsqldb.jar"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+ <echo>Select * from jms_transacted_table</echo>
+ <sql
+ print="true"
+ driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ userid="sa"
+ autocommit="true"
+ password="">
+ <classpath>
+ <pathelement path="${hsqldb.jar}"/>
+ </classpath>
+ <transaction>
+ select data_column from jms_transacted_table
+ </transaction>
+ </sql>
+
+ </target>
+
+ <target name="truncate" depends="dependencies" description="delete from jms_transacted_table">
+ <property name="hsqldb.jar"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+ <echo>Delete from jms_transacted_table </echo>
+ <sql
+ print="true"
+ driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:1703"
+ userid="sa"
+ autocommit="true"
+ password="">
+ <classpath>
+ <pathelement path="${hsqldb.jar}"/>
+ </classpath>
+ <transaction>delete from jms_transacted_table</transaction>
+ </sql>
+ </target>
+</project>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/deployment.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/deployment.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,4 +0,0 @@
-<jbossesb-deployment>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_esb</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_gw</depends>
-</jbossesb-deployment>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/deployment.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/deployment.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,4 @@
+<jbossesb-deployment>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_gw</depends>
+</jbossesb-deployment>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jbm-queue-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbm-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_gw"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbm-queue-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbm-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jbmq-queue-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbmq-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_gw">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_esb">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbmq-queue-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbmq-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_gw">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_jms_transacted_Request_esb">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jboss-esb.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,71 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
- <providers>
- <jms-jca-provider name="JBossMessaging" connection-factory="XAConnectionFactory"
- jndi-URL="jnp://127.0.0.1:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
- jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
-
- <jms-bus busid="quickstartGwChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_jms_transacted_Request_gw"
- transacted="true"
- />
- </jms-bus>
- <jms-bus busid="quickstartEsbChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_jms_transacted_Request_esb"
- transacted="true"
- />
- </jms-bus>
-
- </jms-jca-provider>
- </providers>
-
- <services>
- <service
- category="JMSSecuredESB"
- name="SimpleListener"
- description="JMS Secured quickstart sample">
- <listeners>
- <jms-listener name="JMS-Gateway"
- busidref="quickstartGwChannel"
- maxThreads="1"
- is-gateway="true"
- />
- <jms-listener name="jmssecured"
- busidref="quickstartEsbChannel"
- maxThreads="1"/>
- </listeners>
- <actions mep="OneWay">
-
- <action name="printMessage" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="JMS Transacted Quickstart start..."/>
- <property name="printfull" value="false"/>
- </action>
-
- <action name="insertDBAction" class="org.jboss.soa.esb.samples.quickstart.jmstransacted.test.DBInsertAction">
- <property name="datasource-name" value="java:QuickstartDS"/>
- <property name="db-insert-sql" value="insert into jms_transacted_table(data_column) values(?)"/>
- </action>
-
- <!--
- Will throw an Exception upon every other first. This should trigger the transaction to be
- rolledback and the message placed back onto the JMS queue.
- -->
- <action name="throwExceptionAction" class="org.jboss.soa.esb.samples.quickstart.jmstransacted.test.ThrowExceptionAction"/>
-
- <action name="printMessageDone" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="JMS Transacted Quickstart processed sucessfully"/>
- <property name="printfull" value="false"/>
- </action>
-
- <!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
- </actions>
- </service>
- </services>
-
-</jbossesb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jboss-esb.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,71 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <jms-jca-provider name="JBossMessaging" connection-factory="XAConnectionFactory"
+ jndi-URL="jnp://127.0.0.1:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+
+ <jms-bus busid="quickstartGwChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_jms_transacted_Request_gw"
+ transacted="true"
+ />
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_jms_transacted_Request_esb"
+ transacted="true"
+ />
+ </jms-bus>
+
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service
+ category="JMSSecuredESB"
+ name="SimpleListener"
+ description="JMS Secured quickstart sample">
+ <listeners>
+ <jms-listener name="JMS-Gateway"
+ busidref="quickstartGwChannel"
+ maxThreads="1"
+ is-gateway="true"
+ />
+ <jms-listener name="jmssecured"
+ busidref="quickstartEsbChannel"
+ maxThreads="1"/>
+ </listeners>
+ <actions mep="OneWay">
+
+ <action name="printMessage" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="JMS Transacted Quickstart start..."/>
+ <property name="printfull" value="false"/>
+ </action>
+
+ <action name="insertDBAction" class="org.jboss.soa.esb.samples.quickstart.jmstransacted.test.DBInsertAction">
+ <property name="datasource-name" value="java:QuickstartDS"/>
+ <property name="db-insert-sql" value="insert into jms_transacted_table(data_column) values(?)"/>
+ </action>
+
+ <!--
+ Will throw an Exception upon every other first. This should trigger the transaction to be
+ rolledback and the message placed back onto the JMS queue.
+ -->
+ <action name="throwExceptionAction" class="org.jboss.soa.esb.samples.quickstart.jmstransacted.test.ThrowExceptionAction"/>
+
+ <action name="printMessageDone" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="JMS Transacted Quickstart processed sucessfully"/>
+ <property name="printfull" value="false"/>
+ </action>
+
+ <!-- The next action is for Continuous Integration testing -->
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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,
- @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
- These options are described in the JBossESB manual.
- Defaults are provided here for convenience only.
-
- Please read through this file prior to using the system, and consider
- updating the specified entries.
--->
-<esb
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
- <properties name="core">
- <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
- <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
- </properties>
- <properties name="registry">
- <property name="org.jboss.soa.esb.registry.queryManagerURI"
- value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
- value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
- <property name="org.jboss.soa.esb.registry.implementationClass"
- value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
- <property name="org.jboss.soa.esb.registry.factoryClass"
- value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
- <property name="org.jboss.soa.esb.registry.user"
- value="jbossesb"/>
- <property name="org.jboss.soa.esb.registry.password"
- value="password"/>
- <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
- <property name="org.jboss.soa.esb.scout.proxy.transportClass"
- value="org.apache.ws.scout.transport.RMITransport"/>
- </properties>
- <properties name="transports" depends="core">
- <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
- <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
- <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
- </properties>
- <properties name="connection">
- <property name="min-pool-size" value="5"/>
- <property name="max-pool=size" value="10"/>
- <property name="blocking-timeout-millis" value="5000"/>
- <property name="abandoned-connection-timeout" value="10000"/>
- <property name="abandoned-connection-time-interval" value="30000"/>
- </properties>
- <properties name="dbstore">
- <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
- <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
- <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
- <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
- <!--table managed by pool to test for valid connections - created by pool automatically -->
- <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
- <!-- # of milliseconds to timeout waiting for a connection from pool -->
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
- </properties>
- <properties name="messagerouting">
- <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
- </properties>
-</esb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jbossesb-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
- <mbean code="org.jboss.internal.soa.esb.dependencies.DatabaseInitializer"
- name="jboss.esb:service=QuickstartDatabaseInitializer">
- <attribute name="Datasource">java:/QuickstartDS</attribute>
- <attribute name="ExistsSql">select * from jms_transacted_table</attribute>
- <attribute name="SqlFiles">
- hsqldb/create.sql
- </attribute>
- <depends>jboss.jca:name=QuickstartDS,service=DataSourceBinding</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jbossesb-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jbossesb-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <mbean code="org.jboss.internal.soa.esb.dependencies.DatabaseInitializer"
+ name="jboss.esb:service=QuickstartDatabaseInitializer">
+ <attribute name="Datasource">java:/QuickstartDS</attribute>
+ <attribute name="ExistsSql">select * from jms_transacted_table</attribute>
+ <attribute name="SqlFiles">
+ hsqldb/create.sql
+ </attribute>
+ <depends>jboss.jca:name=QuickstartDS,service=DataSourceBinding</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jndi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jndi.properties 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jndi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jndi.properties (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/jndi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jndi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jndi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/juddi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/juddi.properties 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/juddi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
-
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/juddi.properties (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/juddi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/juddi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/juddi.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/log4j.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/log4j.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/log4j.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
- <param name="Threshold" value="INFO"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <!-- A size based file rolling appender -->
- <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="File" value="./listener.log"/>
- <param name="Append" value="false"/>
- <param name="MaxFileSize" value="500KB"/>
- <param name="MaxBackupIndex" value="1"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jboss">
- <priority value="WARN"/>
- </category>
- <category name="org.jboss.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.jboss.internal.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.apache">
- <priority value="ERROR"/>
- </category>
- <category name="quickstart">
- <priority value="DEBUG"/>
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/log4j.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/log4j.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/log4j.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="DEBUG"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/quickstart-ds.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/quickstart-ds.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/quickstart-ds.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <local-tx-datasource>
- <jndi-name>QuickstartDS</jndi-name>
- <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1703</connection-url>
- <driver-class>org.hsqldb.jdbcDriver</driver-class>
- <user-name>sa</user-name>
- <password></password>
- <min-pool-size>5</min-pool-size>
- <max-pool-size>20</max-pool-size>
- <idle-timeout-minutes>0</idle-timeout-minutes>
- <depends>jboss:service=Hypersonic</depends>
- <prepared-statement-cache-size>32</prepared-statement-cache-size>
- </local-tx-datasource>
-
- <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
- <mbean code="org.jboss.jdbc.HypersonicDatabase"
- name="jboss:service=Hypersonic">
- <attribute name="Port">1703</attribute>
- <attribute name="BindAddress">${jboss.bind.address}</attribute>
- <attribute name="Database">QuickstartDB</attribute>
- <attribute name="Silent">true</attribute>
- <attribute name="Trace">false</attribute>
- <attribute name="No_system_exit">true</attribute>
- </mbean>
-</datasources>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/quickstart-ds.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/quickstart-ds.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/quickstart-ds.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/quickstart-ds.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>QuickstartDS</jndi-name>
+ <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1703</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ <min-pool-size>5</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <idle-timeout-minutes>0</idle-timeout-minutes>
+ <depends>jboss:service=Hypersonic</depends>
+ <prepared-statement-cache-size>32</prepared-statement-cache-size>
+ </local-tx-datasource>
+
+ <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
+ <mbean code="org.jboss.jdbc.HypersonicDatabase"
+ name="jboss:service=Hypersonic">
+ <attribute name="Port">1703</attribute>
+ <attribute name="BindAddress">${jboss.bind.address}</attribute>
+ <attribute name="Database">QuickstartDB</attribute>
+ <attribute name="Silent">true</attribute>
+ <attribute name="Trace">false</attribute>
+ <attribute name="No_system_exit">true</attribute>
+ </mbean>
+</datasources>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/readme.txt 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,111 +0,0 @@
-Overview:
-=========
- The purpose of the jms_transacted quickstart is to show how the JMS transport
- in the ESB can be configured to use transactions and how redelivery can be
- accomplished by taking advantage of the JMS transport.
-
- This quickstart consists of a single service that contains 4 actions:
- 1. Log a statement that we have entered the quickstart.
- 2. Insert the contents of the ESB Message object to a database table
- 3. Call a custom action that throws an exception if the message has not
- been redelivered. (more on this later)
- 4. Log a statement that we are about to exit the quickstart.
-
- The main thing to look for is that the first time we enter the action processing
- pipleline, we insert a row into the database, but since the commit is not done
- until the whole pipeline has been executed (as we are using the jms-jca-provider)
- the commit for this insert is not performed. The same goes for the message
- acknowledement of the JMS Message, which in turn causes the JMS message to be
- put back onto the queue.
-
- For more details about how this quickstart works look at the
- "What to look at in this Quckstart" section below.
-
- This quickstart uses jms-jca-provider and more information about jms jca can
- be found here: http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingJCAWithJBossESB
-
-Running this quickstart:
-========================
- Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
- and a more detailed descripton of the different ways to run the quickstarts.
-
-To Run '.esb' archive mode:
-===========================
- 1. In a command terminal window in this folder ("Window1"), type:
- 'ant deploy'
- This will deploy the quickstart
- 2. Open another command terminal window in this folder ("Window2"), type:
- 'ant runtest'
- 3. Switch back to Application Server console to see the output from the ESB
- 4. In this folder ("Window1"), type:
- 'ant select'
- This will display the content of the database table
- 5. [optional] In this folder ("Window1"), type:
- 'ant truncate'
- This will delete the content of the database table.
- 6. In this folder ("Window1"), type:
- 'ant undeploy'
- This will undeploy the quickstart.
-
-What to look at in this Quickstart:
-===================================
- 1. DBInsertAction
- Inserts the contents of the ESB Message object into the database table
- by using the sql statement defined in the property 'db-insert-sql'.
- This class contains a counter that is incremented for each call. This
- counter is added to the text inserted into the table. The string looks
- like this:
- [Hello Transacted JMS World] counter[1]] // counter == 1;
- This is done to seperate the inserts and visually verify that the correct
- data is committed to the database. In a normal run, when the counter is
- '1', the counter should be 2 indicating that only the second commit succeeded.
-
- 2. ThrowExceptionAction
- Checks if the ESB Messae property 'javax.jms.message.redelivered'
- is false, in which case an IllegalArgumentException will be thrown.
- This will will cause the message to be redelivered by JMS transaction handling.
-
- 3. jboss-esb.xml
- The message-filter for the jms-bus-filter now specifies 'transacted' attribute.
-
- 4. 'ant select'
- Ant target that will display all the rows in the database table.
-
- 5. 'ant truncate'
- Ant target that will delete all the rows in the database table.
- Useful to clear the table after multiple runs.
-
-
-Inside look:
-============
- 1. Transactions with JMSGateway
-
- Lets walk through a client publishing a message to a queue. The queue
- will be the queue that our gateway is configured to listen on.
-
- 1. Client publishes message to JMS queue. It can use a JMS session that
- is transacted to do so or not. It does not matter.
- 2. The gateway listener will create a JMS session, or use an existing
- session from the pool, that is transacted. While the JMS Listener
- is running it will consume a JMS message from the queue, package the
- contents of that JMS message into an ESB Message, and use a courier to
- pass the message on to the action pipeline.
-
- Commit:
- When the message has be sent to the courier, and no exception has
- been thrown, the transaction will commit and acknowledge that it
- has accepted the JMS Message.
-
- Rollback:
- But if an exception has occurred, the transaction will be rolled-back
- and the JMS message will not be acknowledged, hence it will be put
- back on the queue.
-
- Usecase for transactions in JMSGateway
- Now, this situation may seem far fetched, but one usecase for
- it might be that the task of packaging the content of the JMS
- Message into the ESB Message is a memory intensive process.
- Lets say that one of your machines is under more heavy load then others
- which could cause it to throw an OutOfMemory Exception. In this case the
- message could be picked up by another ESB instance, which hopefully
- can deal with the message.
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/readme.txt)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,111 @@
+Overview:
+=========
+ The purpose of the jms_transacted quickstart is to show how the JMS transport
+ in the ESB can be configured to use transactions and how redelivery can be
+ accomplished by taking advantage of the JMS transport.
+
+ This quickstart consists of a single service that contains 4 actions:
+ 1. Log a statement that we have entered the quickstart.
+ 2. Insert the contents of the ESB Message object to a database table
+ 3. Call a custom action that throws an exception if the message has not
+ been redelivered. (more on this later)
+ 4. Log a statement that we are about to exit the quickstart.
+
+ The main thing to look for is that the first time we enter the action processing
+ pipleline, we insert a row into the database, but since the commit is not done
+ until the whole pipeline has been executed (as we are using the jms-jca-provider)
+ the commit for this insert is not performed. The same goes for the message
+ acknowledement of the JMS Message, which in turn causes the JMS message to be
+ put back onto the queue.
+
+ For more details about how this quickstart works look at the
+ "What to look at in this Quckstart" section below.
+
+ This quickstart uses jms-jca-provider and more information about jms jca can
+ be found here: http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingJCAWithJBossESB
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type:
+ 'ant deploy'
+ This will deploy the quickstart
+ 2. Open another command terminal window in this folder ("Window2"), type:
+ 'ant runtest'
+ 3. Switch back to Application Server console to see the output from the ESB
+ 4. In this folder ("Window1"), type:
+ 'ant select'
+ This will display the content of the database table
+ 5. [optional] In this folder ("Window1"), type:
+ 'ant truncate'
+ This will delete the content of the database table.
+ 6. In this folder ("Window1"), type:
+ 'ant undeploy'
+ This will undeploy the quickstart.
+
+What to look at in this Quickstart:
+===================================
+ 1. DBInsertAction
+ Inserts the contents of the ESB Message object into the database table
+ by using the sql statement defined in the property 'db-insert-sql'.
+ This class contains a counter that is incremented for each call. This
+ counter is added to the text inserted into the table. The string looks
+ like this:
+ [Hello Transacted JMS World] counter[1]] // counter == 1;
+ This is done to seperate the inserts and visually verify that the correct
+ data is committed to the database. In a normal run, when the counter is
+ '1', the counter should be 2 indicating that only the second commit succeeded.
+
+ 2. ThrowExceptionAction
+ Checks if the ESB Messae property 'javax.jms.message.redelivered'
+ is false, in which case an IllegalArgumentException will be thrown.
+ This will will cause the message to be redelivered by JMS transaction handling.
+
+ 3. jboss-esb.xml
+ The message-filter for the jms-bus-filter now specifies 'transacted' attribute.
+
+ 4. 'ant select'
+ Ant target that will display all the rows in the database table.
+
+ 5. 'ant truncate'
+ Ant target that will delete all the rows in the database table.
+ Useful to clear the table after multiple runs.
+
+
+Inside look:
+============
+ 1. Transactions with JMSGateway
+
+ Lets walk through a client publishing a message to a queue. The queue
+ will be the queue that our gateway is configured to listen on.
+
+ 1. Client publishes message to JMS queue. It can use a JMS session that
+ is transacted to do so or not. It does not matter.
+ 2. The gateway listener will create a JMS session, or use an existing
+ session from the pool, that is transacted. While the JMS Listener
+ is running it will consume a JMS message from the queue, package the
+ contents of that JMS message into an ESB Message, and use a courier to
+ pass the message on to the action pipeline.
+
+ Commit:
+ When the message has be sent to the courier, and no exception has
+ been thrown, the transaction will commit and acknowledge that it
+ has accepted the JMS Message.
+
+ Rollback:
+ But if an exception has occurred, the transaction will be rolled-back
+ and the JMS message will not be acknowledged, hence it will be put
+ back on the queue.
+
+ Usecase for transactions in JMSGateway
+ Now, this situation may seem far fetched, but one usecase for
+ it might be that the task of packaging the content of the JMS
+ Message into the ESB Message is a memory intensive process.
+ Lets say that one of your machines is under more heavy load then others
+ which could cause it to throw an OutOfMemory Exception. In this case the
+ message could be picked up by another ESB instance, which hopefully
+ can deal with the message.
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/hsqldb)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb/create.sql
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/hsqldb/create.sql 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb/create.sql 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,5 +0,0 @@
-create table jms_transacted_table
-(
-unique_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
-data_column VARCHAR(255) NOT NULL
-);
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb/create.sql (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/hsqldb/create.sql)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb/create.sql (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/hsqldb/create.sql 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,5 @@
+create table jms_transacted_table
+(
+unique_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+data_column VARCHAR(255) NOT NULL
+);
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/DBInsertAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/DBInsertAction.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/DBInsertAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,106 +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.samples.quickstart.jmstransacted.test;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import javax.naming.InitialContext;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycle;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- *
- * @author <a href="mailto:daniel.bevenius at gmail.com">Daniel Bevenius</a>
- *
- */
-public class DBInsertAction implements ActionLifecycle
-{
- private Logger log = Logger.getLogger( DBInsertAction.class );
-
- private String sql;
- private String dataSourceName;
-
- private int counter = 1;
-
- public DBInsertAction(final ConfigTree config) throws ConfigurationException
- {
- dataSourceName = config.getRequiredAttribute( "datasource-name" );
- sql = config.getRequiredAttribute( "db-insert-sql" );
-
- }
-
- public Message process( final Message message ) throws ActionProcessingException
- {
- Connection con = null;
- PreparedStatement stmnt = null;
- final String inputText = message.getBody().get() + " counter[" + counter + "]";
- try
- {
- con = getConnection();
- stmnt = con.prepareStatement( sql );
- stmnt.setString( 1, inputText );
- int executeUpdate = stmnt.executeUpdate();
-
- if ( executeUpdate == 1 )
- log.info("Successfully inserted [" + inputText + "] into jms_transacted_table");
- else
- log.info("Failed to inserted [" + inputText + "] into jms_transacted_table");
-
- counter++;
- }
- catch (Exception e)
- {
- log.error( "Exception " , e );
- throw new ActionProcessingException( e );
- }
- finally
- {
- if (stmnt != null) try { stmnt.close();} catch (SQLException e) { log.warn( e ); /* ignore */ }
- if (con != null) try { con.close(); } catch (SQLException e) { log.warn( e ); /* ignore */ }
- }
-
- return message;
- }
-
- public void destroy() throws ActionLifecycleException { }
-
- public void initialise() throws ActionLifecycleException { }
-
- private Connection getConnection() throws NamingException, SQLException
- {
- Context ctx = new InitialContext();
- DataSource ds = (DataSource)ctx.lookup( dataSourceName );
- return ds.getConnection();
- }
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/DBInsertAction.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/DBInsertAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/DBInsertAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/DBInsertAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,106 @@
+/*
+ * 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.samples.quickstart.jmstransacted.test;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+import javax.naming.InitialContext;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycle;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ *
+ * @author <a href="mailto:daniel.bevenius at gmail.com">Daniel Bevenius</a>
+ *
+ */
+public class DBInsertAction implements ActionLifecycle
+{
+ private Logger log = Logger.getLogger( DBInsertAction.class );
+
+ private String sql;
+ private String dataSourceName;
+
+ private int counter = 1;
+
+ public DBInsertAction(final ConfigTree config) throws ConfigurationException
+ {
+ dataSourceName = config.getRequiredAttribute( "datasource-name" );
+ sql = config.getRequiredAttribute( "db-insert-sql" );
+
+ }
+
+ public Message process( final Message message ) throws ActionProcessingException
+ {
+ Connection con = null;
+ PreparedStatement stmnt = null;
+ final String inputText = message.getBody().get() + " counter[" + counter + "]";
+ try
+ {
+ con = getConnection();
+ stmnt = con.prepareStatement( sql );
+ stmnt.setString( 1, inputText );
+ int executeUpdate = stmnt.executeUpdate();
+
+ if ( executeUpdate == 1 )
+ log.info("Successfully inserted [" + inputText + "] into jms_transacted_table");
+ else
+ log.info("Failed to inserted [" + inputText + "] into jms_transacted_table");
+
+ counter++;
+ }
+ catch (Exception e)
+ {
+ log.error( "Exception " , e );
+ throw new ActionProcessingException( e );
+ }
+ finally
+ {
+ if (stmnt != null) try { stmnt.close();} catch (SQLException e) { log.warn( e ); /* ignore */ }
+ if (con != null) try { con.close(); } catch (SQLException e) { log.warn( e ); /* ignore */ }
+ }
+
+ return message;
+ }
+
+ public void destroy() throws ActionLifecycleException { }
+
+ public void initialise() throws ActionLifecycleException { }
+
+ private Connection getConnection() throws NamingException, SQLException
+ {
+ Context ctx = new InitialContext();
+ DataSource ds = (DataSource)ctx.lookup( dataSourceName );
+ return ds.getConnection();
+ }
+
+}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/SendJMSMessage.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,83 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.jmstransacted.test;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- *
- * @author <a href="mailto:daniel.bevenius at gmail.com">Daniel Bevenius</a>
- *
- */
-public class SendJMSMessage
-{
- private QueueConnection connection;
- private QueueSession session;
- private Queue queue;
-
- public void setupConnection() throws JMSException, NamingException
- {
- InitialContext iniCtx = new InitialContext();
-
- QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) iniCtx.lookup("ConnectionFactory");
-
- connection = queueConnectionFactory.createQueueConnection();
-
- queue = (Queue) iniCtx.lookup("queue/quickstart_jms_transacted_Request_gw");
- session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- connection.start();
- System.out.println("Connection Started");
- }
-
- public void stop() throws JMSException
- {
- connection.stop();
- session.close();
- connection.close();
- }
-
- public void sendAMessage(String msg) throws JMSException {
-
- QueueSender sender = session.createSender(queue);
- ObjectMessage objectMsg = session.createObjectMessage(msg);
-
- sender.send(objectMsg);
- sender.close();
- }
-
-
- public static void main(String args[]) throws Exception
- {
- SendJMSMessage sm = new SendJMSMessage();
- sm.setupConnection();
- sm.sendAMessage(args[0]);
- sm.stop();
- }
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/SendJMSMessage.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,83 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.jmstransacted.test;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ *
+ * @author <a href="mailto:daniel.bevenius at gmail.com">Daniel Bevenius</a>
+ *
+ */
+public class SendJMSMessage
+{
+ private QueueConnection connection;
+ private QueueSession session;
+ private Queue queue;
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+
+ QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) iniCtx.lookup("ConnectionFactory");
+
+ connection = queueConnectionFactory.createQueueConnection();
+
+ queue = (Queue) iniCtx.lookup("queue/quickstart_jms_transacted_Request_gw");
+ session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ connection.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ connection.stop();
+ session.close();
+ connection.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender sender = session.createSender(queue);
+ ObjectMessage objectMsg = session.createObjectMessage(msg);
+
+ sender.send(objectMsg);
+ sender.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+ }
+
+}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/ThrowExceptionAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/ThrowExceptionAction.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/ThrowExceptionAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,71 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.jmstransacted.test;
-
-import static org.jboss.soa.esb.notification.jms.JMSPropertiesSetter.JMS_REDELIVERED;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.ActionLifecycle;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * ThrowExceptionAction is a simple action that throws an exception <br>
- * if the message has not been redelivered (first call to this action).
- * </p>
- * Note that this class in only intended to be used with the
- * jms_transacted quickstart.
- * </p>
- * @author <a href="mailto:daniel.bevenius at gmail.com">Daniel Bevenius</a>
- *
- */
-public class ThrowExceptionAction implements ActionLifecycle
-{
- private Logger log = Logger .getLogger( ThrowExceptionAction.class );
-
- public ThrowExceptionAction( final ConfigTree config ) { }
-
- /**
- * Checks if the ESB Messae property 'javax.jms.message.redelivered'
- * is false, in which case an IllegalArgumentException will be thrown. <br>
- * This will will cause the message to be redelivered by JMS transaction
- * handling.
- *
- * @param message - ESB Message object
- * @return Message - unchanged ESB Message Object
- */
- public Message process( final Message message )
- {
- final Boolean redelivered = (Boolean) message.getProperties().getProperty( JMS_REDELIVERED );
- log.info("[" +JMS_REDELIVERED + ":" + redelivered + "]" );
-
- if ( redelivered )
- return message;
- else
- throw new IllegalStateException( "[Throwing Exception to trigger a transaction rollback]");
- }
-
- public void processException(final Message message, final Throwable th) { }
- public void destroy() throws ActionLifecycleException {}
- public void initialise() throws ActionLifecycleException {}
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/ThrowExceptionAction.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/ThrowExceptionAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/ThrowExceptionAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/src/org/jboss/soa/esb/samples/quickstart/jmstransacted/test/ThrowExceptionAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,71 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.jmstransacted.test;
+
+import static org.jboss.soa.esb.notification.jms.JMSPropertiesSetter.JMS_REDELIVERED;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.ActionLifecycle;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * ThrowExceptionAction is a simple action that throws an exception <br>
+ * if the message has not been redelivered (first call to this action).
+ * </p>
+ * Note that this class in only intended to be used with the
+ * jms_transacted quickstart.
+ * </p>
+ * @author <a href="mailto:daniel.bevenius at gmail.com">Daniel Bevenius</a>
+ *
+ */
+public class ThrowExceptionAction implements ActionLifecycle
+{
+ private Logger log = Logger .getLogger( ThrowExceptionAction.class );
+
+ public ThrowExceptionAction( final ConfigTree config ) { }
+
+ /**
+ * Checks if the ESB Messae property 'javax.jms.message.redelivered'
+ * is false, in which case an IllegalArgumentException will be thrown. <br>
+ * This will will cause the message to be redelivered by JMS transaction
+ * handling.
+ *
+ * @param message - ESB Message object
+ * @return Message - unchanged ESB Message Object
+ */
+ public Message process( final Message message )
+ {
+ final Boolean redelivered = (Boolean) message.getProperties().getProperty( JMS_REDELIVERED );
+ log.info("[" +JMS_REDELIVERED + ":" + redelivered + "]" );
+
+ if ( redelivered )
+ return message;
+ else
+ throw new IllegalStateException( "[Throwing Exception to trigger a transaction rollback]");
+ }
+
+ public void processException(final Message message, final Throwable th) { }
+ public void destroy() throws ActionLifecycleException {}
+ public void initialise() throws ActionLifecycleException {}
+
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -8,8 +8,13 @@
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml" />
+ <target name="quickstart-specific-clean">
+ <delete dir="load_generator_classes"/>
+ </target>
+
<target name="init-groovy" depends="dependencies">
<path id="groovy.classpath">
+ <pathelement path="build/classes"/>
<fileset dir="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy">
<include name="jboss-aop-jdk50**/*.jar"/>
</fileset>
@@ -43,15 +48,30 @@
</target>
<target name="load-report" depends="compile-churn" description="Test the report agent script/settings">
- <java classname="LoadReport">
- <classpath refid="groovy.classpath" />
- <classpath location="load_generator_classes" />
- <arg value="load_generator_classes/load.xml" />
+ <java classname="LoadReport" fork="true">
+ <classpath location="${org.jboss.esb.server.home}/client"/>
+ <classpath location="build/classes"/>
+ <classpath refid="groovy.classpath"/>
+ <classpath location="load_generator_classes"/>
+ <arg value="load_generator_classes/load.xml"/>
</java>
</target>
+ <target name="load-report-secure" depends="compile-churn" description="Test the report agent script/settings">
+ <java classname="LoadReport" fork="true">
+ <classpath location="${org.jboss.esb.server.home}/client"/>
+ <classpath location="build/classes"/>
+ <classpath refid="groovy.classpath"/>
+ <classpath location="load_generator_classes"/>
+ <arg line="load_generator_classes/load.xml admin admin"/>
+ </java>
+ </target>
+
<target name="runtest" depends="compile-churn,load-agent,load-report" description="Run the agent in background thread and report script in console">
</target>
+ <target name="runtest-secure" depends="compile-churn,load-agent,load-report-secure" description="Run the agent in background thread and report script in console">
+ </target>
+
</project>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -59,6 +59,7 @@
class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -9,28 +9,34 @@
Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
and a more detailed descripton of the different ways to run the quickstarts.
+Protected JMX
+=======================
+ If access to JMX is secured on your server, run the "ant runtest-secure" target,
+ which takes a username and a password.
+
To Run standalone mode:
=======================
1. In a command terminal window in the quickstart folder type
'ant deploy-jms-dests'.
2. In a command terminal window in this folder ("Window1"), type 'ant run'.
3. Open another command terminal window in this folder ("Window2"), type
- 'ant runtest'.
+ 'ant runtest' or 'ant runtest-secure'.
4. Switch back to "Window1" to see the output from the ESB
5. When finished, interrupt the ESB using Ctrl-C and, in this folder
("Window1"), type 'ant undeploy-jms-dests'.
To Run '.esb' archive mode:
===========================
- 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy-jms-dests' and then 'ant deploy'.
2. Open another command terminal window in this folder ("Window2"), type
- 'ant runtest'.
+ 'ant runtest' or 'ant runtest-secure'.
3. Switch back to Application Server console to see the output from the ESB
- 4. In this folder ("Window1"), type 'ant undeploy'.
-
+ 4. In this folder ("Window1"), type 'ant undeploy' and then 'ant undeploy-jms-dests'.
+
Load Test Targets
===========================
runtest - Runs the load agent to simulate load and the load reporter to report on load
+runtest-secure - Runs the load agent to simulate load, and the load reporter authenticates to secure http
load-agent - Simulates load only
load-report - Report on load only
Modified: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JmsLoadAgent.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JmsLoadAgent.groovy 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JmsLoadAgent.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -29,6 +29,8 @@
import javax.naming.InitialContext
import javax.naming.NamingException
+import org.jboss.soa.esb.actions.StoreMessageToFile
+
/**
* Simple Groovy load script that will simulate load for a JMS gateway based ESB service call.
*
@@ -124,6 +126,7 @@
QueueSender send = session.createSender(que)
ObjectMessage tm = session.createObjectMessage(new File(agentBean.payload).text)
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "LoadGeneratorTest.log");
1.upto(agentBean.msgCount)
{
send.send(tm)
Modified: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -43,7 +43,7 @@
class LoadReport
{
- LoadUtil util = new LoadUtil()
+ LoadUtil util
def loadConfigFile
InitialContext ctx
MBeanServerConnection server
@@ -52,11 +52,13 @@
def svcReportLog
def queueReportLog
- LoadReport(aLoadConfigFile)
+ LoadReport(aLoadConfigFile, user, password)
{
loadConfigFile = aLoadConfigFile
ctx = new InitialContext(); // From jndi.properties
server = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor")
+ util = new LoadUtil(user, password)
+ println "USER=$user PASSWORD=$password"
}
public generateMetrics()
@@ -169,7 +171,12 @@
static void main(args)
{
- LoadReport reporter = new LoadReport(args[0])
+ LoadReport reporter = null
+ if (args.size() == 3) {
+ reporter = new LoadReport(args[0], args[1], args[2])
+ } else {
+ reporter = new LoadReport(args[0], null, null)
+ }
reporter.generateMetrics()
}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadUtil.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadUtil.groovy 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadUtil.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -3,6 +3,8 @@
import javax.naming.InitialContext
import javax.naming.NamingException
+import org.jboss.soa.esb.samples.quickstart.jmx.*;
+
/**
* Simple Groovy load script that will provide TPS statistics for a ESB service call and JMS Queues.
*
@@ -13,22 +15,38 @@
{
InitialContext ctx
MBeanServerConnection server
+ String user
+ String password
public LoadUtil()
{
- initContext()
+ user = null
+ password = null
}
-
- private initContext()
+
+ public LoadUtil(f_user, f_password)
{
- ctx = new InitialContext(); // From jndi.properties
- server = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor")
- }
+ user = f_user
+ password = f_password
+ }
+ public Long getLongAttribute (ObjectName on, String an) {
+ Long val = null
+ JMXAttributeFinder jf = new JMXAttributeFinder(user, password)
+ val = (Long) jf.query(on, an)
+ return val
+ }
+
+ public Integer getIntegerAttribute (ObjectName on, String an) {
+ Integer val = null
+ JMXAttributeFinder jf = new JMXAttributeFinder(user, password)
+ val = (Integer) jf.query(on, an)
+ }
+
public float getEsbServiceTps(serviceReportBean)
{
def serviceMessageCount = {
- server.getAttribute(new ObjectName("jboss.esb:service-name=$serviceReportBean.serviceName,deployment=$serviceReportBean.esbArchiveName,category=MessageCounter"), "overall service message count").toLong()
+ getLongAttribute(new ObjectName("jboss.esb:service-name=$serviceReportBean.serviceName,deployment=$serviceReportBean.esbArchiveName,category=MessageCounter"), "overall service message count")
}
def processedMsgsBefore = serviceMessageCount()
@@ -55,9 +73,9 @@
def queueDepthCount = {
def temp = 0
try {
- temp = server.getAttribute(new ObjectName("$queue"), "QueueDepth").toLong()
+ temp = getLongAttribute(new ObjectName("$queue"), "QueueDepth")
} catch (javax.management.AttributeNotFoundException e) {
- temp = server.getAttribute(new ObjectName("$queue"), "MessageCount").toInteger()
+ temp = getIntegerAttribute(new ObjectName("$queue"), "MessageCount")
}
if (temp == null) {
return 0
Copied: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/JMXAttributeFinder.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/JMXAttributeFinder.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/JMXAttributeFinder.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,127 +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.samples.quickstart.jmx;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Properties;
-
-import javax.management.AttributeNotFoundException;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.login.LoginContext;
-import javax.security.auth.login.LoginException;
-
-/**
- * Facade for querying JMX. If user and password have a value other than null,
- * try to authenticate to secure HTTP before querying JMX.
- *
- * @author <a href="tcunning at redhat.com">Tom Cunningham</a>
- */
-public class JMXAttributeFinder {
-
- LoginContext loginContext = null;
- String user;
- String password;
-
- public JMXAttributeFinder() {
- user = null;
- password = null;
- }
-
- public JMXAttributeFinder(String f_user, String f_password) {
- user = f_user;
- password = f_password;
- }
-
- public String getResourceURL(String resource) throws MalformedURLException {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- URL resURL = loader.getResource(resource);
- return resURL != null ? resURL.toString() : null;
- }
-
- public void login() {
- if ((user != null) && (password != null)) {
- try {
- CallbackHandler handler = new LGCallbackHandler(user,password);
- String authConf = getResourceURL("auth.conf");
- System.setProperty("java.security.auth.login.config", authConf);
- LoginContext loginContext = new LoginContext("jboss_jaas", handler);
- loginContext.login();
- } catch (Exception e) {
- }
- }
- }
-
- public Object query(ObjectName oname, String attname) throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException, IOException {
- Object att = null;
- login();
- Properties env = new Properties();
- String url = new String("http://localhost:8080/invoker/JNDIFactory");
- env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
- env.setProperty(Context.PROVIDER_URL,url);
- env.setProperty("java.naming.factory.url.pkgs","org.jboss.naming.client");
- Context ctx;
- MBeanServerConnection server = null;
- try {
- ctx = new InitialContext(env);
- server = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");
- } catch (NamingException e1) {
- e1.printStackTrace();
- }
-
- att = server.getAttribute(oname, attname);
-
- try {
- logout();
- } catch (LoginException e) {
- e.printStackTrace();
- }
- return att;
- }
-
- public void logout() throws LoginException {
- if (loginContext != null) {
- loginContext.logout();
- }
- }
-
- public static void main (String args[]) {
- try {
- JMXAttributeFinder t = new JMXAttributeFinder();
- Object val = t.query(new ObjectName("jboss.esb:gateway-name=JMS-Gateway"), "LifeCycleState");
- System.out.println(val);
- t.logout();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/JMXAttributeFinder.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/JMXAttributeFinder.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/JMXAttributeFinder.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/JMXAttributeFinder.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,127 @@
+/*
+* 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.samples.quickstart.jmx;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Properties;
+
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
+
+/**
+ * Facade for querying JMX. If user and password have a value other than null,
+ * try to authenticate to secure HTTP before querying JMX.
+ *
+ * @author <a href="tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class JMXAttributeFinder {
+
+ LoginContext loginContext = null;
+ String user;
+ String password;
+
+ public JMXAttributeFinder() {
+ user = null;
+ password = null;
+ }
+
+ public JMXAttributeFinder(String f_user, String f_password) {
+ user = f_user;
+ password = f_password;
+ }
+
+ public String getResourceURL(String resource) throws MalformedURLException {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ URL resURL = loader.getResource(resource);
+ return resURL != null ? resURL.toString() : null;
+ }
+
+ public void login() {
+ if ((user != null) && (password != null)) {
+ try {
+ CallbackHandler handler = new LGCallbackHandler(user,password);
+ String authConf = getResourceURL("auth.conf");
+ System.setProperty("java.security.auth.login.config", authConf);
+ LoginContext loginContext = new LoginContext("jboss_jaas", handler);
+ loginContext.login();
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ public Object query(ObjectName oname, String attname) throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException, IOException {
+ Object att = null;
+ login();
+ Properties env = new Properties();
+ String url = new String("http://localhost:8080/invoker/JNDIFactory");
+ env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
+ env.setProperty(Context.PROVIDER_URL,url);
+ env.setProperty("java.naming.factory.url.pkgs","org.jboss.naming.client");
+ Context ctx;
+ MBeanServerConnection server = null;
+ try {
+ ctx = new InitialContext(env);
+ server = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");
+ } catch (NamingException e1) {
+ e1.printStackTrace();
+ }
+
+ att = server.getAttribute(oname, attname);
+
+ try {
+ logout();
+ } catch (LoginException e) {
+ e.printStackTrace();
+ }
+ return att;
+ }
+
+ public void logout() throws LoginException {
+ if (loginContext != null) {
+ loginContext.logout();
+ }
+ }
+
+ public static void main (String args[]) {
+ try {
+ JMXAttributeFinder t = new JMXAttributeFinder();
+ Object val = t.query(new ObjectName("jboss.esb:gateway-name=JMS-Gateway"), "LifeCycleState");
+ System.out.println(val);
+ t.logout();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/LGCallbackHandler.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/LGCallbackHandler.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/LGCallbackHandler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,56 +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.samples.quickstart.jmx;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-/**
- * Simple callback class for load_generator.
- *
- * @author <a href="tcunning at redhat.com">Tom Cunningham</a>
- */
-public class LGCallbackHandler implements CallbackHandler {
- String username;
- String password;
-
- public LGCallbackHandler (String username, String password) {
- this.username = username;
- this.password = password;
- }
-
- public void handle(Callback[] callbacks) throws java.io.IOException, UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- Callback callback = callbacks[i];
- if (callback instanceof NameCallback) {
- ((NameCallback) callback).setName(username);
- } else if (callback instanceof PasswordCallback) {
- ((PasswordCallback) callback).setPassword(password.toCharArray());
- } else {
- throw new UnsupportedCallbackException(callback, "Unsupported Callback");
- }
- }
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/LGCallbackHandler.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/LGCallbackHandler.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/LGCallbackHandler.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/jmx/LGCallbackHandler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,56 @@
+/*
+* 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.samples.quickstart.jmx;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+/**
+ * Simple callback class for load_generator.
+ *
+ * @author <a href="tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class LGCallbackHandler implements CallbackHandler {
+ String username;
+ String password;
+
+ public LGCallbackHandler (String username, String password) {
+ this.username = username;
+ this.password = password;
+ }
+
+ public void handle(Callback[] callbacks) throws java.io.IOException, UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ Callback callback = callbacks[i];
+ if (callback instanceof NameCallback) {
+ ((NameCallback) callback).setName(username);
+ } else if (callback instanceof PasswordCallback) {
+ ((PasswordCallback) callback).setPassword(password.toCharArray());
+ } else {
+ throw new UnsupportedCallbackException(callback, "Unsupported Callback");
+ }
+ }
+ }
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/messagefilter/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/messagefilter/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/messagefilter/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -70,12 +70,13 @@
<action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
<property name="notification-details">
- <NotificationList type="OK">
- <target class="NotifyConsole" />
- </NotificationList>
- </property>
- </action>
- </actions>
+ <NotificationList type="OK">
+ <target class="NotifyConsole" />
+ </NotificationList>
+ </property>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+ </actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/messagefilter/src/org/jboss/soa/esb/samples/quickstart/messagefilter/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/messagefilter/src/org/jboss/soa/esb/samples/quickstart/messagefilter/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/messagefilter/src/org/jboss/soa/esb/samples/quickstart/messagefilter/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -32,6 +32,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
import org.jboss.soa.esb.samples.quickstart.messagefilter.Order;
public class SendJMSMessage {
@@ -63,6 +65,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "MessageFilterTest.log");
send.send(tm);
send.close();
}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/messagestore/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/messagestore/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/messagestore/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -47,7 +47,10 @@
<target class="NotifyConsole" />
</NotificationList>
</property>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logSuccess" value="true"/>
+ </action>
<!-- Check that the message is really there (executes on success of pipeline) -->
<action name="CheckMessageStore" class="org.jboss.soa.esb.samples.quickstart.messagestore.CheckMessageStoreAction" />
<!-- Add a copy of the message to the message store under categorization 'test' -->
Modified: labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -28,6 +28,8 @@
<action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
<property name="script" value="/scripts/iTunesTop5.groovy" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+
</actions>
</service>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/MyScheduledActionMsgComposer.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/MyScheduledActionMsgComposer.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/MyScheduledActionMsgComposer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -28,6 +28,8 @@
import org.jboss.soa.esb.message.format.MessageType;
import org.jboss.soa.esb.schedule.SchedulingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class MyScheduledActionMsgComposer implements ScheduledEventMessageComposer {
public void initialize(ConfigTree config) throws ConfigurationException {
System.out.println("** initialize: " + config);
@@ -41,6 +43,7 @@
System.out.println("compose a message");
Message myMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
myMessage.getBody().add("Hello Scheduled World");
+ myMessage.getProperties().setProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "ScheduledServices.log");
return myMessage;
}
@@ -48,4 +51,4 @@
System.out.println("onProcessingComplete");
return message;
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/test/SendEsbMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/test/SendEsbMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -35,9 +35,25 @@
*/
public class SendEsbMessage
{
+ public SendEsbMessage() {
+ }
+
+ public void sendMessage(String category, String serviceName, String msgText) {
+ System.out.println("Inbound Data: " + msgText);
+ try {
+ ServiceInvoker invoker = new ServiceInvoker(category,serviceName);
+ Message requestMessage;
+ requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+ requestMessage.getBody().add(msgText);
+ invoker.deliverAsync(requestMessage); // no waiting for a response
+ } catch (Exception e) {
+ System.out.println("Exception caught by client: " + e);
+ }
+ }
+
public static void main(String args[]) throws Exception
{
-// Setting the ConnectionFactory such that it will use scout
+ // Setting the ConnectionFactory such that it will use scout
System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
@@ -55,17 +71,8 @@
if (args[2] != null && !args[2].equals(""))
msgText = args[2];
- System.out.println("Inbound Data: " + msgText);
-
- ServiceInvoker invoker = new ServiceInvoker(category,serviceName);
- Message requestMessage;
- requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
- requestMessage.getBody().add(msgText);
- try {
- invoker.deliverAsync(requestMessage); // no waiting for a response
- } catch (Exception e) {
- System.out.println("Exception caught by client: " + e);
- }
+ SendEsbMessage sem = new SendEsbMessage();
+ sem.sendMessage(category, serviceName, msgText);
}
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -5,7 +5,7 @@
${line.separator}
</description>
- <property name="additional.deploys" value="scripts/**" />
+ <property name="additional.deploys" value="scripts/**, rss.xml" />
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
@@ -13,8 +13,8 @@
<!-- Target for injecting the sample order message for transformation... -->
<target name="runtest" description="sends a JMS message to the ESB" depends="compile">
<echo>Runs Test JMS Sender</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.scriptinggroovy.test.SendJMSMessage" failonerror="true">
- <arg value="Goodbye World"/>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.scriptinggroovy.test.SendJMSMessage" failonerror="true">
+ <arg value="Goodbye World"/>
<classpath refid="exec-classpath" />
</java>
</target>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -51,7 +51,7 @@
<property name="script" value="/scripts/messagePlay.groovy" />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/rss.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/scripting_groovy/rss.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/rss.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/rss.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,506 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rss version="2.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:itms="http://phobos.apple.com/rss/1.0/modules/itms/">
+
+ <channel>
+ <title>iTunes Top 10 Albums</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewTop?id=1&popId=11</link>
+ <description>iTunes Store: Today's Top 10 Albums</description>
+ <language>en</language>
+ <copyright>Copyright 2007 Apple Inc.
+
+ </copyright>
+ <lastBuildDate>Tue 11 Dec 2007 09:42:27 -800</lastBuildDate>
+ <generator>iTunes Music Store RSS v1.0.0</generator>
+ <webMaster>musicstore at apple.com</webMaster>
+ <ttl>240</ttl>
+
+ <dc:creator>iTunes Music Store</dc:creator>
+ <dc:date>Tue 11 Dec 2007 09:42:27 -800</dc:date>
+
+ <sy:updatePeriod>hourly</sy:updatePeriod>
+ <sy:updateFrequency>1</sy:updateFrequency>
+ <sy:updateBase>2003-09-01T12:00+00:00</sy:updateBase>
+ <image>
+ <url>/images/rss/badge.gif</url>
+ <link>http://www.apple.com/itunes/</link>
+ <title>iTunes Music Store</title>
+ <height>31</height>
+ <width>88</width>
+ </image>
+ <item>
+ <title>1. Noel - Josh Groban</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=265018283&s=143441</link>
+ <description>Noel by Josh Groban</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=265018283&s=143441"><img border="0" src="http://a1.phobos.apple.com/r40/Music/8b/2a/c0/mzi.nbdwbhvc.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=265018283&s=143441">Noel</a></B><br>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=170344">Josh Groban</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ October 08, 2007<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 13</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=8">Holiday</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $11.99</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ 2007 Reprise Records for the U.S. and WEA International Inc. for the world outside the U.S.</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=8">Holiday</category>
+ <itms:artist>Josh Groban</itms:artist>
+ <itms:artistLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=170344</itms:artistLink>
+ <itms:album>Noel</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=265018283&s=143441</itms:albumLink>
+ <itms:albumPrice>$11.99</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r40/Music/8b/2a/c0/mzi.nbdwbhvc.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r40/Music/8b/2a/c0/mzi.nbdwbhvc.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r40/Music/8b/2a/c0/mzi.nbdwbhvc.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>1</itms:rank>
+
+ <itms:rights>2007 Reprise Records for the U.S. and WEA International Inc. for the world outside the U.S.</itms:rights>
+
+ <itms:releasedate>October 08, 2007</itms:releasedate>
+
+
+
+
+</item>
+<item>
+ <title>2. Let It Snow! - EP - Michael Bublé</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=3702036&s=143441</link>
+ <description>Let It Snow! - EP by Michael Bublé</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=3702036&s=143441"><img border="0" src="http://a1.phobos.apple.com/r10/Music/10/b8/dc/mzi.pwnperzv.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=3702036&s=143441">Let It Snow! - EP</a></B><br>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=799597">Michael Bublé</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ November 25, 2003<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 5</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=8">Holiday</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $4.95</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ 2003 Reprise Records for the U.S. and WEA International Inc. for the world outside the U.S.</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=8">Holiday</category>
+ <itms:artist>Michael Bublé</itms:artist>
+ <itms:artistLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=799597</itms:artistLink>
+ <itms:album>Let It Snow! - EP</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=3702036&s=143441</itms:albumLink>
+ <itms:albumPrice>$4.95</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r10/Music/10/b8/dc/mzi.pwnperzv.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r10/Music/10/b8/dc/mzi.pwnperzv.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r10/Music/10/b8/dc/mzi.pwnperzv.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>2</itms:rank>
+
+ <itms:rights>2003 Reprise Records for the U.S. and WEA International Inc. for the world outside the U.S.</itms:rights>
+
+ <itms:releasedate>November 25, 2003</itms:releasedate>
+
+
+
+
+</item>
+<item>
+ <title>3. Christmas #1's - Various Artists</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=264323152&s=143441</link>
+ <description>Christmas #1's by Various Artists</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=264323152&s=143441"><img border="0" src="http://a1.phobos.apple.com/r40/Music/f9/95/c3/mzi.vqltipvv.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=264323152&s=143441">Christmas #1's</a></B><br>
+ <a>Various Artists</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ September 25, 2007<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 17</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=8">Holiday</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $7.99</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ 2007 Hip-O Records</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=8">Holiday</category>
+ <itms:artist>Various Artists</itms:artist>
+ <itms:artistLink></itms:artistLink>
+ <itms:album>Christmas #1's</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=264323152&s=143441</itms:albumLink>
+ <itms:albumPrice>$7.99</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r40/Music/f9/95/c3/mzi.vqltipvv.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r40/Music/f9/95/c3/mzi.vqltipvv.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r40/Music/f9/95/c3/mzi.vqltipvv.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>3</itms:rank>
+
+ <itms:rights>2007 Hip-O Records</itms:rights>
+
+ <itms:releasedate>September 25, 2007</itms:releasedate>
+
+
+
+
+</item>
+<item>
+ <title>4. Dreaming Out Loud (Bonus Track Version) - OneRepublic</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268315415&s=143441</link>
+ <description>Dreaming Out Loud (Bonus Track Version) by OneRepublic</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268315415&s=143441"><img border="0" src="http://a1.phobos.apple.com/r40/Music/21/c3/21/mzi.usuihfgn.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268315415&s=143441">Dreaming Out Loud (Bonus Track Version)</a></B><br>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=260414340">OneRepublic</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ November 20, 2007<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 16</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=21">Rock</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $7.99</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ 2007 Mosley Music/Interscope Records</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=21">Rock</category>
+ <itms:artist>OneRepublic</itms:artist>
+ <itms:artistLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=260414340</itms:artistLink>
+ <itms:album>Dreaming Out Loud (Bonus Track Version)</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268315415&s=143441</itms:albumLink>
+ <itms:albumPrice>$7.99</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r40/Music/21/c3/21/mzi.usuihfgn.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r40/Music/21/c3/21/mzi.usuihfgn.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r40/Music/21/c3/21/mzi.usuihfgn.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>4</itms:rank>
+
+ <itms:rights>2007 Mosley Music/Interscope Records</itms:rights>
+
+ <itms:releasedate>November 20, 2007</itms:releasedate>
+
+
+
+
+</item>
+<item>
+ <title>5. As I Am - Alicia Keys</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=267757640&s=143441</link>
+ <description>As I Am by Alicia Keys</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=267757640&s=143441"><img border="0" src="http://a1.phobos.apple.com/r40/Music/39/c6/1f/mzi.vjkojdvm.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=267757640&s=143441">As I Am</a></B><br>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=316069">Alicia Keys</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ November 13, 2007<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 14</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=15">R&B/Soul</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $9.99</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ 2007 J Records, a unit of SONY BMG MUSIC ENTERTAINMENT (C) 2007 J Records, a unit of SONY BMG MUSIC ENTERTAINMENT</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=15">R&B/Soul</category>
+ <itms:artist>Alicia Keys</itms:artist>
+ <itms:artistLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=316069</itms:artistLink>
+ <itms:album>As I Am</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=267757640&s=143441</itms:albumLink>
+ <itms:albumPrice>$9.99</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r40/Music/39/c6/1f/mzi.vjkojdvm.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r40/Music/39/c6/1f/mzi.vjkojdvm.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r40/Music/39/c6/1f/mzi.vjkojdvm.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>5</itms:rank>
+
+ <itms:rights>2007 J Records, a unit of SONY BMG MUSIC ENTERTAINMENT (C) 2007 J Records, a unit of SONY BMG MUSIC ENTERTAINMENT</itms:rights>
+
+ <itms:releasedate>November 13, 2007</itms:releasedate>
+
+
+
+
+</item>
+<item>
+ <title>6. Audio Day Dream - Blake Lewis</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268633477&s=143441</link>
+ <description>Audio Day Dream by Blake Lewis</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268633477&s=143441"><img border="0" src="http://a1.phobos.apple.com/r40/Music/01/b1/01/mzi.hmygpgxu.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268633477&s=143441">Audio Day Dream</a></B><br>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=256088329">Blake Lewis</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ December 04, 2007<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 17</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=14">Pop</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $9.99</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ 2007 19 Recordings Limited (C) 2007 Arista Records LLC, a unit of SONY BMG MUSIC ENTERTAINMENT</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=14">Pop</category>
+ <itms:artist>Blake Lewis</itms:artist>
+ <itms:artistLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=256088329</itms:artistLink>
+ <itms:album>Audio Day Dream</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268633477&s=143441</itms:albumLink>
+ <itms:albumPrice>$9.99</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r40/Music/01/b1/01/mzi.hmygpgxu.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r40/Music/01/b1/01/mzi.hmygpgxu.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r40/Music/01/b1/01/mzi.hmygpgxu.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>6</itms:rank>
+
+ <itms:rights>2007 19 Recordings Limited (C) 2007 Arista Records LLC, a unit of SONY BMG MUSIC ENTERTAINMENT</itms:rights>
+
+ <itms:releasedate>December 04, 2007</itms:releasedate>
+
+
+
+
+</item>
+<item>
+ <title>7. Carnival, Vol. II: Memoirs of an Immigrant (Deluxe Edition) - Wyclef Jean</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268624944&s=143441</link>
+ <description>Carnival, Vol. II: Memoirs of an Immigrant (Deluxe Edition) by Wyclef Jean</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268624944&s=143441"><img border="0" src="http://a1.phobos.apple.com/r40/Music/ba/b9/86/mzi.prmponcf.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268624944&s=143441">Carnival, Vol. II: Memoirs of an Immigrant (Deluxe Edition)</a></B><br>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=14154">Wyclef Jean</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ December 04, 2007<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 23</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=18">Hip-Hop/Rap</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $13.99</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ 2007 Manoukian Music, Carnival House Records/JH Music, Inc., SONY BMG MUSIC ENTERTAINMENT (c) 2007 SONY BMG MUSIC ENTERTAINMENT</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=18">Hip-Hop/Rap</category>
+ <itms:artist>Wyclef Jean</itms:artist>
+ <itms:artistLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=14154</itms:artistLink>
+ <itms:album>Carnival, Vol. II: Memoirs of an Immigrant (Deluxe Edition)</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=268624944&s=143441</itms:albumLink>
+ <itms:albumPrice>$13.99</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r40/Music/ba/b9/86/mzi.prmponcf.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r40/Music/ba/b9/86/mzi.prmponcf.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r40/Music/ba/b9/86/mzi.prmponcf.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>7</itms:rank>
+
+ <itms:rights>2007 Manoukian Music, Carnival House Records/JH Music, Inc., SONY BMG MUSIC ENTERTAINMENT (c) 2007 SONY BMG MUSIC ENTERTAINMENT</itms:rights>
+
+ <itms:releasedate>December 04, 2007</itms:releasedate>
+
+
+
+
+</item>
+<item>
+ <title>8. Christmas With the Rat Pack - Dean Martin, Frank Sinatra & Sammy Davis, Jr.</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=184447981&s=143441</link>
+ <description>Christmas With the Rat Pack by Dean Martin, Frank Sinatra & Sammy Davis, Jr.</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=184447981&s=143441"><img border="0" src="http://a1.phobos.apple.com/r10/Music/1f/2e/8d/mzi.xtxsezak.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=184447981&s=143441">Christmas With the Rat Pack</a></B><br>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=266028">Dean Martin, Frank Sinatra & Sammy Davis, Jr.</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ September 12, 2006<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 21</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=8">Holiday</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $7.99</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ Compilation (P) (C) 2002 Capitol Records, Inc.. All rights reserved. Unauthorized reproduction is a violation of applicable laws.</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=8">Holiday</category>
+ <itms:artist>Dean Martin, Frank Sinatra & Sammy Davis, Jr.</itms:artist>
+ <itms:artistLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=266028</itms:artistLink>
+ <itms:album>Christmas With the Rat Pack</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=184447981&s=143441</itms:albumLink>
+ <itms:albumPrice>$7.99</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r10/Music/1f/2e/8d/mzi.xtxsezak.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r10/Music/1f/2e/8d/mzi.xtxsezak.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r10/Music/1f/2e/8d/mzi.xtxsezak.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>8</itms:rank>
+
+ <itms:rights>Compilation (P) (C) 2002 Capitol Records, Inc.. All rights reserved. Unauthorized reproduction is a violation of applicable laws.</itms:rights>
+
+ <itms:releasedate>September 12, 2006</itms:releasedate>
+
+
+
+
+</item>
+<item>
+ <title>9. A Charlie Brown Christmas (Remastered) - Vince Guaraldi Trio</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=197151313&s=143441</link>
+ <description>A Charlie Brown Christmas (Remastered) by Vince Guaraldi Trio</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=197151313&s=143441"><img border="0" src="http://a1.phobos.apple.com/r10/Music/e8/43/2b/mzi.dylmkhav.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=197151313&s=143441">A Charlie Brown Christmas (Remastered)</a></B><br>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=2084011">Vince Guaraldi Trio</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ October 10, 2006<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 16</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=16">Soundtrack</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $7.99</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ 2006 Concord Music Group, Inc.</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=16">Soundtrack</category>
+ <itms:artist>Vince Guaraldi Trio</itms:artist>
+ <itms:artistLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=2084011</itms:artistLink>
+ <itms:album>A Charlie Brown Christmas (Remastered)</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=197151313&s=143441</itms:albumLink>
+ <itms:albumPrice>$7.99</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r10/Music/e8/43/2b/mzi.dylmkhav.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r10/Music/e8/43/2b/mzi.dylmkhav.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r10/Music/e8/43/2b/mzi.dylmkhav.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>9</itms:rank>
+
+ <itms:rights>2006 Concord Music Group, Inc.</itms:rights>
+
+ <itms:releasedate>October 10, 2006</itms:releasedate>
+
+
+
+
+</item>
+<item>
+ <title>10. August Rush (Music from the Motion Picture) - Various Artists</title>
+ <link>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=267884371&s=143441</link>
+ <description>August Rush (Music from the Motion Picture) by Various Artists</description>
+ <pubDate>Tue 11 Dec 2007 09:42:27 -800</pubDate>
+ <content:encoded><![CDATA[<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr valign="top" align="left">
+ <td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=267884371&s=143441"><img border="0" src="http://a1.phobos.apple.com/r40/Music/b1/e0/62/mzi.hhzzrtiz.100x100-75.jpg"></a></td>
+ <td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
+ <td width="95%"><B><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=267884371&s=143441">August Rush (Music from the Motion Picture)</a></B><br>
+ <a>Various Artists</a><br><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
+ November 13, 2007<br>
+ </font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
+ 15</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=16">Soundtrack</a></font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Price:</B>
+ $11.99</font><br>
+ <font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
+ Compilation (P) 2007 SONY BMG MUSIC ENTERTAINMENT (C) 2007 Warner Bros. Entertainment Inc.</font></td>
+ </tr>
+ </table></TD></TR>
+ </TABLE>
+]]></content:encoded>
+ <category domain="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewGenre?id=16">Soundtrack</category>
+ <itms:artist>Various Artists</itms:artist>
+ <itms:artistLink></itms:artistLink>
+ <itms:album>August Rush (Music from the Motion Picture)</itms:album>
+ <itms:albumLink>http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=267884371&s=143441</itms:albumLink>
+ <itms:albumPrice>$11.99</itms:albumPrice>
+
+ <itms:coverArt height="53" width="53">http://a1.phobos.apple.com/r40/Music/b1/e0/62/mzi.hhzzrtiz.53x53-50.jpg</itms:coverArt>
+ <itms:coverArt height="60" width="60">http://a1.phobos.apple.com/r40/Music/b1/e0/62/mzi.hhzzrtiz.60x60-50.jpg</itms:coverArt>
+ <itms:coverArt height="100" width="100">http://a1.phobos.apple.com/r40/Music/b1/e0/62/mzi.hhzzrtiz.100x100-75.jpg</itms:coverArt>
+
+
+ <itms:rank>10</itms:rank>
+
+ <itms:rights>Compilation (P) 2007 SONY BMG MUSIC ENTERTAINMENT (C) 2007 Warner Bros. Entertainment Inc.</itms:rights>
+
+ <itms:releasedate>November 13, 2007</itms:releasedate>
+
+
+
+
+</item>
+
+ </channel>
+</rss>
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/scripts/iTunesTop10.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/scripts/iTunesTop10.groovy 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/scripting_groovy/scripts/iTunesTop10.groovy 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,5 +1,10 @@
-def url='http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wpa/MRSS/topalbums/limit=10/rss.xml'
-def channel = new XmlParser().parse(url).channel[0]
+// You can use the online version of this by uncommenting the URL below,
+// but we are using a static version of this file because of CI errors
+// during testing of this QS.
+// def url='http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wpa/MRSS/topalbums/limit=10/rss.xml'
+def stream=Thread.currentThread().getContextClassLoader().getResourceAsStream("rss.xml")
+
+def channel = new XmlParser().parse(stream).channel[0]
def items = channel.item
println channel.title.text()
Modified: labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -79,6 +79,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="displayMessageAction"
class="org.jboss.soa.esb.samples.quickstart.simplecbr.MyJMSListenerAction"
process="displayMessage"
@@ -104,6 +105,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="displayMessageAction"
class="org.jboss.soa.esb.samples.quickstart.simplecbr.MyJMSListenerAction"
process="displayMessage"
Modified: labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/src/org/jboss/soa/esb/samples/quickstart/simplecbr/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/src/org/jboss/soa/esb/samples/quickstart/simplecbr/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/src/org/jboss/soa/esb/samples/quickstart/simplecbr/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -63,6 +63,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty("jbesbfilename", "SimpleCBRTest.log");
send.send(tm);
send.close();
}
@@ -107,4 +108,4 @@
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -42,7 +42,8 @@
process="sayHelloAopStyle">
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="spring-context.xml"/>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/MySpringEnabledAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/MySpringEnabledAction.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/MySpringEnabledAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -49,7 +49,9 @@
logHeader();
// interceptor will get applied here
// check the console output to see the interceptor changed the message
- hello.setGreeting((String)message.getBody().get());
+ String helloString = (String) message.getBody().get();
+ hello.setGreeting(helloString);
+ message.getBody().add(hello.getGreeting());
logFooter();
return message;
Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -30,6 +30,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
/**
* Send a JMS message that the ESB will listen for.
*
@@ -67,6 +69,7 @@
{
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "SpringAOPTest.log");
send.send(tm);
send.close();
}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -49,12 +49,13 @@
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="spring-context-goodbye.xml"/>
</action>
- <action name="addHelloGoodbye"
+ <action name="addHelloGoodbye"
class="org.jboss.soa.esb.samples.quickstart.spring_helloworld.MySpringEnabledAction"
process="sayHelloSpring,sayGoodbyeSpring,displayMessage">
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="spring-context-goodbye.xml,spring-context-hello.xml"/>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/src/org/jboss/soa/esb/samples/quickstart/spring_helloworld/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/src/org/jboss/soa/esb/samples/quickstart/spring_helloworld/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/src/org/jboss/soa/esb/samples/quickstart/spring_helloworld/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -30,6 +30,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
/**
* Send a JMS message that the ESB will listen for.
*
@@ -66,6 +68,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "SpringHelloWorldTest.log");
send.send(tm);
send.close();
}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -37,12 +37,13 @@
/>
</listeners>
<actions>
- <action name="insertOrderAction"
+ <action name="insertOrderAction"
class="org.jboss.soa.esb.samples.quickstart.spring_jpetstore.InsertOrderAction"
process="insertOrder">
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="applicationContext.xml,dataAccessContext-local.xml"/>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/src/org/jboss/soa/esb/samples/quickstart/spring_jpetstore/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/src/org/jboss/soa/esb/samples/quickstart/spring_jpetstore/test/SendJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/src/org/jboss/soa/esb/samples/quickstart/spring_jpetstore/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -34,6 +34,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
/**
* Send a JMS message that the ESB will listen for.
*
@@ -70,6 +72,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "SpringJPetStoreTest.log");
send.send(tm);
send.close();
}
@@ -114,4 +117,4 @@
sm.stop();
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -64,9 +64,7 @@
<property name="message" value=">>>> Message after Smooks intermediate xml -> target xml : " />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -37,9 +37,7 @@
<property name="message" value="[transform_EDI2XML_Groovy_XSLT] Message after transformation" />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -57,9 +57,7 @@
<property name="message" value=">>>> Message after Smooks intermediate xml -> target pojos : " />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/src/org/jboss/soa/esb/samples/quickstart/transformxml2pojo/test/ReceiveJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/src/org/jboss/soa/esb/samples/quickstart/transformxml2pojo/test/ReceiveJMSMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/src/org/jboss/soa/esb/samples/quickstart/transformxml2pojo/test/ReceiveJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -117,25 +117,25 @@
}
public static void main(String[] args) {
- final ReceiveJMSMessage receiver = new ReceiveJMSMessage();
-
- if ((args.length > 0) && (args[0] != null)) {
- receiver.receiveQueueName = args[0];
- System.out.println("Receiving on: " + receiver.receiveQueueName );
- Runtime.getRuntime().addShutdownHook(new Thread() {
- public void run() {
- receiver.cleanup() ;
- }
- }) ;
- while (true) { // loop until I'm killed
- receiver.receiveOne();
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {break;}
- }
-
- } else {
- System.out.println("Usage <queue-name>");
- }
+ final ReceiveJMSMessage receiver = new ReceiveJMSMessage();
+
+ // check if default queue name is being overridden
+
+ if ((args.length > 0) && (args[0] != null)) {
+ receiver.receiveQueueName = args[0];
+ }
+
+ System.out.println("Receiving on: " + receiver.receiveQueueName );
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ public void run() {
+ receiver.cleanup() ;
+ }
+ }) ;
+ while (true) { // loop until I'm killed
+ receiver.receiveOne();
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {break;}
+ }
}
}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -39,9 +39,7 @@
value="[transform_XML2XML_date_manipulation] Message after transformation"/>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -37,9 +37,7 @@
<property name="message" value="[transform_XML2XML_simple] Message after transformation" />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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!! -->
@@ -52,13 +54,13 @@
</copy>
<!-- Deploy the ActiveBPEL components. -->
- <!--copy overwrite="true" todir="${env.CATALINA_HOME}/bpr">
+ <copy overwrite="true" todir="${env.CATALINA_HOME}/bpr">
<fileset dir="bpel" includes="order_process.bpr" />
<fileset dir="bpel/resources/supportServices/Customer" includes="customer.bpr" />
</copy>
<copy overwrite="true" todir="${env.CATALINA_HOME}/shared/classes">
<fileset dir="bpel/tomcat-configs" includes="*.wsdd" />
- </copy-->
+ </copy>
</target>
<target name="quickstart-specific-undeploys"
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/readme.txt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -5,7 +5,7 @@
It also demonstrates a number of other features of the ESB:
1. Exposing a Webservice interface for a Service that doesn't have a
- Webservice interface (using the JBossWSAdapter action). In this example,
+ Webservice interface (using the SOAPProcessor action). In this example,
the Service being exposed is a legacy EJB based Order Management Service.
2. How to use a jaxb-intros.xml config to "Introduce" JAXB Annotations on a
Java interface/typeset that isn't annotated for use with JAXB and how to
@@ -32,9 +32,13 @@
The ActiveBPEL Engine (v3.1) must now be installed on an instance of Tomcat on your
system. The processes in this Quickstart are pre-built to run on version 3.1 of
the ActiveBPEl Engine. If you are running on a newer version of the ActiveBPEL
- Engine, you may need to redeploy these processes. Version 3.1 of the ActiveBpel Engine
- can be downloaded from:
+ Engine, you may need to redeploy these processes.
+
+ Version 3.1 of the ActiveBpel Engine can be downloaded from:
http://www.active-endpoints.com/active-bpel-engine-download.htm#final31
+
+ ActiveBPEL Installation Guide:
+ http://www.active-endpoints.com/installation-guide.htm
Setting up ActiveBPEL:
1. Ensure that the value of the 'directory' attribute on the
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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... -->
@@ -47,6 +49,15 @@
<delete verbose="true" quiet="true"
file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.war"/>
</target>
+
+ <target name="sendjms" depends="compile">
+ <echo>Send ESB message that triggers webservice call</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendJMSMessage" failonerror="true">
+ <arg value="Jimbo"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+
+ </target>
<target name="runtest" depends="compile">
<echo>Send ESB message that triggers webservice call</echo>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/deployment.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -3,4 +3,5 @@
<depends>jboss.esb:service=SoapUIClientService</depends>
<depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer1_esb</depends>
<depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer1_esb_reply</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer1_Request_gw</depends>
</jbossesb-deployment>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jbm-queue-service.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jbm-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -12,4 +12,10 @@
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
</mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer1_Request_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
</server>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jbmq-queue-service.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jbmq-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -12,4 +12,10 @@
jboss.mq:service=DestinationManager
</depends>
</mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer1_Request_gw">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
</server>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -8,10 +8,18 @@
connection-factory="ConnectionFactory"
jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
jndi-URL="localhost">
- <jms-bus busid="quickstartEsbChannel">
+ <jms-bus busid="quickstartGwChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_webservice_consumer1_Request_gw"
+ />
+ </jms-bus>
+
+ <jms-bus busid="quickstartEsbChannel">
<jms-message-filter dest-type="QUEUE"
dest-name="queue/quickstart_webservice_consumer1_esb" />
</jms-bus>
+
</jms-provider>
</providers>
@@ -21,8 +29,14 @@
<listeners>
<jms-listener name="JMS-ESBListener"
busidref="quickstartEsbChannel" maxThreads="1" />
+ <jms-listener name="JMS-Gateway"
+ busidref="quickstartGwChannel"
+ maxThreads="1"
+ is-gateway="true"
+ />
+
</listeners>
- <actions>
+ <actions mep="OneWay">
<action name="request-mapper"
class="org.jboss.soa.esb.samples.quickstart.webservice_consumer1.MyRequestAction">
</action>
@@ -30,13 +44,13 @@
class="org.jboss.soa.esb.actions.soap.SOAPClient">
<property name="wsdl"
value="http://127.0.0.1:8080/Quickstart_webservice_consumer1/HelloWorldWS?wsdl" />
- <property name="operation" value="sayHello" />
<property name="responseAsOgnlMap" value="true" />
<property name="SOAPAction" value="sayHello"/>
</action>
<action name="response-mapper"
class="org.jboss.soa.esb.samples.quickstart.webservice_consumer1.MyResponseAction">
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/MyResponseAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/MyResponseAction.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/MyResponseAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -51,8 +51,7 @@
// The "responseLocation" property was set in jboss-esb.xml to
// "helloworld-response"
- Map responseMsg = (Map) message.getBody()
- .get("helloworld-response");
+ Map responseMsg = (Map) message.getBody().get(Body.DEFAULT_LOCATION);
System.out.println("Response Map is: " + responseMsg);
logFooter();
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -26,13 +26,15 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendEsbMessage
{
/*
* Send a message directly the the ESB internal JMS listener. Demonstrates
* how one can bypass the gateway and speak directly to an ESB service.
*/
- private void sendMessage(String message) throws Exception
+ public void sendMessage(String message) throws Exception
{
// Create the delivery adapter for the target service (cache it)
System.setProperty("javax.xml.registry.ConnectionFactoryClass",
@@ -51,8 +53,7 @@
// Deliver the request message synchronously - timeout after 20
// seconds...
- Message replyMessage = deliveryAdapter.deliverSync(requestMessage, 20000);
-
+ deliveryAdapter.deliverAsync(requestMessage);
}
public static void main(String args[]) throws Exception
Copied: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,86 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer1_Request_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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}" />
@@ -48,6 +50,16 @@
<delete verbose="true" quiet="true"
file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.war"/>
</target>
+
+ <target name="sendjms" depends="compile">
+
+ <echo>Send ESB message that triggers webservice call</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservice_consumer2.test.SendJMSMessage" failonerror="true">
+ <arg value="Jimbo"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
<target name="runtest" depends="compile">
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/deployment.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -3,4 +3,5 @@
<depends>jboss.esb:service=SoapUIClientService</depends>
<depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer2_esb</depends>
<depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer2_esb_reply</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer2_Request_gw</depends>
</jbossesb-deployment>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jbm-queue-service.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jbm-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -12,4 +12,10 @@
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
</mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer2_Request_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
</server>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jbmq-queue-service.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jbmq-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -12,4 +12,10 @@
jboss.mq:service=DestinationManager
</depends>
</mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer2_Request_gw">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
</server>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -8,6 +8,13 @@
connection-factory="ConnectionFactory"
jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
jndi-URL="localhost">
+ <jms-bus busid="quickstartGwChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_webservice_consumer2_Request_gw"
+ />
+ </jms-bus>
+
<jms-bus busid="quickstartEsbChannel">
<jms-message-filter dest-type="QUEUE"
dest-name="queue/quickstart_webservice_consumer2_esb" />
@@ -21,8 +28,13 @@
<listeners>
<jms-listener name="JMS-ESBListener"
busidref="quickstartEsbChannel" maxThreads="1" />
+ <jms-listener name="JMS-Gateway"
+ busidref="quickstartGwChannel"
+ maxThreads="1"
+ is-gateway="true"
+ />
</listeners>
- <actions>
+ <actions mep="OneWay">
<action name="request-mapper"
class="org.jboss.soa.esb.samples.quickstart.webservice_consumer2.MyRequestAction"
process="option1">
@@ -36,7 +48,8 @@
</action>
<action name="response-mapper"
class="org.jboss.soa.esb.samples.quickstart.webservice_consumer2.MyResponseAction">
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/readme.txt 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/readme.txt 2008-03-04 16:24:20 UTC (rev 18679)
@@ -88,8 +88,8 @@
org.jboss.soa.esb.actions.soap.SOAPClient
This class is used to make the call to the webservice. It will take the
- parameters that MyRequestAction set in "paramsLocation", call the webservice, then place
- the response in "responseLocation". This is zero Java code ESB wiring in jboss-esb.xml.
+ parameters that MyRequestAction set in the default location, call the webservice, then place
+ the response in the default location.
src/../MyResponseAction.java
Retrieve the webservice response and display it on the console. The response location name
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendEsbMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendEsbMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -25,6 +25,7 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
public class SendEsbMessage
{
@@ -48,7 +49,7 @@
// Deliver the request message synchronously - timeout after 20
// seconds...
- Message replyMessage = deliveryAdapter.deliverSync(requestMessage, 20000);
+ deliveryAdapter.deliverAsync(requestMessage);
// need to cleanup connection pool for service invoker
//deliveryAdapter.close();
@@ -59,4 +60,4 @@
SendEsbMessage sm = new SendEsbMessage();
sm.sendMessage();
}
-}
\ No newline at end of file
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,88 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer2.test;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put("javax.xml.registry.ConnectionFactoryClass",
+ "org.apache.ws.scout.registry.ConnectionFactoryImpl");
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer2_Request_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/README.html
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/README.html 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/README.html 2008-03-04 16:24:20 UTC (rev 18679)
@@ -19,7 +19,7 @@
JBoss AS 4.2.1.GA. Installation instructions for both can be found in the
install/readme.txt.
<p/>
- <b style="text-decoration: blink; color: red">NOTE:</b> This Quickstart requires the JBossRemoting 2.2.2SP2 patch to be applied.
+ <b style="text-decoration: blink; color: red">NOTE:</b> This Quickstart requires the JBossRemoting 2.2.2SP2 or higher patch to be applied.
This simply involves downloading <a href="http://repository.jboss.org/jboss/remoting/2.2.2.SP2/lib/jboss-remoting.jar">jboss-remoting.jar</a>
and copying it into your "server/<server>/lib" folder. Be sure to restart your JBoss
Application/ESB Server instance.
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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-2.2.2.SP1-plus">
+ <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>
@@ -27,7 +29,6 @@
</war>
</target>
-
<target name="runtest" depends="compile" description="runs test JMS Sender">
<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservicemtom.webservice.client.MTOMClient"
failonerror="true">
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -39,6 +39,7 @@
<property name="message"
value="[Quickstart_webservice_producer] Message after invoking jbossws endpoint"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -35,7 +35,7 @@
public ImageResponse echoImage(ImageRequest request) {
Image image = request.getData();
- System.out.println("*** Recieved Image: " + image);
+ System.out.println("*** Received Image: " + image);
//System.out.println("*** Image attached to ESB Message: " + image);
return new ImageResponse(image);
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -22,7 +22,7 @@
package org.jboss.soa.esb.samples.quickstart.webservicemtom.webservice;
import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/product/samples/quickstarts/webservice_producer/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -49,6 +49,7 @@
<property name="message"
value="[Quickstart_webservice_producer] AFTER invoking jbossws endpoint"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/SendMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/SendMessage.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/SendMessage.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -35,6 +35,8 @@
import javax.naming.NamingException;
import java.net.InetAddress;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendMessage {
QueueConnection conn;
QueueSession session;
@@ -49,6 +51,7 @@
sender = session.createSender(que);
tm = session.createObjectMessage(message);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "WebServiceProducerTest.log");
sender.send(tm);
} finally {
if(sender != null) {
@@ -114,4 +117,4 @@
sm.sendMessageToJBRListener(protocol, Integer.parseInt(args[1]), msg);
}
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/README.html
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/README.html 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/README.html 2008-03-04 16:24:20 UTC (rev 18679)
@@ -24,7 +24,7 @@
JBoss AS 4.2.1.GA. Installation instructions for both can be found in the
install/readme.txt.
<p/>
- <b style="text-decoration: blink; color: red">NOTE:</b> This Quickstart requires the JBossRemoting 2.2.2SP2 patch to be applied.
+ <b style="text-decoration: blink; color: red">NOTE:</b> This Quickstart requires the JBossRemoting 2.2.2SP2 or higher patch to be applied.
This simply involves downloading <a href="http://repository.jboss.org/jboss/remoting/2.2.2.SP2/lib/jboss-remoting.jar">jboss-remoting.jar</a>
and copying it into your "server/<server>/lib" folder. Be sure to restart your JBoss
Application/ESB Server instance.
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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-2.2.2.SP1-plus">
+ <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/trunk/product/samples/quickstarts/webservice_wsaddressing/src/org/jboss/soa/esb/samples/quickstart/webservicewsa/ServerHandler.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/src/org/jboss/soa/esb/samples/quickstart/webservicewsa/ServerHandler.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/src/org/jboss/soa/esb/samples/quickstart/webservicewsa/ServerHandler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -34,8 +34,8 @@
import javax.xml.ws.handler.MessageContext.Scope;
import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.jaxws.handler.GenericSOAPHandler;
-import org.jboss.wsf.spi.utils.DOMUtils;
+import org.jboss.util.xml.DOMUtils;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
/**
* A server side handler for the ws-addressing
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/src/org/jboss/soa/esb/samples/quickstart/webservicewsa/client/ClientHandler.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/src/org/jboss/soa/esb/samples/quickstart/webservicewsa/client/ClientHandler.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsaddressing/src/org/jboss/soa/esb/samples/quickstart/webservicewsa/client/ClientHandler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -36,9 +36,9 @@
import javax.xml.ws.handler.MessageContext.Scope;
import org.jboss.logging.Logger;
+import org.jboss.util.xml.DOMUtils;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
import org.jboss.ws.core.utils.UUIDGenerator;
-import org.jboss.wsf.spi.jaxws.handler.GenericSOAPHandler;
-import org.jboss.wsf.spi.utils.DOMUtils;
import org.jboss.soa.esb.samples.quickstart.webservicewsa.StatefulEndpointImpl;
/**
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wssecurity/README.html
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wssecurity/README.html 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wssecurity/README.html 2008-03-04 16:24:20 UTC (rev 18679)
@@ -19,7 +19,7 @@
JBoss AS 4.2.1.GA. Installation instructions for both can be found in the
install/readme.txt.
<p/>
- <b style="text-decoration: blink; color: red">NOTE:</b> This Quickstart requires the JBossRemoting 2.2.2SP2 patch to be applied.
+ <b style="text-decoration: blink; color: red">NOTE:</b> This Quickstart requires the JBossRemoting 2.2.2SP2 or higher patch to be applied.
This simply involves downloading <a href="http://repository.jboss.org/jboss/remoting/2.2.2.SP2/lib/jboss-remoting.jar">jboss-remoting.jar</a>
and copying it into your "server/<server>/lib" folder. Be sure to restart your JBoss
Application/ESB Server instance.
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wssecurity/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wssecurity/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wssecurity/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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-2.2.2.SP1-plus">
+ <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/trunk/product/samples/quickstarts/wiretap/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/wiretap/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/quickstarts/wiretap/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -80,7 +80,7 @@
</property>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore" />
</actions>
</service>
@@ -103,7 +103,7 @@
</NotificationList>
</property>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore" />
</actions>
</service>
Modified: labs/jbossesb/trunk/product/samples/trailblazer/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/trailblazer/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -6,8 +6,6 @@
<property name="install.dir" value="${esb.home.dir}/install"/>
<property file="${install.dir}/deployment.properties"/>
- <property name="org.jboss.esb.server.home" value="/jboss-4.2.0.GA"/>
- <property name="org.jboss.esb.server.config" value="default"/>
<property name="trailblazer.dir" value="."/>
<!-- properties for the esb part of the trailblazer -->
@@ -39,38 +37,68 @@
<property environment="env" />
<property name="esb.lib.file" value="jbossesb-rosetta.jar"/>
- <property name="soa.esb.lib.dist.dir" value="${esb.home.dir}/lib"/>
+ <property name="soa.esb.lib.dist.dir" value="${esb.home.dir}/../../lib"/>
<property name="soa.esb.lib.src.dir" value="../../build/jbossesb/lib"/>
+ <property name="esb.default.dir" value="../../server/default"/>
+ <property name="esb.sar.lib.dir" value="${esb.default.dir}/deploy/jbossesb.sar/lib"/>
+ <!-- Path to server -->
+ <available file="jbossws.sar"
+ filepath="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy"
+ property="soa.esb.config.dir"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}"/>
+
+ <available file="jbossws.sar"
+ filepath="${esb.default.dir}/deploy"
+ property="soa.esb.config.dir"
+ value="${esb.default.dir}"/>
+
+ <!-- Path to ESB libs -->
<available file="${esb.lib.file}"
- filepath="${soa.esb.lib.dist.dir}"
- property="soa.esb.lib.dir"
- value="${soa.esb.lib.dist.dir}"/>
+ filepath="${soa.esb.config.dir}/deploy/jbossesb.sar/lib"
+ property="soa.esb.lib.dir"
+ value="${soa.esb.config.dir}/deploy/jbossesb.sar/lib"/>
- <available file="${esb.lib.file}"
+ <!-- Path to log4j.jar -->
+ <available file="client"
+ filepath="${org.jboss.esb.server.home}"
+ property="log4j.lib.dir"
+ value="${org.jboss.esb.server.home}/client"/>
+
+ <available file="log4j.jar"
+ filepath="${soa.esb.lib.dist.dir}/ext"
+ property="log4j.lib.dir"
+ value="${soa.esb.lib.dist.dir}/ext"/>
+
+ <!-- Path to testutil.jar -->
+ <available file="test-util.jar"
filepath="${soa.esb.lib.src.dir}"
- property="soa.esb.lib.dir"
+ property="test.util.dir"
value="${soa.esb.lib.src.dir}"/>
- <property name="soa.esb.lib.ext.dir" value="${soa.esb.lib.dir}/ext"/>
+ <available file="test-util.jar"
+ filepath="${trailblazer.dir}/esb/lib/ext"
+ property="test.util.dir"
+ value="${trailblazer.dir}/esb/lib/ext"/>
<!-- classpath -->
<path id="esb.samples.trailblazer.esb.classpath">
- <fileset dir="${soa.esb.lib.dir}/ext" includes="*.jar"/>
+ <fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
<fileset dir="${esb.lib.dir}/ext" includes="*.jar"/>
- <fileset dir="${org.jboss.esb.server.home}/client" includes="jbossall-client.jar jbossws-client.jar mail.jar"/>
- <fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
+ <fileset dir="${soa.esb.config.dir}/lib" includes="mail.jar antlr.jar"/>
<fileset dir="${esb.samples.trailblazer.client.lib.dir}/ext" includes="*.jar"/>
+ <fileset dir="${test.util.dir}" includes="test-util.jar"/>
+ <fileset dir="${log4j.lib.dir}" includes="log4j.jar"/>
</path>
<!-- classpath for running the listener-->
<path id="esb.samples.trailblazer.esb.classpath.run">
- <fileset dir="${soa.esb.lib.ext.dir}"
+ <fileset dir="${soa.esb.lib.dir}"
includes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
<fileset dir="${esb.dest}/dist" includes="trailblazer-esb.jar"/>
<fileset dir="${esb.home.dir}/lib/ext" includes="*.jar" excludes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
- <fileset dir="${soa.esb.lib.ext.dir}" includes="*.jar" excludes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
- <fileset dir="${org.jboss.esb.server.home}/client" includes="jbossall-client.jar jbossws-client.jar mail.jar"/>
+ <fileset dir="${soa.esb.lib.dir}" includes="*.jar" excludes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
+ <fileset dir="${log4j.lib.dir}" includes="jbossall-client.jar jbossws-client.jar mail.jar"/>
<fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
<fileset dir="${esb.lib.dir}/ext" includes="*.jar"/>
<!-- for finding the jbossesb-properties.xml file -->
@@ -78,10 +106,10 @@
</path>
<path id="esb.samples.trailblazer.esb.classpath.client">
- <fileset dir="${soa.esb.lib.ext.dir}"/>
+ <fileset dir="${soa.esb.lib.dir}"/>
<fileset dir="${esb.lib.dir}/ext" includes="*.jar"/>
- <fileset dir="${org.jboss.esb.server.home}/client" includes="jboss-jaxrpc.jar jbossall-client.jar jbossws-client.jar mail.jar"/>
- <fileset dir="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy/jbossws.sar" includes="jboss-jaxrpc.jar"/>
+ <fileset dir="${log4j.lib.dir}" includes="jboss-jaxrpc.jar jbossall-client.jar jbossws-client.jar mail.jar log4j.jar"/>
+ <fileset dir="${soa.esb.config.dir}/deploy/jbossws.sar" includes="jboss-jaxrpc.jar"/>
<fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
<fileset dir="${esb.samples.trailblazer.client.lib.dir}/ext" includes="*.jar"/>
<fileset dir="${esb.dest}/dist" includes="trailblazer-esb.jar"/>
Modified: labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -101,7 +101,6 @@
return customer;
}
-
//uses plain JMS to send a text message
private void sendToJMSBank(Customer customer) {
try {
@@ -135,11 +134,11 @@
logger.debug("sending to credit agency");
//set the customer inside the message - csv format for now to test
- message.getBody().setByteArray(customer.getCSV().getBytes());
+ message.getBody().add(customer.getCSV());
replyMessage = serviceInvoker.deliverSync(message, 5000);
if (replyMessage != null) {
- logger.info("received reply from creditAgency action: " + replyMessage.getBody().getByteArray());
- String xx = new String(replyMessage.getBody().getByteArray());
+ logger.info("received reply from creditAgency action: " + replyMessage.getBody().get());
+ String xx = (String) replyMessage.getBody().get();
score = Integer.parseInt(xx.trim());
} else {
logger.debug("reply not received from credit agency - setting a value of 5");
Modified: labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -36,12 +36,12 @@
public BankResponseActions(ConfigTree config) { _config = config; }
public Message processResponseFromJMSBank(Message message) throws Exception {
- System.out.println("Got the message from the JMS bank: " + message.getBody().getByteArray());
+ System.out.println("Got the message from the JMS bank: " + message.getBody().get());
- _logger.debug("message received: \n" + new String(message.getBody().getByteArray()));
+ _logger.debug("message received: \n" + message.getBody().get());
//get the response from the bank and set it in the customer
- ConfigTree tree = ConfigTree.fromXml(new String(message.getBody().getByteArray()));
+ ConfigTree tree = ConfigTree.fromXml((String) message.getBody().get());
String quoteID = tree.getFirstTextChild("quoteId");
String rate = tree.getFirstTextChild("interestRate");
String errorCode = tree.getFirstTextChild("errorCode");
@@ -50,8 +50,6 @@
_logger.debug("info using for email: " + quoteID +" "+rate+" "+errorCode+" "+ssn+" "+email);
//_logger.debug("email address found: " + email);
-
-
_logger.debug("preparing to send the quote response via email to customer");
ProcessEmail procEmail = new ProcessEmail(email, quoteID, rate, errorCode, ssn);
procEmail.sendEmail();
Modified: labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -44,10 +44,9 @@
_logger.debug("message received: " + Util.serialize(message) );
- String csvData = new String(message.getBody().getByteArray());
+ String csvData = (String) message.getBody().get();
_logger.debug("csv data received: " + csvData);
-
//generate a random score between 1 and 10
Random rand = new Random();
int n = 10;
@@ -56,7 +55,7 @@
//send back the reply
Message replyMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
_logger.info("CreditAgency sending back a credit score of " + score);
- replyMessage.getBody().setByteArray(Integer.toString(score).getBytes());
+ replyMessage.getBody().add(Integer.toString(score));
return replyMessage;
}
@@ -64,9 +63,7 @@
public Message debugMessage(Message message) throws Exception{
_logger.debug("message received in processCreditRequest with message: " + Util.serialize(message));
-
-
-
+
return message;
}
}
Modified: labs/jbossesb/trunk/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -52,6 +52,7 @@
public class DBMessageStoreImpl implements RedeliverStore
{
public static final String DEFAULT_TABLE_NAME = "message";
+ public static final String UNCLASSIFIED_CLASSIFICATION = "NONE";
private Logger logger = Logger.getLogger(this.getClass());
@@ -79,6 +80,7 @@
/**
* add's a @Message to the database persistence store
* will set the 'delivered' flag to TRUE by default - assuming that the @Message has been delivered
+ * If classification is null or "", then NONE will be used.
*/
public synchronized URI addMessage (Message message, String classification) throws MessageStoreException
{
@@ -87,6 +89,10 @@
try{
conn = mgr.getConnection();
uid = uriGenerator.generateMessageURI(message);
+
+ if ((classification == null) || (classification.equals("")))
+ classification = UNCLASSIFIED_CLASSIFICATION;
+
insert(uid, message, classification, "TRUE", conn);
}
catch (Exception e)
@@ -144,6 +150,7 @@
/**
* remove a @Message based on the passed in key in the form of a JBoss ESB @URI
* format for URI: "urn:jboss/esb/message/UID#" + UUID.randomUUID()" - see the method in this class @removeMessage
+ * If classification is null or "", then NONE will be used.
*/
public synchronized int removeMessage (URI uid, String classification)
throws MessageStoreException
@@ -152,6 +159,10 @@
Connection conn=null;
try {
conn = mgr.getConnection();
+
+ if ((classification == null) || (classification.equals("")))
+ classification = UNCLASSIFIED_CLASSIFICATION;
+
response = delete(uid, classification, conn);
} catch (Exception e) {
throw new MessageStoreException(e);
@@ -214,18 +225,41 @@
try
{
conn = mgr.getConnection();
- Statement stmt;
- ResultSet rs;
- stmt = conn.createStatement();
- rs = stmt.executeQuery(sql);
-
- while (rs.next()) {
- URI uid = new URI(rs.getString(1));
- Message msg = getMessage(uid);
- messages.put(uid, msg);
+ Statement stmt = null;
+ ResultSet rs = null;
+ try
+ {
+ stmt = conn.createStatement();
+ rs = stmt.executeQuery(sql);
+
+ while (rs.next()) {
+ URI uid = new URI(rs.getString(1));
+ Message msg = getMessage(uid);
+ messages.put(uid, msg);
+ }
}
- rs.close();
- stmt.close();
+ finally
+ {
+ try
+ {
+ if (rs != null)
+ rs.close();
+ }
+ catch (final Exception ex)
+ {
+ logger.warn("Could not close ResultSet.", ex);
+ }
+
+ try
+ {
+ if (stmt != null)
+ stmt.close();
+ }
+ catch (final Exception ex)
+ {
+ logger.warn("Could not close Statement.", ex);
+ }
+ }
}
catch (Exception e)
@@ -257,19 +291,42 @@
try
{
conn = mgr.getConnection();
- Statement stmt;
- ResultSet rs;
- stmt = conn.createStatement();
- rs = stmt.executeQuery(sql);
+ Statement stmt = null;
+ ResultSet rs = null;
- while (rs.next()) {
- URI uid = new URI(rs.getString(1));
- Message msg = Util.deserialize((Serializable) Encoding.decodeToObject( rs.getString(2)));
- messages.put(uid, msg);
+ try
+ {
+ stmt = conn.createStatement();
+ rs = stmt.executeQuery(sql);
+
+ while (rs.next()) {
+ URI uid = new URI(rs.getString(1));
+ Message msg = Util.deserialize((Serializable) Encoding.decodeToObject( rs.getString(2)));
+ messages.put(uid, msg);
+ }
}
- rs.close();
- stmt.close();
-
+ finally
+ {
+ try
+ {
+ if (rs != null)
+ rs.close();
+ }
+ catch (final Exception ex)
+ {
+ logger.warn("Could not close ResultSet.", ex);
+ }
+
+ try
+ {
+ if (stmt != null)
+ stmt.close();
+ }
+ catch (final Exception ex)
+ {
+ logger.warn("Could not close Statement.", ex);
+ }
+ }
}
catch (Exception e)
{
@@ -390,18 +447,45 @@
{
Message message=null;
String selectSql = "select * from "+tableName+" where uuid=?";
- PreparedStatement selectStmt = connection.prepareStatement(selectSql);
- selectStmt.setObject(1, uid.toString());
- ResultSet rs = selectStmt.executeQuery();
- if (rs.next()) {
- try {
- message = Util.deserialize((Serializable) Encoding.decodeToObject(rs.getString("message")));
- } catch (Exception e) {
- throw new MessageStoreException(e);
+ PreparedStatement selectStmt = null;
+ ResultSet rs = null;
+
+ try
+ {
+ selectStmt = connection.prepareStatement(selectSql);
+ selectStmt.setObject(1, uid.toString());
+ rs = selectStmt.executeQuery();
+
+ if (rs.next()) {
+ try {
+ message = Util.deserialize((Serializable) Encoding.decodeToObject(rs.getString("message")));
+ } catch (Exception e) {
+ throw new MessageStoreException(e);
+ }
}
}
- rs.close();
- selectStmt.close();
+ finally
+ {
+ try
+ {
+ if (rs != null)
+ rs.close();
+ }
+ catch (final Exception ex)
+ {
+ logger.warn("Could not close ResultSet.", ex);
+ }
+
+ try
+ {
+ if (selectStmt != null)
+ selectStmt.close();
+ }
+ catch (final Exception ex)
+ {
+ logger.warn("Could not close Statement.", ex);
+ }
+ }
return message;
}
@@ -410,19 +494,46 @@
{
Message message=null;
String selectSql = "select * from "+tableName+" where uuid=? and classification=?";
- PreparedStatement selectStmt = connection.prepareStatement(selectSql);
- selectStmt.setObject(1, uid.toString());
- selectStmt.setObject(2, classification);
- ResultSet rs = selectStmt.executeQuery();
- if (rs.next()) {
- try {
- message = Util.deserialize((Serializable) Encoding.decodeToObject(rs.getString("message")));
- } catch (Exception e) {
- throw new MessageStoreException(e);
+ PreparedStatement selectStmt = null;
+ ResultSet rs = null;
+
+ try
+ {
+ selectStmt = connection.prepareStatement(selectSql);
+ selectStmt.setObject(1, uid.toString());
+ selectStmt.setObject(2, classification);
+ rs = selectStmt.executeQuery();
+
+ if (rs.next()) {
+ try {
+ message = Util.deserialize((Serializable) Encoding.decodeToObject(rs.getString("message")));
+ } catch (Exception e) {
+ throw new MessageStoreException(e);
+ }
}
}
- rs.close();
- selectStmt.close();
+ finally
+ {
+ try
+ {
+ if (rs != null)
+ rs.close();
+ }
+ catch (final Exception ex)
+ {
+ logger.warn("Could not close ResultSet.", ex);
+ }
+
+ try
+ {
+ if (selectStmt != null)
+ selectStmt.close();
+ }
+ catch (final Exception ex)
+ {
+ logger.warn("Could not close Statement.", ex);
+ }
+ }
return message;
}
@@ -430,11 +541,30 @@
throws SQLException
{
String deleteSql = "delete from "+tableName+" where uuid=? and classification=?";
- PreparedStatement stmt = connection.prepareStatement(deleteSql);
- stmt.setObject(1, uid.toString());
- stmt.setObject(2, classification);
- int result = stmt.executeUpdate();
- stmt.close();
+ PreparedStatement stmt = null;
+ int result;
+
+ try
+ {
+ stmt = connection.prepareStatement(deleteSql);
+
+ stmt.setObject(1, uid.toString());
+ stmt.setObject(2, classification);
+ result = stmt.executeUpdate();
+ }
+ finally
+ {
+ try
+ {
+ if (stmt != null)
+ stmt.close();
+ }
+ catch (final Exception ex)
+ {
+ logger.warn("Could not close Statement.", ex);
+ }
+ }
+
return result;
}
@@ -442,20 +572,28 @@
throws SQLException, MessageStoreException
{
String sql = "insert into "+tableName+"(uuid, type, message, delivered, classification) values(?,?,?,?,?)";
- PreparedStatement ps = conn.prepareStatement(sql);
+ PreparedStatement ps = null;
- ps.setString(1, uid.toString());
- ps.setString(2, message.getType().toString());
- try {
- String messageString = Encoding.encodeObject(Util.serialize(message));
- ps.setString(3, messageString);
- } catch (Exception e) {
- throw new MessageStoreException(e);
+ try
+ {
+ ps = conn.prepareStatement(sql);
+ ps.setString(1, uid.toString());
+ ps.setString(2, message.getType().toString());
+ try {
+ String messageString = Encoding.encodeObject(Util.serialize(message));
+ ps.setString(3, messageString);
+ } catch (Exception e) {
+ throw new MessageStoreException(e);
+ }
+ ps.setString(4, "TRUE");
+ ps.setString(5, classification);
+ ps.execute();
}
- ps.setString(4, "TRUE");
- ps.setString(5, classification);
- ps.execute();
- ps.close();
+ finally
+ {
+ if (ps != null)
+ ps.close();
+ }
}
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task)
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/build (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/build)
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/build/classes)
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/org (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/build/classes/org)
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/org/jbpm (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/build/classes/org/jbpm)
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/build/classes/org/jbpm/ant (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/build/classes/org/jbpm/ant)
Deleted: labs/jbossesb/trunk/product/services/jbpm/ant-task/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/build.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/ant-task/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,20 +0,0 @@
-<project name="jbpm-ant-task" default="build-task" basedir=".">
-
- <path id="classpath">
- <pathelement location="src/test/resources"/>
- <pathelement location="build/classes" />
- <pathelement location="build/test/classes" />
- </path>
-
-
- <target name="build-task">
- <mkdir dir="build/classes"/>
- <javac srcdir="src" destdir="build/classes"
- debug="on" >
- <classpath refid="classpath" />
- </javac>
- <jar basedir="build/classes" destfile="build/jbpm-ant.jar"
- includes="**/*.class"/>
- </target>
-
-</project>
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/build.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/ant-task/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/ant-task/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,20 @@
+<project name="jbpm-ant-task" default="build-task" basedir=".">
+
+ <path id="classpath">
+ <pathelement location="src/test/resources"/>
+ <pathelement location="build/classes" />
+ <pathelement location="build/test/classes" />
+ </path>
+
+
+ <target name="build-task">
+ <mkdir dir="build/classes"/>
+ <javac srcdir="src" destdir="build/classes"
+ debug="on" >
+ <classpath refid="classpath" />
+ </javac>
+ <jar basedir="build/classes" destfile="build/jbpm-ant.jar"
+ includes="**/*.class"/>
+ </target>
+
+</project>
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/src (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/src)
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/src/org)
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/src/org/jbpm)
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/src/org/jbpm/ant)
Deleted: labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/DeployProcessToServerTask.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/src/org/jbpm/ant/DeployProcessToServerTask.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/DeployProcessToServerTask.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,217 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.ant;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.ConnectException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.taskdefs.MatchingTask;
-import org.apache.tools.ant.types.FileSet;
-
-/**
- * ant task for deploying process archives to the deployment servlet.
- *
- * @author kurt stam
- */
-public class DeployProcessToServerTask extends MatchingTask {
-
- private static final String boundary = "AaB03x";
-
- String serverName = "localhost";
- String serverPort = "8080";
- String serverDeployer = "/jbpm-console/upload";
- String debug = null;
- File process = null;
- List fileSets = new ArrayList();
-
- public void setServerDeployer(String serverDeployer) {
- this.serverDeployer = serverDeployer;
- }
-
- public void setServerName(String serverName) {
- this.serverName = serverName;
- }
-
- public void setServerPort(String serverPort) {
- this.serverPort = serverPort;
- }
-
- public void setProcess(File process) {
- this.process = process;
- }
-
- public void setDebug(String debug) {
- this.debug = debug;
- }
-
- public void execute() throws BuildException {
- try {
- if (pingServerOK()) {
- //if attribute par is set, deploy the par file
- if (process!=null) {
- log( "deploying par "+process.getAbsolutePath()+" ..." );
- FileInputStream in = new FileInputStream(process);
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) > 0) {
- out.write(buf, 0, len);
- }
- out.flush();
- if (debug!=null) {
- saveParFile("debug.par", out.toByteArray());
- }
- deployProcessWithServlet(serverName, serverPort, serverDeployer, out.toByteArray());
- in.close();
- log("deployment complete.");
- }
- //if attribute fileSets is set, deploy the fileSets too
- if (fileSets.size()>0) {
- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream);
-
- // loop over all files that are specified in the filesets
- Iterator iter = fileSets.iterator();
- while (iter.hasNext()) {
- FileSet fileSet = (FileSet) iter.next();
- DirectoryScanner dirScanner = fileSet.getDirectoryScanner(getProject());
- String[] fileSetFiles = dirScanner.getIncludedFiles();
-
- for (int i = 0; i < fileSetFiles.length; i++) {
- String fileName = fileSetFiles[i];
- File file = new File(fileName);
- if ( !file.isFile() ) {
- file = new File( dirScanner.getBasedir(), fileName );
- }
- // deploy the file, specified in a fileset element
- log( "adding to process archive "+file+" ..." );
- addFile(zipOutputStream, file);
- }
- }
- zipOutputStream.close();
- log( "deploying par ..." );
- if (debug!=null) {
- saveParFile("debug.par", byteArrayOutputStream.toByteArray());
- }
- deployProcessWithServlet(serverName, serverPort, serverDeployer, byteArrayOutputStream.toByteArray());
- log("deployment complete.");
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- throw new BuildException( "couldn't deploy process archives : " + e.getMessage() );
- }
- }
-
- public void addFileset(FileSet fileSet) {
- this.fileSets.add(fileSet);
- }
-
- public void deployProcessWithServlet(String serverName, String serverPort, String serverDeployer, byte[] parBytes) throws Exception {
- URL url = new URL("http://" + serverName + ":" + serverPort + serverDeployer);
- URLConnection urlConnection = url.openConnection();
- urlConnection.setDoInput(true);
- urlConnection.setDoOutput(true);
- urlConnection.setUseCaches(false);
- urlConnection.setRequestProperty("Content-Type",
- "multipart/form-data; boundary=AaB03x");
- DataOutputStream dataOutputStream = new DataOutputStream(urlConnection
- .getOutputStream());
- dataOutputStream.writeBytes("--" + boundary + "\r\n");
- dataOutputStream.writeBytes("Content-Disposition: form-data; name=\"definition\"; filename=\"dummy.par\"\r\n");
- dataOutputStream.writeBytes("Content-Type: application/x-zip-compressed\r\n\r\n");
-
- dataOutputStream.write(parBytes);
-
- dataOutputStream.writeBytes("\r\n--" + boundary + "--\r\n");
- dataOutputStream.flush();
- dataOutputStream.close();
- InputStream inputStream = urlConnection.getInputStream();
- StringBuffer result = new StringBuffer();
- int read;
- while ((read = inputStream.read()) != -1) {
- result.append((char)read);
- }
- }
-
- public void addFile(ZipOutputStream zos, File file)
- throws IOException
- {
- byte[] buff = new byte[256];
- if (!file.exists()) return;
- InputStream is = new FileInputStream(file);
- zos.putNextEntry(new ZipEntry(file.getName()));
- int read;
- while ((read = is.read(buff)) != -1) {
- zos.write(buff, 0, read);
- }
- }
-
- private void saveParFile(String fileName, byte[] parBytes) throws IOException {
- File file = new File(fileName);
- if (!file.exists()) {
- file.createNewFile();
- }
- FileOutputStream fos = new FileOutputStream(file);
- fos.write(parBytes);
- fos.close();
- }
-
- public boolean pingServerOK() {
- URL url = null;
- try {
- url = new URL("http://" + serverName + ":" + serverPort + serverDeployer);
- URLConnection urlConnection = url.openConnection();
- urlConnection.setDoOutput(true);
- InputStream inputStream = urlConnection.getInputStream();
- StringBuffer result = new StringBuffer();
- int read;
- while ((read = inputStream.read()) != -1) {
- result.append((char)read);
- }
- return true;
- }
- catch (ConnectException e) {
- log("The server (" + url + ") could not be reached.");
- return false;
- }
- catch (Exception e) {
- log("An unexpected exception happened while testing the server (" + url + ") connection.");
- return false;
- }
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/DeployProcessToServerTask.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/src/org/jbpm/ant/DeployProcessToServerTask.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/DeployProcessToServerTask.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/DeployProcessToServerTask.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,217 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ant;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.ConnectException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.apache.tools.ant.types.FileSet;
+
+/**
+ * ant task for deploying process archives to the deployment servlet.
+ *
+ * @author kurt stam
+ */
+public class DeployProcessToServerTask extends MatchingTask {
+
+ private static final String boundary = "AaB03x";
+
+ String serverName = "localhost";
+ String serverPort = "8080";
+ String serverDeployer = "/jbpm-console/upload";
+ String debug = null;
+ File process = null;
+ List fileSets = new ArrayList();
+
+ public void setServerDeployer(String serverDeployer) {
+ this.serverDeployer = serverDeployer;
+ }
+
+ public void setServerName(String serverName) {
+ this.serverName = serverName;
+ }
+
+ public void setServerPort(String serverPort) {
+ this.serverPort = serverPort;
+ }
+
+ public void setProcess(File process) {
+ this.process = process;
+ }
+
+ public void setDebug(String debug) {
+ this.debug = debug;
+ }
+
+ public void execute() throws BuildException {
+ try {
+ if (pingServerOK()) {
+ //if attribute par is set, deploy the par file
+ if (process!=null) {
+ log( "deploying par "+process.getAbsolutePath()+" ..." );
+ FileInputStream in = new FileInputStream(process);
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ }
+ out.flush();
+ if (debug!=null) {
+ saveParFile("debug.par", out.toByteArray());
+ }
+ deployProcessWithServlet(serverName, serverPort, serverDeployer, out.toByteArray());
+ in.close();
+ log("deployment complete.");
+ }
+ //if attribute fileSets is set, deploy the fileSets too
+ if (fileSets.size()>0) {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream);
+
+ // loop over all files that are specified in the filesets
+ Iterator iter = fileSets.iterator();
+ while (iter.hasNext()) {
+ FileSet fileSet = (FileSet) iter.next();
+ DirectoryScanner dirScanner = fileSet.getDirectoryScanner(getProject());
+ String[] fileSetFiles = dirScanner.getIncludedFiles();
+
+ for (int i = 0; i < fileSetFiles.length; i++) {
+ String fileName = fileSetFiles[i];
+ File file = new File(fileName);
+ if ( !file.isFile() ) {
+ file = new File( dirScanner.getBasedir(), fileName );
+ }
+ // deploy the file, specified in a fileset element
+ log( "adding to process archive "+file+" ..." );
+ addFile(zipOutputStream, file);
+ }
+ }
+ zipOutputStream.close();
+ log( "deploying par ..." );
+ if (debug!=null) {
+ saveParFile("debug.par", byteArrayOutputStream.toByteArray());
+ }
+ deployProcessWithServlet(serverName, serverPort, serverDeployer, byteArrayOutputStream.toByteArray());
+ log("deployment complete.");
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new BuildException( "couldn't deploy process archives : " + e.getMessage() );
+ }
+ }
+
+ public void addFileset(FileSet fileSet) {
+ this.fileSets.add(fileSet);
+ }
+
+ public void deployProcessWithServlet(String serverName, String serverPort, String serverDeployer, byte[] parBytes) throws Exception {
+ URL url = new URL("http://" + serverName + ":" + serverPort + serverDeployer);
+ URLConnection urlConnection = url.openConnection();
+ urlConnection.setDoInput(true);
+ urlConnection.setDoOutput(true);
+ urlConnection.setUseCaches(false);
+ urlConnection.setRequestProperty("Content-Type",
+ "multipart/form-data; boundary=AaB03x");
+ DataOutputStream dataOutputStream = new DataOutputStream(urlConnection
+ .getOutputStream());
+ dataOutputStream.writeBytes("--" + boundary + "\r\n");
+ dataOutputStream.writeBytes("Content-Disposition: form-data; name=\"definition\"; filename=\"dummy.par\"\r\n");
+ dataOutputStream.writeBytes("Content-Type: application/x-zip-compressed\r\n\r\n");
+
+ dataOutputStream.write(parBytes);
+
+ dataOutputStream.writeBytes("\r\n--" + boundary + "--\r\n");
+ dataOutputStream.flush();
+ dataOutputStream.close();
+ InputStream inputStream = urlConnection.getInputStream();
+ StringBuffer result = new StringBuffer();
+ int read;
+ while ((read = inputStream.read()) != -1) {
+ result.append((char)read);
+ }
+ }
+
+ public void addFile(ZipOutputStream zos, File file)
+ throws IOException
+ {
+ byte[] buff = new byte[256];
+ if (!file.exists()) return;
+ InputStream is = new FileInputStream(file);
+ zos.putNextEntry(new ZipEntry(file.getName()));
+ int read;
+ while ((read = is.read(buff)) != -1) {
+ zos.write(buff, 0, read);
+ }
+ }
+
+ private void saveParFile(String fileName, byte[] parBytes) throws IOException {
+ File file = new File(fileName);
+ if (!file.exists()) {
+ file.createNewFile();
+ }
+ FileOutputStream fos = new FileOutputStream(file);
+ fos.write(parBytes);
+ fos.close();
+ }
+
+ public boolean pingServerOK() {
+ URL url = null;
+ try {
+ url = new URL("http://" + serverName + ":" + serverPort + serverDeployer);
+ URLConnection urlConnection = url.openConnection();
+ urlConnection.setDoOutput(true);
+ InputStream inputStream = urlConnection.getInputStream();
+ StringBuffer result = new StringBuffer();
+ int read;
+ while ((read = inputStream.read()) != -1) {
+ result.append((char)read);
+ }
+ return true;
+ }
+ catch (ConnectException e) {
+ log("The server (" + url + ") could not be reached.");
+ return false;
+ }
+ catch (Exception e) {
+ log("An unexpected exception happened while testing the server (" + url + ") connection.");
+ return false;
+ }
+ }
+}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/ProcessDeployer.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/src/org/jbpm/ant/ProcessDeployer.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/ProcessDeployer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.ant;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.util.List;
-import java.util.zip.ZipOutputStream;
-
-/**
- * ProcessDeployer deploys as a PAR and uses the functionality of DeployProcessToServerTask without requiring the use of ant.
- *
- * @author kurt stam
- * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
- */
-public class ProcessDeployer {
- public void execute (String serverName, String serverPort, String serverDeployer, List<File> fileList) throws Exception {
- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream);
- DeployProcessToServerTask dptt = new DeployProcessToServerTask();
-
- dptt.setServerName(serverName);
- dptt.setServerPort(serverPort);
- dptt.setServerDeployer(serverDeployer);
-
- for (File file : fileList) {
- dptt.addFile(zipOutputStream, file);
- }
-
- zipOutputStream.close();
-
- dptt.deployProcessWithServlet(serverName, serverPort, serverDeployer, byteArrayOutputStream.toByteArray());
- }
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/ProcessDeployer.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/ant-task/src/org/jbpm/ant/ProcessDeployer.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/ProcessDeployer.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/ant-task/src/org/jbpm/ant/ProcessDeployer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ant;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.util.List;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * ProcessDeployer deploys as a PAR and uses the functionality of DeployProcessToServerTask without requiring the use of ant.
+ *
+ * @author kurt stam
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class ProcessDeployer {
+ public void execute (String serverName, String serverPort, String serverDeployer, List<File> fileList) throws Exception {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream);
+ DeployProcessToServerTask dptt = new DeployProcessToServerTask();
+
+ dptt.setServerName(serverName);
+ dptt.setServerPort(serverPort);
+ dptt.setServerDeployer(serverDeployer);
+
+ for (File file : fileList) {
+ dptt.addFile(zipOutputStream, file);
+ }
+
+ zipOutputStream.close();
+
+ dptt.deployProcessWithServlet(serverName, serverPort, serverDeployer, byteArrayOutputStream.toByteArray());
+ }
+}
Copied: labs/jbossesb/trunk/product/services/jbpm/lib/ext/jbpm-ant.jar (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/lib/ext/jbpm-ant.jar)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/CommandExecutorFactory.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/CommandExecutorFactory.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/CommandExecutorFactory.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,52 +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,
- */
-package org.jboss.soa.esb.services.jbpm;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.actions.CommandInterpreter;
-import org.jboss.soa.esb.services.jbpm.actions.impl.DefaultCommandExecutorFactoryImpl;
-
-/**
- * Factory to obtain appropriate Performer for the jBPM CommandInterpreter
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public abstract class CommandExecutorFactory
-{
-
- public abstract CommandInterpreter.CommandExecutor
- getExecutor(Message message) throws Exception;
-
-
- protected static final Object s_oSynch = new Integer(0);
-
- protected static CommandExecutorFactory _factory;
- public static CommandExecutorFactory getInstance()
- {
- if (null==_factory)
- synchronized(s_oSynch)
- {
- if (null==_factory)
- _factory=new DefaultCommandExecutorFactoryImpl();
- };
- return _factory;
- } //________________________________
-}
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -53,10 +53,12 @@
public static final String ACTOR_NAMES_ARRAY ="jbpmActorNamesArray";
public static final String OVERWRITE_SWIMLANE ="jbpmOverwriteSwim";
public static final String KEYPATH ="pathTojbpmKey";
+ public static final String NODE_ID ="jbpmNodeId";
+ public static final String PROCESS_NODE_VERSION_COUNTER ="jbpmProcessNodeVersionCounter";
public static final String TRANSITION_NAME ="jbpmTransitionName";
public static final String CURRENT_NODE_NAME ="jbpmCurrentNodeName";
- public static final String VARIABLE_VALUES ="jbpmVariableValuesMap";
+ public static final String VARIABLE_VALUES ="jbpmVariableMappings";
public static final String JBPM_RETURN_OBJECT ="jbpmReturnObject";
public static final String EXCEPTION ="jbpmException";
public static final String ERROR_MESSAGE ="jbpmErrorMsg";
@@ -79,38 +81,48 @@
public static final String INCLUDE_ALL_VARS_TAG ="include-all-variables";
public static final String INCLUDE_LOGS_TAG ="include-logs";
public static final String VARIABLES_TAG ="variables";
- public static final String OBJECT_PATH_TAG ="object-path";
public static final String ONE_VARIABLE_TAG ="variable";
public static final String ESB_VARNAME_TAG ="esb";
- public static final String JBPM_VARNAME_TAG ="bpm";
+ public static final String BPM_VARNAME_TAG ="bpm";
+ public static final String DEFAULT_VALUE_TAG ="default";
public static final String ACTORS_TAG ="actors";
public static final String ONE_ACTOR_TAG ="actor";
public static final String OVERWRITE_SWIMLANE_TAG ="overwrite-swimlane";
+ public static final String KEY_TAG ="key";
+
+ //tag names for xml configuration of jBPM actions
+ public static final String BPM_TO_ESB_VARS_TAG = "bpmToEsbVars";
+ public static final String ESB_TO_BPM_VARS_TAG = "esbToBpmVars";
+ public static final String MAPPING_TAG = "mapping";
+ public static final String BPM_NAME_ATTR = "bpm";
+ public static final String ESB_NAME_ATTR = "esb";
+ public static final String PROCESS_SCOPE_ATTR = "process-scope";
public enum OpCode
{
- DeployProcessDefinition
-// AbstractCancelCommand
+ CallbackCommand
+// ,DeployProcessDefinition
+// ,AbstractCancelCommand
// ,AbstractGetObjectBaseCommand
// ,AsynchronousCommand
,CancelProcessInstanceCommand
- ,CancelTokenCommand
- ,CancelWorkOnTaskCommand
+// ,CancelTokenCommand
+// ,CancelWorkOnTaskCommand
// ,ChangeProcessInstanceVersionCommand
// ,Command
// ,CommandService
// ,CompositeCommand
// ,GetProcessDefinitionCommand
- ,GetProcessInstanceCommand
+// ,GetProcessInstanceCommand
// ,GetProcessInstancesCommand
- ,GetTaskInstanceCommand
- ,GetTaskListCommand
+// ,GetTaskInstanceCommand
+// ,GetTaskListCommand
,NewProcessInstanceCommand
,SignalCommand
,StartProcessInstanceCommand
- ,StartWorkOnTaskCommand
- ,TaskInstanceEndCommand
- ,VariablesCommand
+// ,StartWorkOnTaskCommand
+// ,TaskInstanceEndCommand
+// ,VariablesCommand
;
}
}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,245 @@
+/**
+ *
+ */
+package org.jboss.soa.esb.services.jbpm;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.tree.DefaultElement;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.mapping.ObjectMapper;
+import org.jboss.soa.esb.message.mapping.ObjectMappingException;
+import org.jbpm.context.exe.ContextInstance;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.Token;
+import org.mvel.MVEL;
+
+/**
+ * Mapping glue between jBPM and ESB. Handles setting up the replyTo of the
+ * JBpmCallback Service, and is a wrapper around org.jboss.soa.esb.message.mapping.ObjectMapper
+ * to handle jBPM specifics around mapping variables from jBPM to ESB and back.
+ *
+ * @author kstam
+ */
+public class JBpmObjectMapper {
+
+ public JBpmObjectMapper() {
+ super();
+ }
+
+ private Logger log = Logger.getLogger(getClass());
+ private ObjectMapper objectMapper = new ObjectMapper();
+
+ /**
+ * Creates an ESB Message, giving the mapping specified in the jbpmToEsbVars Element.
+ * This element is defined in the jBPM process-definition.xml as child element
+ * of either the EsbNotifier ActionHandler, or the EsbActionHandler.
+ *
+ * @param jbpmToEsbVars - the configuration of the mapping.
+ * @param isGlobalProcessScope - Variables will be looked up using either the token scope or the process-definition (global) scope
+ * See the jBPM documentation for more details.
+ * @param executionContext - the jBPM ExecutionContext.
+ * @return the newly created ESB message.
+ *
+ * @throws Exception
+ */
+ public Message mapFromJBpmToEsbMessage (final DefaultElement bpmToEsbVars, final Boolean isGlobalProcessScope, final ExecutionContext executionContext)
+ {
+ Message message = MessageFactory.getInstance().getMessage();
+ boolean gblPrcScope = (null == isGlobalProcessScope) ? false : isGlobalProcessScope;
+
+ if (bpmToEsbVars==null) {
+ return message;
+ }
+ List mappings = bpmToEsbVars.elements(Constants.MAPPING_TAG);
+ if (mappings.size() < 1) {
+ setAllOnEsbMessage(gblPrcScope, executionContext, message);
+ } else {
+ for (Object mappingElement : mappings) {
+ Element element = (Element) mappingElement;
+ try {
+ Mapping mapping = Mapping.parseMappingElement(element);
+ setOnEsbMessage(mapping, gblPrcScope, executionContext, message);
+ } catch (ConfigurationException ce) {
+ log.error(ce.getMessage(), ce);
+ } catch (ObjectMappingException ome) {
+ log.error(ome.getMessage(), ome);
+ }
+ }
+ }
+ return message;
+ }
+ /**
+ * Sets all the Objects in the jBPM VariableMap in the body of the ESB Message using the
+ * the jBPM object names as the Esb Message body keys.
+ *
+ * @param gblPrcScope
+ * @param executionContext
+ * @param message
+ */
+ private void setAllOnEsbMessage(final boolean gblPrcScope, final ExecutionContext executionContext, Message message)
+ {
+ Token token = executionContext.getToken();
+ ContextInstance ctxInstance = token.getProcessInstance().getContextInstance();
+ log.debug("The user has not mapped anything (jbpmToEsbVars is null) " +
+ "so add all the variables using their jBPM name");
+ Map map = (gblPrcScope) ? ctxInstance.getVariables() : ctxInstance.getVariables(token);
+ if (null != map) {
+ for (Iterator iter = map.entrySet().iterator(); iter.hasNext();){
+ Map.Entry jBPMVariable = (Map.Entry) iter.next();
+ message.getBody().add(jBPMVariable.getKey().toString(), jBPMVariable.getValue());
+ }
+ }
+ }
+ /**
+ * Sets a jBPM object onto the ESB Message. The mapping is defined in the Mapping element.
+ *
+ * @param mapping - Mapping object, used to extract the object from jBPM and used to set the object on the ESB Message
+ * @param gblPrcScope - Global setting for the jBPM scope
+ * @param message - ESB Message
+ * @param executionContext - jBPM ExcutionContext
+ *
+ * @throws ObjectMappingException
+ */
+ private void setOnEsbMessage(final Mapping mapping, final boolean gblPrcScope, final ExecutionContext executionContext, Message message)
+ throws ObjectMappingException, ConfigurationException
+ {
+ if (mapping.getBpm()==null || "".equals(mapping.getBpm())) {
+ throw new ConfigurationException("The 'bpm' attribute is a required attribute");
+ }
+ if (mapping.getEsb()==null || "".equals(mapping.getEsb())) {
+ mapping.setEsb(mapping.getBpm());
+ }
+ Token token = executionContext.getToken();
+ ContextInstance ctxInstance = token.getProcessInstance().getContextInstance();
+ //Each mapping can override the global setting
+ boolean isPrcScope = (null == mapping.getIsProcessScope()) ? gblPrcScope : mapping.getIsProcessScope();
+ //By default assume the object is part of the jBPM variableMap
+ Object object = getObjectFromJBpmVariableMap(isPrcScope, mapping.getBpm(), ctxInstance, token);
+ //if that fails then try to get it from the ExecutionContext
+ if (object==null) {
+ object = MVEL.getProperty(mapping.getBpm(), executionContext);
+ }
+ if (null != object) {
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.setObjectOnMessage(message, mapping.getEsb(), object);
+ } else {
+ log.warn("The object " + mapping.getBpm() + " is null and cannot not be set on the message");
+ }
+ }
+ /**
+ * Obtains an Object from the jBPM variableMap.
+ *
+ * @param isPrcScope - if true, within process-instance scope, if false, within token scope, or up the token hierarchy.
+ * @param expression - MVEL expression String.
+ * @param ctxInstance - jBPM ContextInstance where the jBPM variableMap lives.
+ * @param token - the current jBPM token, needed if isPrcScope is false.
+ * @return
+ */
+ private Object getObjectFromJBpmVariableMap(final boolean isPrcScope, final String expression, final ContextInstance ctxInstance, final Token token)
+ {
+ Object object = null;
+ String objectName = expression;
+ String remainingExpression = null;
+ int dotPosition=expression.indexOf(".");
+ if (dotPosition > 0) {
+ objectName = expression.substring(0, dotPosition-1);
+ remainingExpression = expression.substring(dotPosition+1);
+ }
+ if (isPrcScope) {
+ object = ctxInstance.getVariable(objectName);
+ } else {
+ object = ctxInstance.getVariable(objectName, token);
+ }
+ if (object !=null && remainingExpression!=null) {
+ log.debug("Using MVEL to obtain the object from " + object + " using expression: " + remainingExpression);
+ object = MVEL.getProperty(remainingExpression, object);
+ }
+ return object;
+ }
+ /**
+ *
+ * @param message
+ * @param esbToBpmXml
+ * @return
+ */
+ public HashMap<String,Object> mapFromEsbMessageToJBpmMap(Message message, final String esbToBpmXml)
+ throws ConfigurationException
+ {
+ List<Mapping> mappingList = new ArrayList<Mapping>();
+ if (esbToBpmXml!=null) {
+ try {
+ Document document = DocumentHelper.parseText(esbToBpmXml);
+ Element element = document.getRootElement();
+ Iterator iterator=element.elementIterator();
+ while(iterator.hasNext()) {
+ Element mappingElement = (Element) iterator.next();
+ Mapping mapping = Mapping.parseMappingElement(mappingElement);
+ mappingList.add(mapping);
+ }
+ } catch (DocumentException de) {
+ throw new ConfigurationException(de.getMessage(), de);
+ }
+ }
+ return mapFromEsbMessageToJBpmMap(message, mappingList);
+ }
+ /**
+ * This
+ * @param message
+ * @param token
+ * @throws Exception
+ */
+ public HashMap<String,Object> mapFromEsbMessageToJBpmMap (Message message, final List<Mapping> mappingList)
+ {
+ HashMap<String,Object> map = new HashMap<String, Object>();
+ if (null==mappingList || mappingList.size()<1) {
+ return null;
+ }
+ for (Mapping mapping: mappingList) {
+ if (mapping.getBpm()==null || "".equals(mapping.getBpm())) {
+
+ mapping.setBpm(mapping.getEsb());
+ }
+ Object value = null;
+ try {
+ value = getObjectFromMessage(message, mapping);
+ } catch (ConfigurationException ce) {
+ log.error(ce.getMessage(), ce);
+ }
+ // only put it in the map if it's not null
+ if (null!=value)
+ map.put(mapping.getBpm(), value);
+ }
+ return map;
+ }
+
+ private Object getObjectFromMessage(Message message, Mapping mapping)
+ throws ConfigurationException
+ {
+ Object value = null;
+ if (mapping.getEsb()==null || "".equals(mapping.getEsb())) {
+ throw new ConfigurationException("The 'esb' attribute is a required attribute");
+ }
+ try {
+ value = objectMapper.getObjectFromMessage(message, mapping.getEsb());
+ } catch (ObjectMappingException ome) {
+ log.info(mapping.getEsb() + " not found");
+ }
+ if (value == null) {
+ value = mapping.getDefaultValue();
+ }
+ log.debug("value=" + value);
+ return value;
+ }
+}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,88 @@
+/**
+ *
+ */
+package org.jboss.soa.esb.services.jbpm;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+import org.dom4j.Element;
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+/**
+ * @author kstam
+ *
+ */
+public class Mapping implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ private String bpm;
+ private String esb;
+ private Boolean isProcessScope;
+ private String defaultValue;
+ private static transient Logger log = Logger.getLogger(Mapping.class);
+
+ public String getBpm() {
+ return bpm;
+ }
+ public void setBpm(String bpm) {
+ this.bpm = bpm;
+ }
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+ public void setDefaultValue(String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+ public String getEsb() {
+ return esb;
+ }
+ public void setEsb(String esb) {
+ this.esb = esb;
+ }
+ public Boolean getIsProcessScope() {
+ return isProcessScope;
+ }
+ public void setIsProcessScope(Boolean isProcessScope) {
+ this.isProcessScope = isProcessScope;
+ }
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Mapping[ esb=").append(esb)
+ .append(", bpm=").append(bpm)
+ .append(", isProcessScope=").append(isProcessScope)
+ .append(", defaultValue=").append(defaultValue).append(" ]");
+ return builder.toString();
+ }
+ /**
+ *
+ * @param mappingElement
+ * @return
+ */
+ public static Mapping parseMappingElement(Element mappingElement)
+ {
+ Mapping mapping = new Mapping();
+ mapping.setEsb(mappingElement.attributeValue(Constants.ESB_VARNAME_TAG));
+ mapping.setBpm(mappingElement.attributeValue(Constants.BPM_VARNAME_TAG));
+ mapping.setDefaultValue(mappingElement.attributeValue(Constants.DEFAULT_VALUE_TAG));
+ mapping.setIsProcessScope(Boolean.parseBoolean(mappingElement.attributeValue(Constants.PROCESS_SCOPE_ATTR)));
+ if (log.isDebugEnabled()) log.debug(mappingElement.asXML() + ":" + mapping);
+ return mapping;
+ }
+
+ /**
+ *
+ * @param mappingElement
+ * @return
+ */
+ public static Mapping parseMappingElement(ConfigTree mappingElement)
+ {
+ Mapping mapping = new Mapping();
+ mapping.setEsb(mappingElement.getAttribute(Constants.ESB_VARNAME_TAG));
+ mapping.setBpm(mappingElement.getAttribute(Constants.BPM_VARNAME_TAG));
+ mapping.setDefaultValue(mappingElement.getAttribute(Constants.DEFAULT_VALUE_TAG));
+ mapping.setIsProcessScope(Boolean.parseBoolean(mappingElement.getAttribute(Constants.PROCESS_SCOPE_ATTR)));
+ if (log.isDebugEnabled()) log.debug(mappingElement.toXml() + ":" + mapping);
+ return mapping;
+ }
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/MessageFacadeFactory.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/MessageFacadeFactory.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/MessageFacadeFactory.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,53 +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,
- */
-package org.jboss.soa.esb.services.jbpm;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.services.jbpm.actions.BpmProcessor;
-import org.jboss.soa.esb.services.jbpm.actions.impl.DefaultMessageFacadeFactoryImpl;
-
-/**
- * Factory to obtain appropriate MessageManipulator for jBPM BpmProcessor
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public abstract class MessageFacadeFactory
-{
-
- public abstract BpmProcessor.MessageFacade
- getPreProcessor(ConfigTree config) throws ConfigurationException;
-
-
- protected static final Object s_oSynch = new Integer(0);
-
- private static MessageFacadeFactory _factory;
- public static MessageFacadeFactory getInstance()
- {
- if (null==_factory)
- synchronized(s_oSynch)
- {
- if (null==_factory)
- _factory=new DefaultMessageFacadeFactoryImpl();
- };
- return _factory;
- } //________________________________
-}
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -19,66 +19,40 @@
* 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 java.net.URI;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
import org.apache.log4j.Logger;
-import org.dom4j.Element;
import org.dom4j.tree.DefaultElement;
+import org.jboss.internal.soa.esb.util.LRUCache;
import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.eprs.LogicalEPR;
import org.jboss.soa.esb.client.ServiceInvoker;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.body.content.BytesBody;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.mapping.ObjectMapper;
import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.util.Helper;
-import org.jbpm.context.exe.ContextInstance;
+import org.jboss.soa.esb.services.jbpm.JBpmObjectMapper;
+import org.jboss.soa.esb.services.jbpm.actions.JBpmCallback;
import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
-
/**
*
- * Send messages to ESB services from jBPM applications, and optionally wait for
- * response. <li/>esbCategoryName - for ESB registry lookup <li/>esbServiceName
- * - for ESB registry lookup
- * <li>millisToWaitForResponse - if a value > 0 is supplied, a response will be
- * expected from the ESB service and maximum wait time will be set accordingly.
- * If response is not received, a CourierTimeoutException will be thrown </li>
+ * Send messages to ESB services from jBPM applications, and leaves the node
+ * in a wait state, waiting for a call back.
*
- * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
+ * <li/>esbCategoryName - for ESB registry lookup
+ * <li/>esbServiceName - for ESB registry lookup
+ * <li>millisToWaitForResponse - deprecated, please use a jBPM Timer </li>
*
+ * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
+ * @author <a href="mailto:kstam at jboss.com">Kurt T Stam</a>
*/
-
public class EsbActionHandler implements ActionHandler
{
- public static final String OUTGOING_VARS_TAG = "jbpmToEsbVars";
+ private static final long serialVersionUID = 2L;
- public static final String RETURN_VARS_TAG = "returnVars";
-
- public static final String MAPPING_TAG = "mapping";
-
- public static final String JBPM_NAME_ATTR = "jbpm";
-
- public static final String ESB_NAME_ATTR = "esb";
-
- public static final String PROCESS_SCOPE_ATTR = "process-scope";
-
- private static final long serialVersionUID = 1L;
-
public String esbCategoryName;
public String esbServiceName;
@@ -87,192 +61,133 @@
public Boolean globalProcessScope;
- public DefaultElement jbpmToEsbVars;
+ public DefaultElement bpmToEsbVars;
- public DefaultElement returnVars;
+ public DefaultElement esbToBpmVars;
+
+ public String exceptionTransition;
- protected Logger _logger = Logger.getLogger(getClass());
+ private transient Logger logger = Logger.getLogger(getClass());
+
+ private static transient LRUCache<String, ServiceInvoker> siCache = new LRUCache<String, ServiceInvoker>(20);
- protected Map<String, String> _outVarMapping;
-
- protected Map<String, String> _retVarMapping;
-
- protected transient Token _token;
-
public void execute (ExecutionContext executionContext) throws Exception
{
- _token = executionContext.getToken();
-
- Message request = getMessageTemplate();
- varsToRequest(request);
- if (null == millisToWaitForResponse || millisToWaitForResponse < 1)
- {
- ServiceInvoker invoker = new ServiceInvoker(esbCategoryName,
- esbServiceName);
- invoker.deliverAsync(request);
- return;
- }
-
- Message response = null;
- if ("MOCK_CATEGORY".equals(esbCategoryName)
- && "MOCK_SERVICE".equals(esbServiceName)) {
- response = request;
- } else {
- ServiceInvoker invoker = new ServiceInvoker(esbCategoryName,
- esbServiceName);
- response = invoker.deliverSync(request, millisToWaitForResponse);
- }
- if (null != response) {
- varsFromResponse(response);
- if (_token.getNode()!=null) {
- // _token.signal(); // this is required since the response is sync
- executionContext.getNode().leave(executionContext);
- }
- } else {
- throw new MessageDeliverException("The response from jBPM should not be null");
+ //validation
+ if (null == esbCategoryName)
+ throw new ConfigurationException(
+ "Service category (esbCategoryName element) must not be null");
+ if (null == esbServiceName)
+ throw new ConfigurationException(
+ "Service name (esbServiceName element) must not be null");
+ if (millisToWaitForResponse !=null) {
+ logger.info("millisToWaitForResponse is no longer a valid element, please use a " +
+ "jBPM timer for this node instead.");
}
+ //Create the ESB Message
+ JBpmObjectMapper mapper = new JBpmObjectMapper();
+ Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, globalProcessScope, executionContext);
+ //Set the replyTo to the JBpmCallback Service
+ String esbToBpmVarsXml=null;
+ if (esbToBpmVars!=null) {
+ esbToBpmVarsXml = esbToBpmVars.asXML();
+ }
+ EPR replyTo = createReplyTo(esbToBpmVarsXml, globalProcessScope, executionContext);
+ message.getHeader().getCall().setReplyTo(replyTo);
+ if (exceptionTransition!=null) {
+// Set the replyTo to the JBpmCallback Service
+ EPR faultTo = createFaultTo(esbToBpmVarsXml, globalProcessScope, executionContext);
+ message.getHeader().getCall().setFaultTo(faultTo);
+ }
+ //Sending the message on its way
+ if (logger.isDebugEnabled()) logger.debug("Created ESB message=" + message);
+ getServiceInvoker().deliverAsync(message);
+ logger.debug("Message send successfully");
}
-
- protected void varsToRequest (Message request) throws Exception
+ /**
+ * Caches the most recently used ServiceInvokers.
+ *
+ * @return a ServiceInvoker for the current esbService and esbCategoryName.
+ * @throws MessageDeliverException
+ */
+ private ServiceInvoker getServiceInvoker() throws MessageDeliverException
{
- ContextInstance ctxInstance = _token.getProcessInstance()
- .getContextInstance();
- Body body = request.getBody();
- boolean gblPrcScope = (null == globalProcessScope) ? false
- : globalProcessScope;
- if (null == jbpmToEsbVars)
- {
- Map map = (gblPrcScope) ? ctxInstance.getVariables() : ctxInstance
- .getVariables(_token);
- if (null != map)
- for (Iterator iter = map.entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry curr = (Map.Entry) iter.next();
- body.add(curr.getKey().toString(), curr.getValue());
- }
- return;
- }
- List list = jbpmToEsbVars.elements(MAPPING_TAG);
- // do nothing if empty list
- if (list.size() < 1)
- return;
+ String key = esbCategoryName + esbServiceName;
+ if (siCache.containsKey(key)) {
+ return siCache.get(key);
+ } else {
+ ServiceInvoker invoker = new ServiceInvoker(esbCategoryName, esbServiceName);
+ siCache.put(key, invoker);
+ return invoker;
+ }
+ }
- for (Object iter : list)
- {
- Element curr = (Element) iter;
- String jbpmKey = curr.attributeValue(JBPM_NAME_ATTR);
- String esbKey = curr.attributeValue(ESB_NAME_ATTR);
- String processScope = curr.attributeValue(PROCESS_SCOPE_ATTR);
- boolean isPrcScope = (null == processScope) ? gblPrcScope : Boolean
- .parseBoolean(processScope);
- Object obj = (isPrcScope) ? ctxInstance.getVariable(jbpmKey)
- : ctxInstance.getVariable(jbpmKey, _token);
- if (null != obj) {
- ObjectMapper mapper = new ObjectMapper();
- mapper.setObjectOnMessage(request, esbKey, obj);
- }
- }
- } // ________________________________
-
- protected void varsFromResponse (Message response) throws Exception
+ /**
+ * Setup the replyTo for the CallBack Service.
+ *
+ * Creates or increments a process-node-version-counter whose name is related to
+ * the current node ID. The name of the counter is jbpmProcessNodeVersionCounter<NodeId>.
+ * The counter is added to the ProcessVariable Map (global to the ProcessInstance)
+ * on the jBPM side The same variable should be added to the
+ * EsbMessage before it is passed onto the ESB. Other parameters added
+ * are the returnVariable mapping, the nodeId and the tokenId.
+ *
+ * @param returnVars - XML fragment from the processdefinition.xml describing
+ * the mapping of ESB Message objects to the jBPM variableMap.
+ * @param executionContext of the currently invoked EsbActionHandler.
+ * @return the replyTo EPR of the JBpmCallbackService.
+ */
+ protected EPR createReplyTo(String esbToJBpmXml, Boolean globalProcessScope, ExecutionContext executionContext)
{
- ContextInstance ctxInstance = _token.getProcessInstance()
- .getContextInstance();
- Body body = response.getBody();
- boolean gblPrcScope = (null == globalProcessScope) ? false
- : globalProcessScope;
- if (null == returnVars)
- {
- Map map = (gblPrcScope) ? ctxInstance.getVariables() : ctxInstance
- .getVariables(_token);
- if (null != map)
- for (Iterator iter = map.keySet().iterator(); iter.hasNext();)
- {
- String key = iter.next().toString();
- Object obj = body.get(key);
- if (null != obj)
- {
- if (gblPrcScope)
- ctxInstance.setVariable(key, obj);
- else
- ctxInstance.setVariable(key, obj, _token);
- }
- }
- return;
- }
- List list = returnVars.elements(MAPPING_TAG);
- // do nothing if empty list
- if (list.size() < 1)
- return;
-
- for (Object iter : list)
- {
- Element curr = (Element) iter;
- String jbpmVar = curr.attributeValue(JBPM_NAME_ATTR);
- String esbVar = curr.attributeValue(ESB_NAME_ATTR);
- String processScope = curr.attributeValue(PROCESS_SCOPE_ATTR);
- boolean isPrcScope = (null == processScope) ? gblPrcScope : Boolean
- .parseBoolean(processScope);
- Object obj = (Constants.BODY_CONTENT_VARIABLE_NAME.equals(esbVar)) ? body
- .get()
- : body.get(esbVar);
- Object oldVal = (isPrcScope) ? ctxInstance.getVariable(jbpmVar)
- : ctxInstance.getVariable(jbpmVar, _token);
- if (null == oldVal) {
- if (null != obj) {
- if (isPrcScope)
- ctxInstance.createVariable(jbpmVar, obj);
- else
- ctxInstance.createVariable(jbpmVar, obj, _token);
- }
- } else {
- if (null == obj) {
- if (isPrcScope)
- ctxInstance.deleteVariable(jbpmVar);
- else
- ctxInstance.deleteVariable(jbpmVar, _token);
- } else {
- if (isPrcScope)
- ctxInstance.setVariable(jbpmVar, obj);
- else
- ctxInstance.setVariable(jbpmVar, obj, _token);
- }
- }
- }
- } // ________________________________
-
- protected Message getMessageTemplate () throws Exception
+ EPR replyTo = new LogicalEPR(ServiceInvoker.INTERNAL_SERVICE_CATEGORY, JBpmCallback.JBPM_CALL_BACK_SERVICE_NAME);
+ PortReference portReference = replyTo.getAddr();
+ if (esbToJBpmXml!=null) {
+ portReference.addExtension(Constants.ESB_TO_BPM_VARS_TAG, esbToJBpmXml);
+ }
+ if (globalProcessScope!=null) {
+ portReference.addExtension(Constants.PROCESS_SCOPE_ATTR, globalProcessScope.toString());
+ }
+ final Token token = executionContext.getToken() ;
+ final long tokenId = token.getId();
+ portReference.addExtension(Constants.TOKEN_ID, String.valueOf(tokenId));
+ String nodeId = "";
+ if (executionContext.getNode()!=null) {
+ nodeId = String.valueOf(executionContext.getNode().getId());
+ portReference.addExtension(Constants.NODE_ID, nodeId);
+
+ }
+ portReference.addExtension(Constants.PROCESS_INSTANCE_ID, String.valueOf(executionContext.getProcessInstance().getId()));
+
+ String counterName = Constants.PROCESS_NODE_VERSION_COUNTER + nodeId + '_' + tokenId;
+ Long counter = Long.getLong(String.valueOf(executionContext.getVariable(counterName)));
+ if (counter!=null) {
+ counter = counter + 1;
+ } else {
+ counter = 0l;
+ }
+ //Adding to the jBPM variableMap
+ executionContext.getContextInstance().setVariableLocally(counterName, counter.toString(), token);
+ //Adding same value to the message
+ portReference.addExtension(counterName, counter.toString());
+ return replyTo;
+ }
+ /**
+ * Sets the faultTo EPR. This way jBPM can handle a failure in the ESB service by taking a
+ * exception (faultTo) transition.
+ * @param returnVars - XML fragment from the processdefinition.xml describing
+ * the mapping of ESB Message objects to the jBPM variableMap.
+ * @param executionContext of the currently invoked EsbActionHandler.
+ * @return the faultTo EPR of the JBpmCallbackService.
+ */
+ protected EPR createFaultTo(String esbToJBpmXml, Boolean globalProcessScope, ExecutionContext executionContext)
{
- if (null == esbCategoryName)
- throw new ConfigurationException(
- "Service category (esbCategoryName element) must not be null");
- if (null == esbServiceName)
- throw new ConfigurationException(
- "Service name (esbServiceName element) must not be null");
+ EPR faultTo = createReplyTo(esbToJBpmXml, globalProcessScope, executionContext);
+ if (!exceptionTransition.equals("condition")) {
+ PortReference portReference = faultTo.getAddr();
+ portReference.addExtension(Constants.TRANSITION_NAME, exceptionTransition);
+ }
+ return faultTo;
+ }
- Message template = MessageFactory.getInstance().getMessage();
- Call call = template.getHeader().getCall();
- call.setMessageID(new URI(UUID.randomUUID().toString()));
-
- Helper.setLongValue(template, Constants.TOKEN_ID, _token.getId());
- Node node = _token.getNode();
- if (null != node)
- Helper.setStringValue(template, Constants.CURRENT_NODE_NAME, node
- .getName());
-
- ProcessInstance instance = _token.getProcessInstance();
- Helper.setLongValue(template, Constants.PROCESS_INSTANCE_ID, instance
- .getId());
-
- ProcessDefinition process = instance.getProcessDefinition();
- Helper.setObjectValue(template, Constants.PROCESS_DEFINITION_NAME,
- process.getName());
- Helper.setIntValue(template, Constants.PROCESS_DEFINITION_VERSION,
- process.getVersion());
- Helper.setLongValue(template, Constants.PROCESS_DEFINITION_ID, process
- .getId());
-
- return template;
- } // ________________________________
-
+
}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,105 @@
+/*
+ * 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 org.apache.log4j.Logger;
+import org.dom4j.tree.DefaultElement;
+import org.jboss.internal.soa.esb.util.LRUCache;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.JBpmObjectMapper;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+/**
+ *
+ * Sends ESB messages to ESB services from jBPM in an asynchronous way
+ *
+ * <li/>esbCategoryName - for ESB registry lookup
+ * <li/>esbServiceName - for ESB registry lookup
+ *
+ * @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
+ *
+ */
+public class EsbNotifier implements ActionHandler
+{
+ private static final long serialVersionUID = 1L;
+ private transient Logger logger = Logger.getLogger(getClass());
+ private static transient LRUCache<String, ServiceInvoker> siCache = new LRUCache<String, ServiceInvoker>(20);
+ /**
+ * The ESB Service Category Name, specified in the processdefinition.xml
+ */
+ public String esbCategoryName;
+ /**
+ * The ESB Service Name, specified in the processdefinition.xml
+ */
+ public String esbServiceName;
+ /**
+ * Default setting of the process scope, can be overriden by setting the
+ * process-scope attribute on the mapping element.
+ */
+ public Boolean globalProcessScope;
+ /**
+ * XML element to specify the mapping of variables from jBPM to ESB.
+ */
+ public DefaultElement bpmToEsbVars;
+ /**
+ * Constructs an ESB Message and sends sends to the an ESB Service
+ * as defined in the processdefinition.xml.
+ */
+ public void execute (ExecutionContext executionContext) throws Exception
+ {
+ if (null == esbCategoryName) {
+ throw new ConfigurationException(
+ "Service category (esbCategoryName element) must not be null");
+ }
+ if (null == esbServiceName) {
+ throw new ConfigurationException(
+ "Service name (esbServiceName element) must not be null");
+ }
+ JBpmObjectMapper mapper = new JBpmObjectMapper();
+ Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, globalProcessScope, executionContext);
+ if (logger.isDebugEnabled()) logger.debug("Created ESB message=" + message);
+ getServiceInvoker().deliverAsync(message);
+ logger.debug("Message send successfully");
+ }
+ /**
+ * Caches the most recently used ServiceInvokers.
+ *
+ * @return a ServiceInvoker for the current esbService and esbCategoryName.
+ * @throws MessageDeliverException
+ */
+ private ServiceInvoker getServiceInvoker() throws MessageDeliverException
+ {
+ String key = esbCategoryName + esbServiceName;
+ if (siCache.containsKey(key)) {
+ return siCache.get(key);
+ } else {
+ ServiceInvoker invoker = new ServiceInvoker(esbCategoryName, esbServiceName);
+ siCache.put(key, invoker);
+ return invoker;
+ }
+ }
+
+}
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -22,67 +22,60 @@
package org.jboss.soa.esb.services.jbpm.actions;
+import org.apache.log4j.Logger;
import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.actions.ActionLifecycle;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.MessageFacadeFactory;
+import org.jboss.soa.esb.services.jbpm.cmd.Command;
+import org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor;
+import org.jboss.soa.esb.services.jbpm.cmd.MessageFacade;
/**
*
-* Extend CommandInterpreter by specializing it to a single jBPM command.
+* Processes a single jBPM command.
* Part of the message content will be taken from constructor time configuration
* (from the action configuration XML)
*
-* @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+* @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+* @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
*/
-public class BpmProcessor extends CommandInterpreter
+public class BpmProcessor implements ActionLifecycle
{
+ protected MessageFacade messageFacade;
+ protected ConfigTree configTree;
+ private static Logger _logger = Logger.getLogger(BpmProcessor.class);
- public static final String COMMAND_ATTRIBUTE_TAG = "command";
-
- public BpmProcessor(ConfigTree config) throws ConfigurationException
+ public void destroy() throws ActionLifecycleException
+ {
+ _logger.info("destroy() invoked");
+ }
+ public void initialise() throws ActionLifecycleException
+ {
+ _logger.info("initialise() invoked - config="+configTree);
+ try {
+ messageFacade = MessageFacade.getFacade(configTree);
+ } catch (ConfigurationException ce) {
+ throw new ActionLifecycleException(ce.getMessage(), ce);
+ }
+ }
+
+ public BpmProcessor(ConfigTree configTree) throws ConfigurationException
{
- super(config);
+ this.configTree = configTree;
}
- public Constants.OpCode getOpCode() { return _stuffer.getOpCode(); }
- @Override
- protected void checkMyParms() throws ConfigurationException
+
+ public Message process(Message message) throws ConfigurationException
{
- _stuffer = MessageFacadeFactory.getInstance().getPreProcessor(_config);
- } // _______________________________
-
- @Override
- public Message process(Message message)
- throws MalformedEPRException, CourierException, ActionProcessingException
- {
- message.getBody().add(Constants.COMMAND_CODE,getOpCode().toString());
- _stuffer.preFormat(message);
- Message response = super.process(message);
- return _stuffer.postFormat(response);
- } // _______________________________
-
- protected MessageFacade _stuffer;
- public interface MessageFacade
- {
- /**
- * Obtain the operation code that this preprocessor will force into the command message
- * @return Constants.OpCode
- */
- public Constants.OpCode getOpCode();
- /**
- * Some message values are fixed at action configuration time (from the jboss-esb.xml).
- * <br/>This method is responsible of stuffing these static values into every Message
- * before passing it to the generic CommandInterpreter process(Message) method
- * <br/>Some of the Message content will thus come from configuration XML, and some will
- * be the users' responsibility (e.g. processId, tokenId, etc)
- * <br/>Variable name mapping between esb and jBPM is also handled by this interface
- * @param message Message - Into which the static values will be added
- */
- public void preFormat(Message request);
- public Message postFormat(Message response);
+ message.getBody().add(Constants.COMMAND_CODE, messageFacade.getOpCode().toString());
+ messageFacade.setJBPMContextParameters(message);
+ CommandExecutor commandExecutor = CommandExecutor.getInstance();
+ String commandString = (String)message.getBody().get(Constants.COMMAND_CODE);
+ Command command = commandExecutor.getCommand(commandString);
+ command.execute(message);
+ return message;
}
+
}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,232 +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.actions;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycle;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionProcessingFaultException;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.CommandExecutorFactory;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.util.Helper;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmException;
-import org.jbpm.command.Command;
-import org.jbpm.command.CommandService;
-import org.jbpm.command.impl.CommandServiceImpl;
-
-/**
- *
- * jBPM command interpreter.
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public class CommandInterpreter implements ActionLifecycle
-{
- public void destroy() throws ActionLifecycleException {
- _logger.info("destroy() invoked");
- }
- public void initialise() throws ActionLifecycleException {
- _logger.info("initialise() invoked - config="+_config);
- if (null==_config)
- _config = new ConfigTree("autoGenerated");
-
- }
-
- public CommandInterpreter(ConfigTree config) throws ConfigurationException
- {
- _config = config;
- checkMyParms();
- } // ________________________________
-
- /**
- * If the end state is reached within a jBPM process, then the ESB will propagate back
- * an appropriate error message to the sender.
- *
- * @param message
- * @return
- * @throws MalformedEPRException
- * @throws CourierException
- * @throws ActionProcessingException
- */
-
- public Message process(Message message)
- throws MalformedEPRException, CourierException, ActionProcessingException
- {
- Message response = null;
- try
- {
- response = CommandExecutorFactory.getInstance().getExecutor(message).execute(message);
- }
- catch (JbpmException e)
- {
- _logger.error(e.getMessage(), e);
-
- if (endState(e))
- {
- _logger.info("End-state reached for jBPM process.");
-
- /*
- * Throw an exception so that the fault message can be
- * propagated back to the sender.
- */
-
- throw new ActionProcessingFaultException("jBPM end state reached!");
- }
- else
- throw new ActionProcessingException(e.getMessage(), e);
- }
- catch (Exception e)
- {
- _logger.error(e.getMessage(), e);
- throw new ActionProcessingException(e.getMessage(), e);
- }
-
- return response;
- } //________________________________
-
- public static Message doTheJob(Command command) throws JbpmException
- {
- Message response = Helper.commandMessageTemplate();
- Body body = response.getBody();
-
- try
- {
- Object obj = getJbpmCommandService().execute(command);
- body.add(Constants.RETURN_CODE, Constants.RETCODE_OK);
- if (null!=obj)
- body.add(Constants.JBPM_RETURN_OBJECT, obj);
- }
- catch (JbpmException e)
- {
- // why do we do this when response will clearly not be returned?!
- // http://jira.jboss.com/jira/browse/JBESB-1272
-
- body.add(Constants.RETURN_CODE, Constants.RETCODE_EXCEPTION);
- body.add(Constants.EXCEPTION, e);
- throw e;
- }
-
- return response;
- } //________________________________
-
- /**
- * Should this class need any extra configuration, this is the placeholder where to check
- * if configuration is OK.
- * @throws ConfigurationException
- */
- protected void checkMyParms() throws ConfigurationException
- {
- } // _______________________________
-
- /**
- * Encapsulate obtention of jBPM CommandService here
- * <br/>If it can't be cached, we only need to change this method.
- * @return CommandService
- */
- public static CommandService getJbpmCommandService()
- {
- if (null== s_jbpmService)
- synchronized (s_oSynch)
- {
- if (null!= s_jbpmService)
- return s_jbpmService;
-
- if (null==s_jbpmConfig)
- s_jbpmConfig = JbpmConfiguration.getInstance();
- s_jbpmService = new CommandServiceImpl(s_jbpmConfig);
- }
- return s_jbpmService;
- } //________________________________
-
- protected static JbpmConfiguration getJbpmConfig()
- {
- if (null== s_jbpmConfig)
- synchronized (s_oSynch)
- {
- if (null==s_jbpmConfig)
- s_jbpmConfig = JbpmConfiguration.getInstance();
- }
- return s_jbpmConfig;
- } //________________________________
-
- /**
- * Set an ad hoc jbpm configuration (generally used for testing)
- * @param xmlConfig String - The jbpm.cfg.xml compliant xml string
- * @throws Exception - If jbpm configuration was already set
- */
- public static void setJbpmConfig(String xmlConfig) throws Exception
- {
- if (null== s_jbpmConfig)
- synchronized (s_oSynch)
- {
- if (null==s_jbpmConfig)
- {
- s_jbpmConfig = JbpmConfiguration.getInstance(xmlConfig);
- return;
- }
- }
- throw new Exception("Jbpm configuration has already been set");
- } //________________________________
-
- protected ConfigTree _config;
- private static Logger _logger = Logger.getLogger(CommandInterpreter.class);
-
- private static final Object s_oSynch = new Integer(0);
- private static JbpmConfiguration s_jbpmConfig;
- private static CommandService s_jbpmService;
-
- private final String END_STATE = "couldn't signal token 'Token(/)' : node 'EndState(end-state1)'";
-
- /*
- * Would be nice if JbpmExceptions contained a fault code. Or had more subclasses
- * of JbpmException.
- */
-
- private final boolean endState (JbpmException ex)
- {
- Throwable thrw = ex;
-
- while (thrw != null)
- {
- if (thrw.getMessage().contains(END_STATE))
- return true;
- else
- thrw = thrw.getCause();
- }
-
- return false;
- }
-
- public interface CommandExecutor
- {
- public Message execute (Message message) throws Exception;
- }
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,72 @@
+/*
+ * 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.actions;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycle;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.cmd.Command;
+import org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor;
+
+/**
+* @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
+*/
+public class JBpmCallback implements ActionLifecycle
+{
+ public static final String JBPM_CALL_BACK_SERVICE_NAME = "JBpmCallbackService";
+ protected ConfigTree configTree;
+ private static Logger logger = Logger.getLogger(JBpmCallback.class);
+
+ public void destroy() throws ActionLifecycleException {
+ logger.info("destroy() invoked");
+ }
+ public void initialise() throws ActionLifecycleException {
+ logger.info("initialise() invoked - config="+configTree);
+ }
+
+ public JBpmCallback(ConfigTree configTree) throws ConfigurationException
+ {
+ this.configTree = configTree;
+ }
+ /**
+ *
+ * @param message
+ * @return
+ * @throws ActionProcessingException
+ */
+ public Message process(Message message) throws ConfigurationException
+ {
+ //Send a callback signal to jBPM
+ CommandExecutor commandExecutor = CommandExecutor.getInstance();
+ String commandString = Constants.OpCode.CallbackCommand.toString();
+ Command command = commandExecutor.getCommand(commandString);
+ command.execute(message);
+ return message;
+ }
+
+}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd)
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,347 +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.cmd;
-
-import java.util.Date;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.transaction.Synchronization;
-import javax.transaction.Transaction;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.common.TransactionStrategy;
-import org.jbpm.JbpmContext;
-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.job.executor.JobExecutor;
-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_" ;
- /**
- * The name of the ESB asynchronous signal transition variable.
- */
- private static final String ESB_ASYNC_SIGNAL_TRANSITION_VARIABLE_NAME = ESB_ASYNC_SIGNAL_VARIABLE_NAME + "TRANSITION_" ;
- /**
- * The name of the ESB asynchronous signal actor variable.
- */
- private static final String ESB_ASYNC_SIGNAL_ACTOR_VARIABLE_NAME = ESB_ASYNC_SIGNAL_VARIABLE_NAME + "ACTOR_" ;
- /**
- * The name of the ESB asynchronous signal variable count.
- */
- private static final String ESB_ASYNC_SIGNAL_VARIABLE_COUNT = ESB_ASYNC_SIGNAL_VARIABLE_NAME + "COUNT_" ;
- /**
- * The name of the ESB asynchronous signal variable names.
- */
- private static final String ESB_ASYNC_SIGNAL_VARIABLE_NAMES = ESB_ASYNC_SIGNAL_VARIABLE_NAME + "NAME_" ;
- /**
- * Map of active synchronisations.
- */
- private static final ConcurrentHashMap<Transaction, Synchronization> SYNCHRONISATIONS = new ConcurrentHashMap<Transaction, Synchronization>() ;
-
- /**
- * 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.
- * @param actor The actor to use.
- * @param variables Any variables to update.
- */
- static void createSignalJob(final JbpmContext jbpmContext, final Token token, final String transitionName, final String actor, final Map variables)
- {
- 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_TRANSITION_VARIABLE_NAME ;
- setVariable(contextInstance, token, transitionVariableName, transitionName) ;
- final String actorVariableName = ESB_ASYNC_SIGNAL_ACTOR_VARIABLE_NAME ;
- setVariable(contextInstance, token, actorVariableName, actor) ;
-
- final int numVariables = (variables == null ? 0 : variables.size()) ;
- setVariable(contextInstance, token, ESB_ASYNC_SIGNAL_VARIABLE_COUNT, Integer.toString(numVariables)) ;
- if (numVariables > 0)
- {
- int count = 0 ;
- final Iterator<Map.Entry> variableEntryIter = variables.entrySet().iterator() ;
- do
- {
- final Map.Entry variableEntry = variableEntryIter.next() ;
- final String name = variableEntry.getKey().toString() ;
- setVariable(contextInstance, token, name, variableEntry.getValue()) ;
- setVariable(contextInstance, token, ESB_ASYNC_SIGNAL_VARIABLE_NAMES + (count++), name) ;
- } while (variableEntryIter.hasNext()) ;
- }
-
- final ExecuteActionJob signalJob = new ExecuteActionJob(token) ;
- signalJob.setAction(getAsyncSignalAction(token)) ;
- signalJob.setDueDate(new Date()) ;
- signalJob.setSuspended(token.isSuspended()) ;
-
- if (isDebugEnabled)
- {
- logger.debug("Sending " + (token.isSuspended() ? "suspended " : "") +"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) ;
- }
-
- final TransactionStrategy transactionStrategy = TransactionStrategy.getTransactionStrategy(true) ;
- try
- {
- if (transactionStrategy.isActive())
- {
- final Transaction transaction = (Transaction)transactionStrategy.getTransaction() ;
- if ((transaction != null) && !SYNCHRONISATIONS.containsKey(transaction))
- {
- final Synchronization synch = new JobNotifierSynchronisation(transaction, jbpmContext.getJbpmConfiguration().getJobExecutor()) ;
- transaction.registerSynchronization(synch) ;
- SYNCHRONISATIONS.put(transaction, synch) ;
- }
- }
- }
- catch (final Exception ex)
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("Failed to register synchronization", ex) ;
- }
- }
- }
-
- /**
- * Set the context instance variable.
- * @param contextInstance The context instance.
- * @param token The current token.
- * @param name The variable name
- * @param value The variable value
- */
- private static void setVariable(final ContextInstance contextInstance, final Token token, final String name, final Object value)
- {
- if (value != null)
- {
- contextInstance.setVariableLocally(name, value, token) ;
- }
- else
- {
- contextInstance.deleteVariable(name, token) ;
- }
- }
-
- /**
- * 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.getVariableLocally(ESB_ASYNC_SIGNAL_TRANSITION_VARIABLE_NAME, token) ;
- final String actor = (String)contextInstance.getVariableLocally(ESB_ASYNC_SIGNAL_ACTOR_VARIABLE_NAME, token) ;
- final JbpmContext jbpmContext = executionContext.getJbpmContext() ;
- final String origActor = jbpmContext.getActorId() ;
-
- final int variableCount = Integer.parseInt((String)contextInstance.getVariableLocally(ESB_ASYNC_SIGNAL_VARIABLE_COUNT, token)) ;
- for(int count = 0 ; count < variableCount ; count++)
- {
- final String name = (String)contextInstance.getVariableLocally(ESB_ASYNC_SIGNAL_VARIABLE_NAMES + count, token) ;
- final Object value = contextInstance.getVariableLocally(name, token) ;
- contextInstance.setVariable(name, value) ;
- }
-
- try
- {
- if (actor != null)
- {
- jbpmContext.setActorId(actor) ;
- }
- final SignalCommand signalCommand = new SignalCommand(tokenId, transitionName) ;
- signalCommand.execute(jbpmContext) ;
- }
- finally
- {
- jbpmContext.setActorId(origActor) ;
- }
- if (isDebugEnabled)
- {
- logger.debug("Signalled task " + tokenId + " from process instance " +
- token.getProcessInstance().getId()) ;
- }
- }
- }
-
- /**
- * Synchronisation to notify the job executor.
- * @author kevin
- */
- private static final class JobNotifierSynchronisation implements Synchronization
- {
- /**
- * The associated transaction.
- */
- private Transaction transaction ;
- /**
- * The current job executor.
- */
- private final JobExecutor jobExecutor ;
-
- /**
- * Create the notifier synchronisation.
- * @param transaction The current transaction.
- * @param jobExecutor The current job executor.
- */
- public JobNotifierSynchronisation(final Transaction transaction, final JobExecutor jobExecutor)
- {
- this.transaction = transaction ;
- this.jobExecutor = jobExecutor ;
- }
-
- /**
- * The before completion notification.
- */
- public void beforeCompletion()
- {
- }
-
- /**
- * The after completion notification.
- * @param status The status of the transaction.
- */
- public void afterCompletion(final int status)
- {
- SYNCHRONISATIONS.remove(transaction) ;
- synchronized(jobExecutor)
- {
- jobExecutor.notify() ;
- }
- }
- }
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/AsyncProcessSignal.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,347 @@
+/*
+ * 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 java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.transaction.Synchronization;
+import javax.transaction.Transaction;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jbpm.JbpmContext;
+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.job.executor.JobExecutor;
+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_" ;
+ /**
+ * The name of the ESB asynchronous signal transition variable.
+ */
+ private static final String ESB_ASYNC_SIGNAL_TRANSITION_VARIABLE_NAME = ESB_ASYNC_SIGNAL_VARIABLE_NAME + "TRANSITION_" ;
+ /**
+ * The name of the ESB asynchronous signal actor variable.
+ */
+ private static final String ESB_ASYNC_SIGNAL_ACTOR_VARIABLE_NAME = ESB_ASYNC_SIGNAL_VARIABLE_NAME + "ACTOR_" ;
+ /**
+ * The name of the ESB asynchronous signal variable count.
+ */
+ private static final String ESB_ASYNC_SIGNAL_VARIABLE_COUNT = ESB_ASYNC_SIGNAL_VARIABLE_NAME + "COUNT_" ;
+ /**
+ * The name of the ESB asynchronous signal variable names.
+ */
+ private static final String ESB_ASYNC_SIGNAL_VARIABLE_NAMES = ESB_ASYNC_SIGNAL_VARIABLE_NAME + "NAME_" ;
+ /**
+ * Map of active synchronisations.
+ */
+ private static final ConcurrentHashMap<Transaction, Synchronization> SYNCHRONISATIONS = new ConcurrentHashMap<Transaction, Synchronization>() ;
+
+ /**
+ * 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.
+ * @param actor The actor to use.
+ * @param variables Any variables to update.
+ */
+ static void createSignalJob(final JbpmContext jbpmContext, final Token token, final String transitionName, final String actor, final Map variables)
+ {
+ 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_TRANSITION_VARIABLE_NAME ;
+ setVariable(contextInstance, token, transitionVariableName, transitionName) ;
+ final String actorVariableName = ESB_ASYNC_SIGNAL_ACTOR_VARIABLE_NAME ;
+ setVariable(contextInstance, token, actorVariableName, actor) ;
+
+ final int numVariables = (variables == null ? 0 : variables.size()) ;
+ setVariable(contextInstance, token, ESB_ASYNC_SIGNAL_VARIABLE_COUNT, Integer.toString(numVariables)) ;
+ if (numVariables > 0)
+ {
+ int count = 0 ;
+ final Iterator<Map.Entry> variableEntryIter = variables.entrySet().iterator() ;
+ do
+ {
+ final Map.Entry variableEntry = variableEntryIter.next() ;
+ final String name = variableEntry.getKey().toString() ;
+ setVariable(contextInstance, token, name, variableEntry.getValue()) ;
+ setVariable(contextInstance, token, ESB_ASYNC_SIGNAL_VARIABLE_NAMES + (count++), name) ;
+ } while (variableEntryIter.hasNext()) ;
+ }
+
+ final ExecuteActionJob signalJob = new ExecuteActionJob(token) ;
+ signalJob.setAction(getAsyncSignalAction(token)) ;
+ signalJob.setDueDate(new Date()) ;
+ signalJob.setSuspended(token.isSuspended()) ;
+
+ if (isDebugEnabled)
+ {
+ logger.debug("Sending " + (token.isSuspended() ? "suspended " : "") +"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) ;
+ }
+
+ final TransactionStrategy transactionStrategy = TransactionStrategy.getTransactionStrategy(true) ;
+ try
+ {
+ if (transactionStrategy.isActive())
+ {
+ final Transaction transaction = (Transaction)transactionStrategy.getTransaction() ;
+ if ((transaction != null) && !SYNCHRONISATIONS.containsKey(transaction))
+ {
+ final Synchronization synch = new JobNotifierSynchronisation(transaction, jbpmContext.getJbpmConfiguration().getJobExecutor()) ;
+ transaction.registerSynchronization(synch) ;
+ SYNCHRONISATIONS.put(transaction, synch) ;
+ }
+ }
+ }
+ catch (final Exception ex)
+ {
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("Failed to register synchronization", ex) ;
+ }
+ }
+ }
+
+ /**
+ * Set the context instance variable.
+ * @param contextInstance The context instance.
+ * @param token The current token.
+ * @param name The variable name
+ * @param value The variable value
+ */
+ private static void setVariable(final ContextInstance contextInstance, final Token token, final String name, final Object value)
+ {
+ if (value != null)
+ {
+ contextInstance.setVariableLocally(name, value, token) ;
+ }
+ else
+ {
+ contextInstance.deleteVariable(name, token) ;
+ }
+ }
+
+ /**
+ * 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.getVariableLocally(ESB_ASYNC_SIGNAL_TRANSITION_VARIABLE_NAME, token) ;
+ final String actor = (String)contextInstance.getVariableLocally(ESB_ASYNC_SIGNAL_ACTOR_VARIABLE_NAME, token) ;
+ final JbpmContext jbpmContext = executionContext.getJbpmContext() ;
+ final String origActor = jbpmContext.getActorId() ;
+
+ final int variableCount = Integer.parseInt((String)contextInstance.getVariableLocally(ESB_ASYNC_SIGNAL_VARIABLE_COUNT, token)) ;
+ for(int count = 0 ; count < variableCount ; count++)
+ {
+ final String name = (String)contextInstance.getVariableLocally(ESB_ASYNC_SIGNAL_VARIABLE_NAMES + count, token) ;
+ final Object value = contextInstance.getVariableLocally(name, token) ;
+ contextInstance.setVariable(name, value) ;
+ }
+
+ try
+ {
+ if (actor != null)
+ {
+ jbpmContext.setActorId(actor) ;
+ }
+ final SignalCommand signalCommand = new SignalCommand(tokenId, transitionName) ;
+ signalCommand.execute(jbpmContext) ;
+ }
+ finally
+ {
+ jbpmContext.setActorId(origActor) ;
+ }
+ if (isDebugEnabled)
+ {
+ logger.debug("Signalled task " + tokenId + " from process instance " +
+ token.getProcessInstance().getId()) ;
+ }
+ }
+ }
+
+ /**
+ * Synchronisation to notify the job executor.
+ * @author kevin
+ */
+ private static final class JobNotifierSynchronisation implements Synchronization
+ {
+ /**
+ * The associated transaction.
+ */
+ private Transaction transaction ;
+ /**
+ * The current job executor.
+ */
+ private final JobExecutor jobExecutor ;
+
+ /**
+ * Create the notifier synchronisation.
+ * @param transaction The current transaction.
+ * @param jobExecutor The current job executor.
+ */
+ public JobNotifierSynchronisation(final Transaction transaction, final JobExecutor jobExecutor)
+ {
+ this.transaction = transaction ;
+ this.jobExecutor = jobExecutor ;
+ }
+
+ /**
+ * The before completion notification.
+ */
+ public void beforeCompletion()
+ {
+ }
+
+ /**
+ * The after completion notification.
+ * @param status The status of the transaction.
+ */
+ public void afterCompletion(final int status)
+ {
+ SYNCHRONISATIONS.remove(transaction) ;
+ synchronized(jobExecutor)
+ {
+ jobExecutor.notify() ;
+ }
+ }
+ }
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,127 +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.cmd;
-
-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.Command;
-import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.graph.exe.Token;
-
-/**
- * @author kstam
- *
- */
-public class CallbackCommand implements Command {
-
- 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 EPR getCallbackEpr() {
- return callbackEpr;
- }
- public void setCallbackEpr(EPR callbackEpr) {
- 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 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.getVariableLocally(counterName, token)));
- if (isDebugEnabled) logger.debug("ProcessNodeVersion=" + currentProcessNodeVersion);
- if (processNodeVersion!=currentProcessNodeVersion) {
- throw new CallbackException("The current processNodeVersion (id=" + currentProcessNodeVersion +
- ") is not the expected version (version=" + processNodeVersion + ").");
- }
-
- AsyncProcessSignal.createSignalJob(jbpmContext, token, transitionName, jbpmContext.getActorId(), variables) ;
- } catch (CallbackException jbpmCe) {
- logger.warn(jbpmCe.getMessage());
- }
- return null;
- }
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,127 @@
+/*
+ * 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.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.Command;
+import org.jbpm.context.exe.ContextInstance;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+
+/**
+ * @author kstam
+ *
+ */
+public class CallbackCommand implements Command {
+
+ 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 EPR getCallbackEpr() {
+ return callbackEpr;
+ }
+ public void setCallbackEpr(EPR callbackEpr) {
+ 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 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.getVariableLocally(counterName, token)));
+ if (isDebugEnabled) logger.debug("ProcessNodeVersion=" + currentProcessNodeVersion);
+ if (processNodeVersion!=currentProcessNodeVersion) {
+ throw new CallbackException("The current processNodeVersion (id=" + currentProcessNodeVersion +
+ ") is not the expected version (version=" + processNodeVersion + ").");
+ }
+
+ AsyncProcessSignal.createSignalJob(jbpmContext, token, transitionName, jbpmContext.getActorId(), variables) ;
+ } catch (CallbackException jbpmCe) {
+ logger.warn(jbpmCe.getMessage());
+ }
+ return null;
+ }
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,60 +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.cmd;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * Configuration Exception.
- * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
- * @since Version 4.2
- */
-public class CallbackException extends BaseException {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Construct an exception instance.
- * @param message Exception message.
- */
- public CallbackException(String message) {
- super(message);
- }
-
- /**
- * Construct an exception instance.
- * @param message Exception message.
- * @param cause Exception cause.
- */
- public CallbackException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Construct an exception instance.
- * @param cause Exception cause.
- */
- public CallbackException(Throwable cause) {
- super(cause);
- }
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,60 @@
+/*
+ * 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 org.jboss.soa.esb.BaseException;
+
+/**
+ * Configuration Exception.
+ * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
+ * @since Version 4.2
+ */
+public class CallbackException extends BaseException {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Construct an exception instance.
+ * @param message Exception message.
+ */
+ public CallbackException(String message) {
+ super(message);
+ }
+
+ /**
+ * Construct an exception instance.
+ * @param message Exception message.
+ * @param cause Exception cause.
+ */
+ public CallbackException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Construct an exception instance.
+ * @param cause Exception cause.
+ */
+ public CallbackException(Throwable cause) {
+ super(cause);
+ }
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,49 +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.cmd;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
-
-/**
- *
- * Implementation of a message preprocessor to obtain data from a process instance
- * from the action configuration XML
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- */
-public class CancelProcessInstanceFacade extends MessageFacade
-{
- public OpCode getOpCode() { return Constants.OpCode.CancelProcessInstanceCommand; }
-
- public CancelProcessInstanceFacade(ConfigTree config) throws ConfigurationException
- {
- }
-
- public void setJBPMContextParameters(Message message)
- {
- }
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,49 @@
+/*
+ * 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 org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
+
+/**
+ *
+ * Implementation of a message preprocessor to obtain data from a process instance
+ * from the action configuration XML
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ */
+public class CancelProcessInstanceFacade extends MessageFacade
+{
+ public OpCode getOpCode() { return Constants.OpCode.CancelProcessInstanceCommand; }
+
+ public CancelProcessInstanceFacade(ConfigTree config) throws ConfigurationException
+ {
+ }
+
+ public void setJBPMContextParameters(Message message)
+ {
+ }
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,16 +0,0 @@
-/**
- *
- */
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import org.jboss.soa.esb.message.Message;
-import org.jbpm.JbpmException;
-
-/**
- * @author kstam
- *
- */
-public interface Command
-{
- public void execute (Message message) throws JbpmException;
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,16 @@
+/**
+ *
+ */
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import org.jboss.soa.esb.message.Message;
+import org.jbpm.JbpmException;
+
+/**
+ * @author kstam
+ *
+ */
+public interface Command
+{
+ public void execute (Message message) throws JbpmException;
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,285 +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.cmd;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.mapping.ObjectMapper;
-import org.jboss.soa.esb.message.mapping.ObjectMappingException;
-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.impl.CommandServiceImpl;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * Executes jBPM commands.
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
- *
- */
-public class CommandExecutor
-{
- static CommandExecutor commandExecutor;
-
- private static Logger logger = Logger.getLogger(CommandExecutor.class);
- private static JbpmConfiguration jbpmConfig;
- private static CommandService jbpmService;
-
- public static CommandExecutor getInstance()
- {
- if (commandExecutor==null) {
- commandExecutor =new CommandExecutor();
- }
- return commandExecutor;
- }
-
- public Command getCommand(String commandString) throws ConfigurationException
- {
- Constants.OpCode opCode = Constants.OpCode.valueOf(commandString);
- Command command = _values.get(opCode);
- if (null==command)
- throw new ConfigurationException(opCode.toString()+" not implemented,");
- return command;
- }
-
- protected static final Command CANCEL_PROCESS_INSTANCE_EXECUTOR = new Command()
- {
- public void execute(Message message) throws JbpmException
- {
- long processId = MessageHelper.getLongValue(message,Constants.PROCESS_INSTANCE_ID);
- logger.debug("Cancel Process Instance Command for ProcessId=" + processId);
- executeJbpmCommand(new CancelProcessInstanceCommand(processId));
- }
- };
-
- protected static final Command SIGNAL_EXECUTOR=new Command()
- {
- public void execute(Message message) throws JbpmException
- {
- SignalCommand command = new SignalCommand();
- Long tokenId = MessageHelper.getLongValue(message,Constants.TOKEN_ID);
- if (null== tokenId)
- {
- Long processInstanceId = MessageHelper.getLongValue(message,Constants.PROCESS_INSTANCE_ID);
- logger.debug("TokenId was not found, so try to obtain the root token from this process definition, " +
- " with ProcessId=" + processInstanceId);
- // now try with the process id (use root token)
- if (processInstanceId==null) {
- throw new JbpmException("Either <"+Constants.TOKEN_ID+"> or <"+Constants.PROCESS_INSTANCE_ID
- +"> object must be specified in Message body to know who to signal");
- }
- ProcessInstance inst = (ProcessInstance)getJbpmCommandService()
- .execute(new GetProcessInstanceCommand(processInstanceId));
- tokenId = inst.getRootToken().getId();
- }
- command.setTokenId(tokenId);
-
- String transition = MessageHelper.getStringValue(message, Constants.TRANSITION_NAME);
- if (null!=transition)
- command.setTransitionName(transition);
-
- //TODO allow for precise setting
- Map map = (Map)MessageHelper.getObjectValue(message, Constants.VARIABLE_VALUES);
- if (null!=map) command.setVariables(map);
-
- logger.debug("Signaling Process with TokenId=" + tokenId + ", Transition=" + transition + ", VariableMap=" + map);
- executeJbpmCommand(command);
- }
- };
-
- protected static final Command CALLBACK_EXECUTOR=new Command()
- {
- public void execute(Message message) throws JbpmException
- {
- CallbackCommand command = new CallbackCommand();
- EPR toEpr = message.getHeader().getCall().getTo();
- try {
- command.setCallbackEpr(toEpr);
- //Map the variables
- String esbToBpmXml = toEpr.getAddr().getExtensionValue(Constants.ESB_TO_BPM_VARS_TAG);
- JBpmObjectMapper mapper = new JBpmObjectMapper();
- //Obtaining the VariableMap that is going to be set callback command
- Map<String,Object> variableMap = mapper.mapFromEsbMessageToJBpmMap(message, esbToBpmXml);
- if (null!=variableMap) command.setVariables(variableMap);
- String transition = (toEpr.getAddr().getExtensionValue(Constants.TRANSITION_NAME));
- //The transition can be overriden if needed, by setting the following variable.
- String overriddenTransition = MessageHelper.getStringValue(message, Constants.TRANSITION_NAME);
- if (overriddenTransition!=null) {
- if (transition!=null) logger.debug("Overriding the transition to " + overriddenTransition);
- transition = overriddenTransition;
- }
- if (null!=transition) command.setTransitionName(transition);
- logger.debug("Signaling Process with Transition=" + transition + ", VariableMap=" + variableMap);
- executeJbpmCommand(command);
- } catch (ConfigurationException ce) {
- throw new JbpmException(ce.getMessage(), ce);
- }
- }
- };
-
- protected static Map<Constants.OpCode,Command> _values = new HashMap<Constants.OpCode,Command>();
- static
- {
- _values.put(Constants.OpCode.CallbackCommand ,CALLBACK_EXECUTOR);
- _values.put(Constants.OpCode.CancelProcessInstanceCommand,CANCEL_PROCESS_INSTANCE_EXECUTOR);
- _values.put(Constants.OpCode.SignalCommand ,SIGNAL_EXECUTOR);
- _values.put(Constants.OpCode.NewProcessInstanceCommand
- ,new CommandExecutor.NewProcessInstancePerformer(false));
- _values.put(Constants.OpCode.StartProcessInstanceCommand
- ,new CommandExecutor.NewProcessInstancePerformer(true));
- }
-
- // this class is used both for NewProcessInstance and for StartProcessInstance
- protected static final class NewProcessInstancePerformer implements Command
- {
- private boolean _start;
- public NewProcessInstancePerformer(boolean start) { _start = start; }
-
- public void execute(Message request) throws JbpmException
- {
- perform(request,_start);
- }
-
- private void perform(Message request, boolean start)
- {
- ObjectMapper objectMapper = new ObjectMapper();
- final NewProcessInstanceCommand command ;
- if (start) {
- final String transition = MessageHelper.getStringValue(request, Constants.TRANSITION_NAME);
- command = new AsyncStartProcessInstanceCommand(transition);
- } else {
- command = new NewProcessInstanceCommand();
- }
- Long processDefId = MessageHelper.getLongValue(request,Constants.PROCESS_DEFINITION_ID);
- if (null!=processDefId) {
- command.setProcessId(processDefId);
- } else {
- String processName = MessageHelper.getStringValue(request,Constants.PROCESS_DEFINITION_NAME);
- if (null!=processName) {
- command.setProcessName(processName);
- } else {
- throw new JbpmException("At least one of "+Constants.PROCESS_DEFINITION_NAME
- +" or "+Constants.PROCESS_DEFINITION_ID+" must have a valid value");
- }
- }
- String keyPath = MessageHelper.getStringValue(request, Constants.KEYPATH);
- if (keyPath!=null) {
- try {
- String key = String.valueOf(objectMapper.getObjectFromMessage(request, keyPath));
- command.setKey(key);
- } catch (ObjectMappingException e) {
- logger.error("Could not locate key " + e.getMessage(), e);
- }
- }
- String actorId=MessageHelper.getStringValue(request, Constants.ACTOR_ID);
- if (null!=actorId) command.setActorId(actorId);
- Boolean createStartTask = MessageHelper.getBooleanValue(request, Constants.CREATE_START_TASK);
- if (null!=createStartTask) command.setCreateStartTask(createStartTask);
- Map<String, Object> variables = MessageHelper.getVariablesMap(request, Constants.VARIABLE_VALUES);
- if (null!=variables) command.setVariables(variables);
-
- logger.debug("New process instance with command=" + command);
- executeJbpmCommand(command);
- }
- }
-
- private static void executeJbpmCommand(org.jbpm.command.Command command)
- {
- if (logger.isDebugEnabled()) {
- logger.debug(command);
- }
- getJbpmCommandService().execute(command);
- }
-
- /**
- * Encapsulate obtention of jBPM CommandService.
- * @return CommandService
- */
- public static CommandService getJbpmCommandService()
- {
- if (null== jbpmService) {
- jbpmConfig = JbpmConfiguration.getInstance();
- jbpmService = new CommandServiceImpl(jbpmConfig);
- }
- 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(jbpmContext, processInstance.getRootToken(), transitionName, getActorId(), null) ;
- }
- return result ;
- }
- }
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,285 @@
+/*
+ * 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.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.mapping.ObjectMapper;
+import org.jboss.soa.esb.message.mapping.ObjectMappingException;
+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.impl.CommandServiceImpl;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Executes jBPM commands.
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
+ *
+ */
+public class CommandExecutor
+{
+ static CommandExecutor commandExecutor;
+
+ private static Logger logger = Logger.getLogger(CommandExecutor.class);
+ private static JbpmConfiguration jbpmConfig;
+ private static CommandService jbpmService;
+
+ public static CommandExecutor getInstance()
+ {
+ if (commandExecutor==null) {
+ commandExecutor =new CommandExecutor();
+ }
+ return commandExecutor;
+ }
+
+ public Command getCommand(String commandString) throws ConfigurationException
+ {
+ Constants.OpCode opCode = Constants.OpCode.valueOf(commandString);
+ Command command = _values.get(opCode);
+ if (null==command)
+ throw new ConfigurationException(opCode.toString()+" not implemented,");
+ return command;
+ }
+
+ protected static final Command CANCEL_PROCESS_INSTANCE_EXECUTOR = new Command()
+ {
+ public void execute(Message message) throws JbpmException
+ {
+ long processId = MessageHelper.getLongValue(message,Constants.PROCESS_INSTANCE_ID);
+ logger.debug("Cancel Process Instance Command for ProcessId=" + processId);
+ executeJbpmCommand(new CancelProcessInstanceCommand(processId));
+ }
+ };
+
+ protected static final Command SIGNAL_EXECUTOR=new Command()
+ {
+ public void execute(Message message) throws JbpmException
+ {
+ SignalCommand command = new SignalCommand();
+ Long tokenId = MessageHelper.getLongValue(message,Constants.TOKEN_ID);
+ if (null== tokenId)
+ {
+ Long processInstanceId = MessageHelper.getLongValue(message,Constants.PROCESS_INSTANCE_ID);
+ logger.debug("TokenId was not found, so try to obtain the root token from this process definition, " +
+ " with ProcessId=" + processInstanceId);
+ // now try with the process id (use root token)
+ if (processInstanceId==null) {
+ throw new JbpmException("Either <"+Constants.TOKEN_ID+"> or <"+Constants.PROCESS_INSTANCE_ID
+ +"> object must be specified in Message body to know who to signal");
+ }
+ ProcessInstance inst = (ProcessInstance)getJbpmCommandService()
+ .execute(new GetProcessInstanceCommand(processInstanceId));
+ tokenId = inst.getRootToken().getId();
+ }
+ command.setTokenId(tokenId);
+
+ String transition = MessageHelper.getStringValue(message, Constants.TRANSITION_NAME);
+ if (null!=transition)
+ command.setTransitionName(transition);
+
+ //TODO allow for precise setting
+ Map map = (Map)MessageHelper.getObjectValue(message, Constants.VARIABLE_VALUES);
+ if (null!=map) command.setVariables(map);
+
+ logger.debug("Signaling Process with TokenId=" + tokenId + ", Transition=" + transition + ", VariableMap=" + map);
+ executeJbpmCommand(command);
+ }
+ };
+
+ protected static final Command CALLBACK_EXECUTOR=new Command()
+ {
+ public void execute(Message message) throws JbpmException
+ {
+ CallbackCommand command = new CallbackCommand();
+ EPR toEpr = message.getHeader().getCall().getTo();
+ try {
+ command.setCallbackEpr(toEpr);
+ //Map the variables
+ String esbToBpmXml = toEpr.getAddr().getExtensionValue(Constants.ESB_TO_BPM_VARS_TAG);
+ JBpmObjectMapper mapper = new JBpmObjectMapper();
+ //Obtaining the VariableMap that is going to be set callback command
+ Map<String,Object> variableMap = mapper.mapFromEsbMessageToJBpmMap(message, esbToBpmXml);
+ if (null!=variableMap) command.setVariables(variableMap);
+ String transition = (toEpr.getAddr().getExtensionValue(Constants.TRANSITION_NAME));
+ //The transition can be overriden if needed, by setting the following variable.
+ String overriddenTransition = MessageHelper.getStringValue(message, Constants.TRANSITION_NAME);
+ if (overriddenTransition!=null) {
+ if (transition!=null) logger.debug("Overriding the transition to " + overriddenTransition);
+ transition = overriddenTransition;
+ }
+ if (null!=transition) command.setTransitionName(transition);
+ logger.debug("Signaling Process with Transition=" + transition + ", VariableMap=" + variableMap);
+ executeJbpmCommand(command);
+ } catch (ConfigurationException ce) {
+ throw new JbpmException(ce.getMessage(), ce);
+ }
+ }
+ };
+
+ protected static Map<Constants.OpCode,Command> _values = new HashMap<Constants.OpCode,Command>();
+ static
+ {
+ _values.put(Constants.OpCode.CallbackCommand ,CALLBACK_EXECUTOR);
+ _values.put(Constants.OpCode.CancelProcessInstanceCommand,CANCEL_PROCESS_INSTANCE_EXECUTOR);
+ _values.put(Constants.OpCode.SignalCommand ,SIGNAL_EXECUTOR);
+ _values.put(Constants.OpCode.NewProcessInstanceCommand
+ ,new CommandExecutor.NewProcessInstancePerformer(false));
+ _values.put(Constants.OpCode.StartProcessInstanceCommand
+ ,new CommandExecutor.NewProcessInstancePerformer(true));
+ }
+
+ // this class is used both for NewProcessInstance and for StartProcessInstance
+ protected static final class NewProcessInstancePerformer implements Command
+ {
+ private boolean _start;
+ public NewProcessInstancePerformer(boolean start) { _start = start; }
+
+ public void execute(Message request) throws JbpmException
+ {
+ perform(request,_start);
+ }
+
+ private void perform(Message request, boolean start)
+ {
+ ObjectMapper objectMapper = new ObjectMapper();
+ final NewProcessInstanceCommand command ;
+ if (start) {
+ final String transition = MessageHelper.getStringValue(request, Constants.TRANSITION_NAME);
+ command = new AsyncStartProcessInstanceCommand(transition);
+ } else {
+ command = new NewProcessInstanceCommand();
+ }
+ Long processDefId = MessageHelper.getLongValue(request,Constants.PROCESS_DEFINITION_ID);
+ if (null!=processDefId) {
+ command.setProcessId(processDefId);
+ } else {
+ String processName = MessageHelper.getStringValue(request,Constants.PROCESS_DEFINITION_NAME);
+ if (null!=processName) {
+ command.setProcessName(processName);
+ } else {
+ throw new JbpmException("At least one of "+Constants.PROCESS_DEFINITION_NAME
+ +" or "+Constants.PROCESS_DEFINITION_ID+" must have a valid value");
+ }
+ }
+ String keyPath = MessageHelper.getStringValue(request, Constants.KEYPATH);
+ if (keyPath!=null) {
+ try {
+ String key = String.valueOf(objectMapper.getObjectFromMessage(request, keyPath));
+ command.setKey(key);
+ } catch (ObjectMappingException e) {
+ logger.error("Could not locate key " + e.getMessage(), e);
+ }
+ }
+ String actorId=MessageHelper.getStringValue(request, Constants.ACTOR_ID);
+ if (null!=actorId) command.setActorId(actorId);
+ Boolean createStartTask = MessageHelper.getBooleanValue(request, Constants.CREATE_START_TASK);
+ if (null!=createStartTask) command.setCreateStartTask(createStartTask);
+ Map<String, Object> variables = MessageHelper.getVariablesMap(request, Constants.VARIABLE_VALUES);
+ if (null!=variables) command.setVariables(variables);
+
+ logger.debug("New process instance with command=" + command);
+ executeJbpmCommand(command);
+ }
+ }
+
+ private static void executeJbpmCommand(org.jbpm.command.Command command)
+ {
+ if (logger.isDebugEnabled()) {
+ logger.debug(command);
+ }
+ getJbpmCommandService().execute(command);
+ }
+
+ /**
+ * Encapsulate obtention of jBPM CommandService.
+ * @return CommandService
+ */
+ public static CommandService getJbpmCommandService()
+ {
+ if (null== jbpmService) {
+ jbpmConfig = JbpmConfiguration.getInstance();
+ jbpmService = new CommandServiceImpl(jbpmConfig);
+ }
+ 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(jbpmContext, processInstance.getRootToken(), transitionName, getActorId(), null) ;
+ }
+ return result ;
+ }
+ }
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,81 +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.cmd;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.Mapping;
-
-public class ConfigUtil
-{
- static List<Mapping> getMappingConfig(ConfigTree tree)
- throws ConfigurationException
- {
- List<Mapping> mappingList = new ArrayList<Mapping>();
- ConfigTree[] esbToBpm = tree.getChildren(Constants.MAPPING_TAG);
- if (esbToBpm != null) {
- for (ConfigTree mappingElement : esbToBpm) {
- Mapping mapping = Mapping.parseMappingElement(mappingElement);
- mappingList.add(mapping);
- }
- }
- return mappingList;
- }
-
- static String[] actorsFromConfig(ConfigTree tree, boolean acceptValue)
- throws ConfigurationException
- {
- String tag = Constants.ACTORS_TAG;
- ConfigTree[] childs = tree.getChildren(tag);
- if (null==childs || childs.length<1)
- return null;
- if (childs.length>1)
- throw new ConfigurationException("Only one <"+tag
- +"> element allowed in configuration");
-
- tag = Constants.ONE_ACTOR_TAG;
- childs = childs[0].getChildren(tag);
- if (null==childs || childs.length<1)
- throw new ConfigurationException("At least one <"+tag
- +"> child element required for <"+Constants.VARIABLES_TAG+">");
- String[] ret = new String[childs.length];
- int i1=0;
- for (ConfigTree curr: childs)
- {
- String name = curr.getAttribute("name");
- if (null==name)
- {
- throw new ConfigurationException
- ("You must specify the 'name' attribute for all <"
- +tag+"> element");
- }
- ret[i1++] = name;
- }
- return ret;
- }
-
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,81 @@
+/*
+ * 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.ArrayList;
+import java.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.Mapping;
+
+public class ConfigUtil
+{
+ static List<Mapping> getMappingConfig(ConfigTree tree)
+ throws ConfigurationException
+ {
+ List<Mapping> mappingList = new ArrayList<Mapping>();
+ ConfigTree[] esbToBpm = tree.getChildren(Constants.MAPPING_TAG);
+ if (esbToBpm != null) {
+ for (ConfigTree mappingElement : esbToBpm) {
+ Mapping mapping = Mapping.parseMappingElement(mappingElement);
+ mappingList.add(mapping);
+ }
+ }
+ return mappingList;
+ }
+
+ static String[] actorsFromConfig(ConfigTree tree, boolean acceptValue)
+ throws ConfigurationException
+ {
+ String tag = Constants.ACTORS_TAG;
+ ConfigTree[] childs = tree.getChildren(tag);
+ if (null==childs || childs.length<1)
+ return null;
+ if (childs.length>1)
+ throw new ConfigurationException("Only one <"+tag
+ +"> element allowed in configuration");
+
+ tag = Constants.ONE_ACTOR_TAG;
+ childs = childs[0].getChildren(tag);
+ if (null==childs || childs.length<1)
+ throw new ConfigurationException("At least one <"+tag
+ +"> child element required for <"+Constants.VARIABLES_TAG+">");
+ String[] ret = new String[childs.length];
+ int i1=0;
+ for (ConfigTree curr: childs)
+ {
+ String name = curr.getAttribute("name");
+ if (null==name)
+ {
+ throw new ConfigurationException
+ ("You must specify the 'name' attribute for all <"
+ +tag+"> element");
+ }
+ ret[i1++] = name;
+ }
+ return ret;
+ }
+
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,57 +0,0 @@
-/**
- *
- */
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-
-/**
- * @author kstam
- *
- */
-public abstract class MessageFacade
-{
- /**
- * Obtain the operation code that this preprocessor will force into the command message
- * @return Constants.OpCode
- */
- public abstract Constants.OpCode getOpCode();
- /**
- * Some message values are fixed at action configuration time (from the jboss-esb.xml).
- * <br/>This method is responsible of stuffing these static values into every Message
- * before passing it to the generic CommandInterpreter process(Message) method
- * <br/>Some of the Message content will thus come from configuration XML, and some will
- * be the users' responsibility (e.g. processId, tokenId, etc)
- * <br/>Variable name mapping between esb and jBPM is also handled by this interface
- * @param message Message - Into which the static values will be added
- */
- public abstract void setJBPMContextParameters(Message request);
-
-
- public static MessageFacade getFacade(ConfigTree config)
- throws ConfigurationException, UnsupportedOperationException
- {
- Constants.OpCode opCode = null;
- String sAux = config.getRequiredAttribute(Constants.COMMAND_CODE_TAG);
- try {
- opCode = Constants.OpCode.valueOf(sAux);
- } catch (IllegalArgumentException e) {
- throw new ConfigurationException("Attribute '"+Constants.COMMAND_CODE_TAG+"' has an invalid value"
- +"- see CommandVehicle.Operation enum for possible values");
- }
-
- if (Constants.OpCode.CancelProcessInstanceCommand.equals(opCode))
- return new CancelProcessInstanceFacade(config);
- if (Constants.OpCode.NewProcessInstanceCommand.equals(opCode))
- return new NewProcessInstanceFacade(config, false);
- if (Constants.OpCode.SignalCommand.equals(opCode))
- return new SignalFacade(config);
- if (Constants.OpCode.StartProcessInstanceCommand.equals(opCode))
- return new NewProcessInstanceFacade(config, true);
-
- throw new UnsupportedOperationException(opCode.toString()+" not implemented");
- }
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,57 @@
+/**
+ *
+ */
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+
+/**
+ * @author kstam
+ *
+ */
+public abstract class MessageFacade
+{
+ /**
+ * Obtain the operation code that this preprocessor will force into the command message
+ * @return Constants.OpCode
+ */
+ public abstract Constants.OpCode getOpCode();
+ /**
+ * Some message values are fixed at action configuration time (from the jboss-esb.xml).
+ * <br/>This method is responsible of stuffing these static values into every Message
+ * before passing it to the generic CommandInterpreter process(Message) method
+ * <br/>Some of the Message content will thus come from configuration XML, and some will
+ * be the users' responsibility (e.g. processId, tokenId, etc)
+ * <br/>Variable name mapping between esb and jBPM is also handled by this interface
+ * @param message Message - Into which the static values will be added
+ */
+ public abstract void setJBPMContextParameters(Message request);
+
+
+ public static MessageFacade getFacade(ConfigTree config)
+ throws ConfigurationException, UnsupportedOperationException
+ {
+ Constants.OpCode opCode = null;
+ String sAux = config.getRequiredAttribute(Constants.COMMAND_CODE_TAG);
+ try {
+ opCode = Constants.OpCode.valueOf(sAux);
+ } catch (IllegalArgumentException e) {
+ throw new ConfigurationException("Attribute '"+Constants.COMMAND_CODE_TAG+"' has an invalid value"
+ +"- see CommandVehicle.Operation enum for possible values");
+ }
+
+ if (Constants.OpCode.CancelProcessInstanceCommand.equals(opCode))
+ return new CancelProcessInstanceFacade(config);
+ if (Constants.OpCode.NewProcessInstanceCommand.equals(opCode))
+ return new NewProcessInstanceFacade(config, false);
+ if (Constants.OpCode.SignalCommand.equals(opCode))
+ return new SignalFacade(config);
+ if (Constants.OpCode.StartProcessInstanceCommand.equals(opCode))
+ return new NewProcessInstanceFacade(config, true);
+
+ throw new UnsupportedOperationException(opCode.toString()+" not implemented");
+ }
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,148 +0,0 @@
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-/**
- * Convient Helper to set or set parameters on an EsbMessage.
- * @author kstam
- *
- */
-public class MessageHelper
-{
- private static Logger _logger = Logger.getLogger(MessageHelper.class);
-
- public static String argumentException(String str)
- {
- return new String("Missing or invalid <"+str+"> object in Message body");
- }
-
- public static Message commandMessageTemplate()
- {
- Message template = MessageFactory.getInstance().getMessage();
- URI uri = null;
- try { uri = new URI(UUID.randomUUID().toString()); }
- catch (URISyntaxException e)
- {
- _logger.fatal("Problem with UUID.randomUUID() - This should not happen");
- return null;
- }
- template.getHeader().getCall().setMessageID(uri);
-
- return template;
- }
-
- public static void setLongValue(Message message, String key, Long value)
- {
- setObjectValue(message, key, value);
- }
- public static void setIntValue(Message message, String key, Integer value)
- {
- setObjectValue(message, key, value);
- }
- public static void setBooleanValue(Message message, String key, Boolean value)
- {
- setObjectValue(message, key, value);
- }
- public static void setObjectValue(Message message, String key, Object value)
- {
- message.getBody().add(key, value);
- }
-
- public static void setStringValue(Message msg,String key,Object obj)
- {
- setStringValue(msg, key, obj.toString());
- }
-
- public static void setStringValue(Message msg,String key,String str)
- {
- setObjectValue(msg, key, str);
- }
-
- public static void setStringListValue(Message msg,String key,String[] list)
- {
- boolean addComma = false;
- StringBuilder sb = new StringBuilder();
- for (String curr : list)
- {
- sb.append((addComma)?",":"").append(curr);
- addComma = true;
- }
- setObjectValue(msg,key, sb.toString());
- }
-
- public static void setVariablesMap(Message msg,String key,Map<String,Object> value)
- {
- msg.getBody().add(key, value);
- }
-
- public static Integer getIntValue(Message msg,String key)
- {
- Object obj = msg.getBody().get(key);
- if (obj instanceof Integer) return (Integer)obj;
- if (obj instanceof String) return Integer.parseInt((String)obj);
- _logger.error(argumentException(key));
- return null;
- }
-
- public static Long getLongValue(Message msg,String key)
- {
- Object obj = msg.getBody().get(key);
- if (null==obj) return null;
- if (obj instanceof Long) return (Long)obj;
- if (obj instanceof String) return Long.parseLong((String)obj);
- if (obj instanceof Integer) return new Long(obj.toString());
- _logger.error(argumentException(key));
- return null;
- }
-
- public static Boolean getBooleanValue(Message msg,String key)
- {
- return getBooleanValue(msg, key, null);
- }
-
- public static Boolean getBooleanValue(Message msg,String key, Boolean dflt)
- {
- Object obj = msg.getBody().get(key);
- if (null==obj) return dflt;
- if (obj instanceof Boolean) return (Boolean)obj;
- if (obj instanceof String) return Boolean.parseBoolean((String)obj);
- _logger.error(argumentException(key));
- return null;
- }
-
- public static String getStringValue(Message msg,String key)
- {
- return getStringValue(msg, key, null);
- }
-
- public static String getStringValue(Message msg,String key, String dflt)
- {
- Object obj = msg.getBody().get(key);
- if (null==obj) return dflt;
- if (obj instanceof String) return (String)obj;
- _logger.error(argumentException(key));
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public static Map<String,Object>getVariablesMap(Message msg,String key)
- {
- Object obj = msg.getBody().get(key);
- if (null==obj) return null;
- if (obj instanceof Map) return (Map<String,Object>)obj;
- _logger.error(argumentException(key));
- return null;
- }
-
- public static Object getObjectValue(Message msg,String key)
- {
- return msg.getBody().get(key);
- }
-
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,148 @@
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+/**
+ * Convient Helper to set or set parameters on an EsbMessage.
+ * @author kstam
+ *
+ */
+public class MessageHelper
+{
+ private static Logger _logger = Logger.getLogger(MessageHelper.class);
+
+ public static String argumentException(String str)
+ {
+ return new String("Missing or invalid <"+str+"> object in Message body");
+ }
+
+ public static Message commandMessageTemplate()
+ {
+ Message template = MessageFactory.getInstance().getMessage();
+ URI uri = null;
+ try { uri = new URI(UUID.randomUUID().toString()); }
+ catch (URISyntaxException e)
+ {
+ _logger.fatal("Problem with UUID.randomUUID() - This should not happen");
+ return null;
+ }
+ template.getHeader().getCall().setMessageID(uri);
+
+ return template;
+ }
+
+ public static void setLongValue(Message message, String key, Long value)
+ {
+ setObjectValue(message, key, value);
+ }
+ public static void setIntValue(Message message, String key, Integer value)
+ {
+ setObjectValue(message, key, value);
+ }
+ public static void setBooleanValue(Message message, String key, Boolean value)
+ {
+ setObjectValue(message, key, value);
+ }
+ public static void setObjectValue(Message message, String key, Object value)
+ {
+ message.getBody().add(key, value);
+ }
+
+ public static void setStringValue(Message msg,String key,Object obj)
+ {
+ setStringValue(msg, key, obj.toString());
+ }
+
+ public static void setStringValue(Message msg,String key,String str)
+ {
+ setObjectValue(msg, key, str);
+ }
+
+ public static void setStringListValue(Message msg,String key,String[] list)
+ {
+ boolean addComma = false;
+ StringBuilder sb = new StringBuilder();
+ for (String curr : list)
+ {
+ sb.append((addComma)?",":"").append(curr);
+ addComma = true;
+ }
+ setObjectValue(msg,key, sb.toString());
+ }
+
+ public static void setVariablesMap(Message msg,String key,Map<String,Object> value)
+ {
+ msg.getBody().add(key, value);
+ }
+
+ public static Integer getIntValue(Message msg,String key)
+ {
+ Object obj = msg.getBody().get(key);
+ if (obj instanceof Integer) return (Integer)obj;
+ if (obj instanceof String) return Integer.parseInt((String)obj);
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ public static Long getLongValue(Message msg,String key)
+ {
+ Object obj = msg.getBody().get(key);
+ if (null==obj) return null;
+ if (obj instanceof Long) return (Long)obj;
+ if (obj instanceof String) return Long.parseLong((String)obj);
+ if (obj instanceof Integer) return new Long(obj.toString());
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ public static Boolean getBooleanValue(Message msg,String key)
+ {
+ return getBooleanValue(msg, key, null);
+ }
+
+ public static Boolean getBooleanValue(Message msg,String key, Boolean dflt)
+ {
+ Object obj = msg.getBody().get(key);
+ if (null==obj) return dflt;
+ if (obj instanceof Boolean) return (Boolean)obj;
+ if (obj instanceof String) return Boolean.parseBoolean((String)obj);
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ public static String getStringValue(Message msg,String key)
+ {
+ return getStringValue(msg, key, null);
+ }
+
+ public static String getStringValue(Message msg,String key, String dflt)
+ {
+ Object obj = msg.getBody().get(key);
+ if (null==obj) return dflt;
+ if (obj instanceof String) return (String)obj;
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Map<String,Object>getVariablesMap(Message msg,String key)
+ {
+ Object obj = msg.getBody().get(key);
+ if (null==obj) return null;
+ if (obj instanceof Map) return (Map<String,Object>)obj;
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ public static Object getObjectValue(Message msg,String key)
+ {
+ return msg.getBody().get(key);
+ }
+
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,99 +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.cmd;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.JBpmObjectMapper;
-import org.jboss.soa.esb.services.jbpm.Mapping;
-import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
-
-/**
- *
- * Implementation of a message preprocessor to obtain data from a process instance
- * from the action configuration XML
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- */
-public class NewProcessInstanceFacade extends MessageFacade
-{
- public OpCode getOpCode()
- {
- return (_start)
- ?Constants.OpCode.StartProcessInstanceCommand
- :Constants.OpCode.NewProcessInstanceCommand;
- }
-
- public NewProcessInstanceFacade(ConfigTree config, boolean start) throws ConfigurationException
- {
- _start = start;
- _actor = config.getAttribute(Constants.ONE_ACTOR_TAG);
- _processName= config.getAttribute(Constants.PROCESS_DEFINITION_NAME_TAG);
- _keyPath = config.getAttribute(Constants.KEY_TAG);
- String pId = config.getAttribute(Constants.PROCESS_DEFINITION_ID_TAG);
- if (null!=pId) {
- try {
- _processId = Long.parseLong(pId);
- } catch(NumberFormatException e) {
- throw new ConfigurationException("Invalid value for '"+Constants.PROCESS_DEFINITION_ID_TAG+"'");
- }
- }
- _esbToBpm = ConfigUtil.getMappingConfig(config);
- if (_start) {
- _transitionName = config.getAttribute(Constants.TRANSITION_NAME_TAG);
- }
- }
-
- public void setJBPMContextParameters(Message message)
- {
- Body body = message.getBody();
- if (null!=_keyPath)
- body.add(Constants.KEYPATH, _keyPath);
- if (null!=_actor)
- body.add(Constants.ACTOR_ID ,_actor);
- if (null!=_processName)
- body.add(Constants.PROCESS_DEFINITION_NAME ,_processName);
- if (null!=_processId)
- body.add(Constants.PROCESS_DEFINITION_ID ,_processId);
- if (null!=_transitionName)
- body.add(Constants.TRANSITION_NAME, _transitionName);
- Map<String,Object> variableMap = _mapper.mapFromEsbMessageToJBpmMap(message,_esbToBpm);
- if (null!=variableMap)
- body.add(Constants.VARIABLE_VALUES, variableMap);
- }
-
- boolean _start;
- String _keyPath;
- String _actor;
- String _processName;
- String _transitionName;
- Long _processId;
- List<Mapping> _esbToBpm;
- JBpmObjectMapper _mapper = new JBpmObjectMapper();
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,99 @@
+/*
+ * 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.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.JBpmObjectMapper;
+import org.jboss.soa.esb.services.jbpm.Mapping;
+import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
+
+/**
+ *
+ * Implementation of a message preprocessor to obtain data from a process instance
+ * from the action configuration XML
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ */
+public class NewProcessInstanceFacade extends MessageFacade
+{
+ public OpCode getOpCode()
+ {
+ return (_start)
+ ?Constants.OpCode.StartProcessInstanceCommand
+ :Constants.OpCode.NewProcessInstanceCommand;
+ }
+
+ public NewProcessInstanceFacade(ConfigTree config, boolean start) throws ConfigurationException
+ {
+ _start = start;
+ _actor = config.getAttribute(Constants.ONE_ACTOR_TAG);
+ _processName= config.getAttribute(Constants.PROCESS_DEFINITION_NAME_TAG);
+ _keyPath = config.getAttribute(Constants.KEY_TAG);
+ String pId = config.getAttribute(Constants.PROCESS_DEFINITION_ID_TAG);
+ if (null!=pId) {
+ try {
+ _processId = Long.parseLong(pId);
+ } catch(NumberFormatException e) {
+ throw new ConfigurationException("Invalid value for '"+Constants.PROCESS_DEFINITION_ID_TAG+"'");
+ }
+ }
+ _esbToBpm = ConfigUtil.getMappingConfig(config);
+ if (_start) {
+ _transitionName = config.getAttribute(Constants.TRANSITION_NAME_TAG);
+ }
+ }
+
+ public void setJBPMContextParameters(Message message)
+ {
+ Body body = message.getBody();
+ if (null!=_keyPath)
+ body.add(Constants.KEYPATH, _keyPath);
+ if (null!=_actor)
+ body.add(Constants.ACTOR_ID ,_actor);
+ if (null!=_processName)
+ body.add(Constants.PROCESS_DEFINITION_NAME ,_processName);
+ if (null!=_processId)
+ body.add(Constants.PROCESS_DEFINITION_ID ,_processId);
+ if (null!=_transitionName)
+ body.add(Constants.TRANSITION_NAME, _transitionName);
+ Map<String,Object> variableMap = _mapper.mapFromEsbMessageToJBpmMap(message,_esbToBpm);
+ if (null!=variableMap)
+ body.add(Constants.VARIABLE_VALUES, variableMap);
+ }
+
+ boolean _start;
+ String _keyPath;
+ String _actor;
+ String _processName;
+ String _transitionName;
+ Long _processId;
+ List<Mapping> _esbToBpm;
+ JBpmObjectMapper _mapper = new JBpmObjectMapper();
+}
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,67 +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.cmd;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.JBpmObjectMapper;
-import org.jboss.soa.esb.services.jbpm.Mapping;
-import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
-
-/**
- *
- * Implementation of a message preprocessor to obtain data from a process instance
- * from the action configuration XML
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- */
-public class SignalFacade extends MessageFacade
-{
- public OpCode getOpCode() { return Constants.OpCode.SignalCommand; }
-
- public SignalFacade(ConfigTree config) throws ConfigurationException
- {
- _transition = config.getAttribute(Constants.TRANSITION_NAME_TAG);
- _esbToBpm = ConfigUtil.getMappingConfig(config);
- }
-
- public void setJBPMContextParameters(Message message)
- {
- Body body = message.getBody();
- if (null!=_transition)
- body.add(Constants.TRANSITION_NAME, _transition);
- Map<String,Object> variableMap = _mapper.mapFromEsbMessageToJBpmMap(message, _esbToBpm);
- if (null!=variableMap)
- body.add(Constants.VARIABLE_VALUES, variableMap);
- }
-
- String _transition;
- List<Mapping> _esbToBpm;
- JBpmObjectMapper _mapper = new JBpmObjectMapper();
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,67 @@
+/*
+ * 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.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.JBpmObjectMapper;
+import org.jboss.soa.esb.services.jbpm.Mapping;
+import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
+
+/**
+ *
+ * Implementation of a message preprocessor to obtain data from a process instance
+ * from the action configuration XML
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ */
+public class SignalFacade extends MessageFacade
+{
+ public OpCode getOpCode() { return Constants.OpCode.SignalCommand; }
+
+ public SignalFacade(ConfigTree config) throws ConfigurationException
+ {
+ _transition = config.getAttribute(Constants.TRANSITION_NAME_TAG);
+ _esbToBpm = ConfigUtil.getMappingConfig(config);
+ }
+
+ public void setJBPMContextParameters(Message message)
+ {
+ Body body = message.getBody();
+ if (null!=_transition)
+ body.add(Constants.TRANSITION_NAME, _transition);
+ Map<String,Object> variableMap = _mapper.mapFromEsbMessageToJBpmMap(message, _esbToBpm);
+ if (null!=variableMap)
+ body.add(Constants.VARIABLE_VALUES, variableMap);
+ }
+
+ String _transition;
+ List<Mapping> _esbToBpm;
+ JBpmObjectMapper _mapper = new JBpmObjectMapper();
+}
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/resources/META-INF/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/resources/META-INF/deployment.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/resources/META-INF/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbossesb-deployment>
<depends>jboss.esb:deployment=jbossesb.esb</depends>
+ <depends>jboss.jca:service=DataSourceBinding,name=JbpmDS</depends>
</jbossesb-deployment>
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,4 +1,34 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
+ <!--
+ jbossesb internal services
+ -->
+ <providers>
+ <!-- change the following element to jms-jca-provider to enable transactional context -->
+ <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-jca-provider>
+ </providers>
+
+ <services>
+ <service category="JBossESB-Internal"
+ name="JBpmCallbackService"
+ description="Service which makes Callbacks into jBPM">
+ <listeners>
+ <jms-listener name="JMS-DCQListener"
+ busidref="jBPMCallbackBus"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions mep="OneWay">
+ <action name="action" class="org.jboss.soa.esb.services.jbpm.actions.JBpmCallback"/>
+ </actions>
+ </service>
+ </services>
+
</jbossesb>
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/resources/hibernate.cfg.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/resources/hibernate.cfg.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/resources/hibernate.cfg.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -27,15 +27,15 @@
<!-- ==== DataSource properties (end) -->
<!-- JTA transaction properties (begin) ===
+ ==== JTA transaction properties (end) -->
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
- ==== JTA transaction properties (end) -->
-
+
<!-- CMT transaction properties (begin) ===
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
- ==== CMT transaction properties (end) -->
-
+ ==== CMT transaction properties (end) -->
+
<!-- logging properties (begin) ===
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbm-queue-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/resources/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbm-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.destination:service=Queue,name=CallbackQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+</server>
Copied: labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbmq-queue-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/main/resources/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbmq-queue-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.destination:service=Queue,name=CallbackQueue">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm-ds.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm-ds.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm-ds.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,22 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
+<!--
+ <xa-datasource>
+ <jndi-name>JbpmDS</jndi-name>
+ <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;MVCC=TRUE</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=h2,database=jbpmDB</depends>
+ </xa-datasource>
+-->
<local-tx-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>
+ <connection-url>jdbc:h2:${jboss.server.data.dir}${/}h2${/}jbpmDB;MVCC=TRUE</connection-url>
+ <driver-class>org.h2.Driver</driver-class>
<user-name>sa</user-name>
- <password></password>
+ <password/>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<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>
+ <depends>jboss:service=h2,database=jbpmDB</depends>
</local-tx-datasource>
- <mbean code="org.jboss.jdbc.HypersonicDatabase"
- name="jboss:service=Hypersonic,database=jbpmDB">
+ <mbean code="org.jboss.internal.soa.esb.dependencies.H2Database"
+ name="jboss:service=h2,database=jbpmDB">
<attribute name="Database">jbpmDB</attribute>
- <attribute name="InProcessMode">true</attribute>
</mbean>
-
</datasources>
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm-service.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm-service.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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"
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm.cfg.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm.cfg.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/resources/jbpm.cfg.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,9 +1,62 @@
<jbpm-configuration>
<!--
- The default configurations can be found in org/jbpm/default.jbpm.cfg.xml
- Those configurations can be overwritten by putting this file called
- jbpm.cfg.xml on the root of the classpath and put in the customized values.
+ This configuration is used when there is no jbpm.cfg.xml file found in the
+ root of the classpath. It is a very basic configuration without persistence
+ and message services. Only the authorization service installed.
+ You can parse and create processes, but when you try to use one of the
+ unavailable services, you'll get an exception.
-->
+
+ <jbpm-context>
+ <service name="persistence">
+ <factory>
+ <bean class="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory">
+ <field name="isTransactionEnabled"><false/></field>
+ <field name="isCurrentSessionEnabled"><true/></field>
+ <!--field name="sessionFactoryJndiName">
+ <string value="java:/myHibSessFactJndiName" />
+ </field-->
+ </bean>
+ </factory>
+ </service>
+ <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
+ <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
+ <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
+ <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
+ <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
+ </jbpm-context>
+ <!-- configuration property used by persistence service impl org.jbpm.persistence.db.DbPersistenceServiceFactory -->
+ <string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" />
+
+ <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
+ <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
+ <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
+ <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
+ <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
+ <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
+ <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
+ <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
+ <string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
+
+ <int name="jbpm.byte.block.size" value="1024" singleton="true" />
+ <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
+ <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
+ <string name="jbpm.mail.smtp.host" value="localhost" />
+ <bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
+ <string name="jbpm.mail.from.address" value="jbpm at noreply" />
+
+ <bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor">
+ <field name="jbpmConfiguration"><ref bean="jbpmConfiguration" /></field>
+ <field name="name"><string value="JbpmJobExector" /></field>
+ <field name="nbrOfThreads"><int value="1" /></field>
+ <field name="idleInterval"><int value="5000" /></field>
+ <field name="maxIdleInterval"><int value="3600000" /></field> <!-- 1 hour -->
+ <field name="historyMaxSize"><int value="20" /></field>
+ <field name="maxLockTime"><int value="600000" /></field> <!-- 10 minutes -->
+ <field name="lockMonitorInterval"><int value="60000" /></field> <!-- 1 minute -->
+ <field name="lockBufferTime"><int value="5000" /></field> <!-- 5 seconds -->
+ </bean>
+
</jbpm-configuration>
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,209 @@
+/*
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+import org.dom4j.tree.DefaultElement;
+import org.jboss.soa.esb.message.Message;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.def.Transition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+import org.junit.BeforeClass;
+import org.junit.Test;
+/**
+ * Tests the capabilities of the JBpmObjectMapper.
+ *
+ * @author kstam
+ *
+ */
+public class JBpmObjectMapperTest
+{
+ private static String PROCESS_DEF_XML = "JBpmObjectMapperTestProcessDefinition.xml";
+ private static Logger logger = Logger.getLogger(JBpmObjectMapperTest.class);
+ private static ProcessInstance processInstance = null;
+
+ @BeforeClass
+ public static void setup()
+ {
+ logger.info("Setting up jBPM");
+ //Extract a process definition from the processdefinition.xml file.
+ ProcessDefinition processDefinition
+ = ProcessDefinition.parseXmlResource(PROCESS_DEF_XML);
+ assertNotNull(processDefinition);
+ //Create an instance of the process definition.
+ processInstance = new ProcessInstance(processDefinition);
+ assertTrue(
+ "Instance is in start state",
+ "start".equals(processInstance.getRootToken().getNode().getName()));
+ }
+
+ /**
+ * Tests obtaining variables from the jBPM variableMap and setting them on the EsbMessage.
+ * We are making sure the jBPM -> EsbMessage works using
+ *
+ * <pre>
+ * <jbpmToEsbVars>
+ * <mapping jbpm="v1" esb="esbObj1" />
+ * <mapping jbpm="g2" esb="esbObj2" process-scope="true" />
+ * </jbpmToEsbVars>
+ * <pre>
+ *
+ * @throws Exception
+ */
+ @Test
+ public void jBpmVariableMap() throws Exception
+ {
+ SAXReader reader = new SAXReader();
+ Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
+ Element element = document.getRootElement();
+ DefaultElement bpmToEsbVars = (DefaultElement) element.element("start-state").element("transition").element("action").element("bpmToEsbVars");
+
+ String helloWorldTokenScope = "Hello world token scope";
+ String helloWorldGlobalScope = "Hello world process-instance scope";
+
+ Token token = processInstance.getRootToken();
+ processInstance.getContextInstance().setVariable("v1", helloWorldTokenScope, token);
+ processInstance.getContextInstance().setVariable("g2", helloWorldGlobalScope);
+ ExecutionContext executionContext = new ExecutionContext(token);
+
+ JBpmObjectMapper mapper = new JBpmObjectMapper();
+ Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, Boolean.FALSE, executionContext);
+
+ assertEquals(helloWorldTokenScope,String.valueOf(message.getBody().get("esbObj1")));
+ assertEquals(helloWorldGlobalScope,String.valueOf(message.getBody().get("esbObj2")));
+ }
+ /**
+ * Tests obtaining *no* variables from the jBPM variableMap.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void jBpmCompleteVariableMap() throws Exception
+ {
+ //Let's NOT give a mapping, this should get us all the variables in the VariableMap.
+ DefaultElement jbpmToEsbVars = null;
+
+ String helloWorldTokenScope = "Hello world token scope";
+ String helloWorldGlobalScope = "Hello world process-instance scope";
+
+ Token token = processInstance.getRootToken();
+ processInstance.getContextInstance().createVariable("v1", helloWorldTokenScope, token);
+ processInstance.getContextInstance().createVariable("g2", helloWorldGlobalScope);
+ ExecutionContext executionContext = new ExecutionContext(token);
+
+ JBpmObjectMapper mapper = new JBpmObjectMapper();
+ Message message = mapper.mapFromJBpmToEsbMessage(jbpmToEsbVars, Boolean.FALSE, executionContext);
+ assertEquals(message.getBody().getNames().length,0);
+ }
+ /**
+ * Tests obtaining *all* variables from the jBPM variableMap and setting them on the EsbMessage.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void jBpmGetNothingFromVariableMap() throws Exception
+ {
+ SAXReader reader = new SAXReader();
+ Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
+ Element element = document.getRootElement();
+ Element secondMiddleState = (Element) element.elements("state").toArray()[0];
+ DefaultElement bpmToEsbVars = (DefaultElement) secondMiddleState.element("transition").element("action").element("bpmToEsbVars");
+
+ String helloWorldTokenScope = "Hello world token scope";
+ String helloWorldGlobalScope = "Hello world process-instance scope";
+
+ Token token = processInstance.getRootToken();
+ processInstance.getContextInstance().createVariable("v1", helloWorldTokenScope, token);
+ processInstance.getContextInstance().createVariable("g2", helloWorldGlobalScope);
+ ExecutionContext executionContext = new ExecutionContext(token);
+
+ JBpmObjectMapper mapper = new JBpmObjectMapper();
+ Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, Boolean.FALSE, executionContext);
+ //We should find 2 variables which are named just like their jBPM counterparts.
+ assertEquals(message.getBody().getNames().length,2);
+ assertEquals(String.valueOf(message.getBody().get("v1")),helloWorldTokenScope);
+ assertEquals(String.valueOf(message.getBody().get("g2")),helloWorldGlobalScope);
+ }
+ /**
+ * Tests obtaining info about the jBPM ExecutionContext, such as current token and node, transition etc.
+ * <PRE>
+ * <jbpmToEsbVars>
+ * <mapping jbpm="token.id" esb="esbTokenId" />
+ * <mapping jbpm="token.name" esb="esbTokenName" />
+ * <mapping jbpm="node.name" esb="NodeName" />
+ * <mapping jbpm="node.id" esb="esbNodeId" />
+ * <mapping jbpm="node.leavingTransitions[0].name" esb="transName" />
+ * <mapping jbpm="processInstance.id" esb="piId" />
+ <mapping jbpm="processInstance.version" esb="piVersion" />
+ * </jbpmToEsbVars>
+ * </PRE>
+ * @throws Exception
+ */
+ @Test
+ public void jBpmTokenInfo() throws Exception
+ {
+ SAXReader reader = new SAXReader();
+ Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
+ Element element = document.getRootElement();
+ Element secondMiddleState = (Element) element.elements("state").toArray()[1];
+ DefaultElement bpmToEsbVars = (DefaultElement) secondMiddleState.element("transition").element("action").element("bpmToEsbVars");
+
+ Token token = processInstance.getRootToken();
+ ExecutionContext executionContext = new ExecutionContext(token);
+ Node node = executionContext.getNode();
+ Transition transition = (Transition) node.getLeavingTransitions().get(0);
+
+ JBpmObjectMapper mapper = new JBpmObjectMapper();
+ Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, Boolean.FALSE, executionContext);
+
+ assertEquals(message.getBody().getNames().length,6);
+ assertEquals(String.valueOf(String.valueOf(message.getBody().get("TokenId"))), String.valueOf(token.getId()));
+ //The token name is null.
+ assertNull(message.getBody().get("TokenName"));
+ //Get info about the node.
+ assertEquals(String.valueOf(String.valueOf(message.getBody().get("NodeName"))), String.valueOf(node.getName()));
+ assertEquals(String.valueOf(String.valueOf(message.getBody().get("esbNodeId"))), String.valueOf(node.getId()));
+ assertEquals(String.valueOf(String.valueOf(message.getBody().get("transName"))), String.valueOf(transition.getName()));
+ assertEquals(String.valueOf(String.valueOf(message.getBody().get("piId"))), String.valueOf(processInstance.getId()));
+ assertEquals(String.valueOf(String.valueOf(message.getBody().get("piVersion"))), String.valueOf(processInstance.getVersion()));
+ logger.info("Message=" + message);
+ }
+
+ public static junit.framework.Test suite(){
+ return new JUnit4TestAdapter(JBpmObjectMapperTest.class);
+ }
+
+}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/DummyAction.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/DummyAction.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/DummyAction.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/DummyAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,22 @@
+/**
+ *
+ */
+package org.jboss.soa.esb.services.jbpm.actionhandlers;
+
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+/**
+ * @author kstam
+ *
+ */
+public class DummyAction implements ActionHandler
+{
+ private static final long serialVersionUID = 1L;
+
+ public void execute (ExecutionContext executionContext) throws Exception
+ {
+ System.out.println("DummyAction fired.");
+ }
+
+}
Modified: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -22,60 +22,44 @@
package org.jboss.soa.esb.services.jbpm.actionhandlers;
-import java.io.File;
+import static org.junit.Assert.assertTrue;
+import java.net.URI;
+
import junit.framework.JUnit4TestAdapter;
-import junit.framework.TestCase;
import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.addressing.EPR;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
-import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.jboss.soa.esb.message.MessagePayloadProxy;
-public class EsbActionHandlerUnitTest extends TestCase
+public class EsbActionHandlerUnitTest
{
private static Class thisClass = EsbActionHandlerUnitTest.class;
static Logger _logger = Logger.getLogger(thisClass);
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(thisClass);
- }
+ private static EPR epr1;
+ private static MockCourier courier1;
+ private static String MOCK_CATEGORY="MockCategory";
+ private static String MOCK_SERVICE ="MockService";
- static File WORKDIR;
- static
- {
- String os = System.getProperty("os.name","").toLowerCase();
- String dflt = (os.indexOf("win")>=0) ? "/temp": "/tmp";
- WORKDIR = new File(System.getProperty("java.io.tmpdir",dflt));
- }
-
@BeforeClass
- public static void runBeforeAllTests()
+ public static void setup() throws Exception
{
- _logger.info("@BeforeClass invoked");
- try
- {
- }
- catch (Exception e)
- {
- e.printStackTrace();
- assertTrue(false);
- }
+ MockCourierFactory.install();
+ MockRegistry.install();
+ epr1 = new EPR(new URI("test1"));
+ courier1 = new MockCourier(true);
+ MockRegistry.register(MOCK_CATEGORY, MOCK_SERVICE, epr1, courier1);
}
-
-
- @AfterClass
- public static void runAfterAllTests() throws Exception
- {
- _logger.info("@AfterClass invoked");
- }
-
+
@Test
public void testSimpleProcess() throws Exception
{
@@ -98,21 +82,14 @@
instance.getContextInstance().createVariable("v1", varVal, token);
instance.getContextInstance().createVariable("g2", second);
instance.getContextInstance().createVariable("body", body.getBytes(),token);
+
+ //Signal the token and the Mock Service will be called.
instance.signal();
-
- assertTrue(
- "Instance is in first state",
- instance.getRootToken().getNode().getName().equals("first"));
-
- _logger.info("Instance Var x1= "+varVal);
- assertTrue(varVal.equals(instance.getContextInstance().getVariable("x1")));
- _logger.info("Token Var x2= "+second);
- assertTrue(second.equals(instance.getContextInstance().getVariable("x2",instance.getRootToken())));
- _logger.info("Token Var x3= "+body);
- byte[] byteArray = (byte[]) instance.getContextInstance().getVariable("x3",instance.getRootToken());
- String string = new String(byteArray);
- assertEquals(body,string);
+ //the node is now in a wait state in the "first" state
+ assertTrue(
+ "Instance is in first state",
+ instance.getRootToken().getNode().getName().equals("first"));
instance.signal();
assertTrue(
@@ -120,5 +97,10 @@
instance.getRootToken().getNode().getName().equals("end"));
assertTrue("Instance has ended", instance.hasEnded());
}
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(thisClass);
+ }
}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/ExceptionFlowTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/ExceptionFlowTest.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/ExceptionFlowTest.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/ExceptionFlowTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,234 @@
+/*
+ * 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 java.net.URI;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+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 which we are using to handle exceptions.
+ *
+ * @author kstam
+ *
+ */
+public class ExceptionFlowTest
+{
+ private static String PROCESS_DEF_XML = "testExceptionHandling.xml";
+ private static Logger logger = Logger.getLogger(ExceptionFlowTest.class);
+ private static long processInstanceId;
+
+ private static EPR epr1;
+ private static MockCourier courier1;
+ private static String MOCK_CATEGORY="MockCategory";
+ private static String MOCK_SERVICE ="MockService";
+
+ @Before
+ public void setup() throws Exception
+ {
+ MockCourierFactory.install();
+ MockRegistry.install();
+ epr1 = new EPR(new URI("test1"));
+ courier1 = new MockCourier(true);
+ MockRegistry.register(MOCK_CATEGORY, MOCK_SERVICE, epr1, courier1);
+
+ logger.info("Setting up jBPM");
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ jbpmContext.getJbpmConfiguration().getJobExecutor().start();
+
+ //Extract a process definition from the processdefinition.xml file.
+ ProcessDefinition processDefinition
+ = ProcessDefinition.parseXmlResource(PROCESS_DEF_XML);
+ assertNotNull(processDefinition);
+ //Create an instance of the process definition.
+ jbpmContext.deployProcessDefinition(processDefinition);
+ //processInstance = new ProcessInstance(processDefinition);
+ ProcessInstance processInstance = jbpmContext.newProcessInstance("testExceptionHandling");
+ assertTrue(
+ "Instance is in start state",
+ "start".equals(processInstance.getRootToken().getNode().getName()));
+ processInstanceId = processInstance.getId();
+ jbpmContext.close();
+ }
+
+ /**
+ * Tests timeout of the first node (service1). The time-out-transition will
+ * be taken and we should en up in the ExceptionHandling end-state.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void timeOut() throws Exception
+ {
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+
+ Token token = processInstance.getRootToken();
+ assertEquals("start",token.getNode().getName());
+ //Move the process to service1
+ processInstance.signal();
+ jbpmContext.close();
+ //Our timer fires after 1000 millies, so let's wait for that
+ int seconds=0;
+ while(true) {
+ jbpmContext = jbpmConfiguration.createJbpmContext();
+ processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+ token = processInstance.getRootToken();
+ logger.info(seconds++ + " Node=" + token.getNode().getName());
+ if ("ExceptionHandling".equals(token.getNode().getName())) break; //we're done waiting
+ if (seconds > 20) break; // the timer must not have fired so we are bailing (and failing)
+ jbpmContext.close();
+ try { Thread.sleep(1000); } catch (InterruptedException e) {e.printStackTrace();}
+ }
+ assertEquals("ExceptionHandling",token.getNode().getName());
+ }
+
+ /**
+ * Tests bypassing the timout and taking the exception transition on service2.
+ *
+ */
+ @Test
+ public void takeExceptionTransition() {
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+
+ Token token = processInstance.getRootToken();
+ assertEquals("start",token.getNode().getName());
+ //Move the process to service1
+ processInstance.signal();
+ assertEquals("Service1",token.getNode().getName());
+// Move the process to service2, no timeout on service1
+ processInstance.signal();
+ assertEquals("Service2",token.getNode().getName());
+ //Move the service2 ExceptionHandling
+ processInstance.signal("exception");
+ assertEquals("ExceptionHandling",token.getNode().getName());
+ }
+
+ /**
+ * Tests bypassing the timout and setting exception of 3 to take the conditional transition.
+ *
+ */
+ @Test
+ public void takeConditionalTransition() {
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+
+ Token token = processInstance.getRootToken();
+ assertEquals("start",token.getNode().getName());
+ //Move the process to service1
+ processInstance.signal();
+ assertEquals("Service1",token.getNode().getName());
+// Move the process to service2, no timeout on service1
+ processInstance.signal();
+ assertEquals("Service2",token.getNode().getName());
+ //Move the service3
+ processInstance.signal();
+ assertEquals("Service3",token.getNode().getName());
+ processInstance.getContextInstance().createVariable("exceptionCode",3);
+ processInstance.signal();
+ //Based on the setting of exceptionCode of 3 the conditional transition
+ //should be taken.
+ assertEquals("ExceptionHandling",token.getNode().getName());
+ }
+
+ /**
+ * Tests bypassing the timout and setting exception of 3 to take the conditional transition.
+ *
+ */
+ @Test
+ public void doNotTakeConditionalTransition() {
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+
+ Token token = processInstance.getRootToken();
+ assertEquals("start",token.getNode().getName());
+ //Move the process to service1
+ processInstance.signal();
+ assertEquals("Service1",token.getNode().getName());
+// Move the process to service2, no timeout on service1
+ processInstance.signal();
+ assertEquals("Service2",token.getNode().getName());
+ //Move the service3
+ processInstance.signal();
+ assertEquals("Service3",token.getNode().getName());
+ processInstance.getContextInstance().createVariable("exceptionCode",2);
+ processInstance.signal();
+ //Based on the setting of exceptionCode of 2 the conditional transition
+ //should not be taken.
+ assertEquals("end",token.getNode().getName());
+ }
+
+ /**
+ * Tests bypassing the timout and setting exception of 3 to take the conditional transition.
+ *
+ */
+ @Test
+ public void doNotTakeConditionalTransition2() {
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+
+ Token token = processInstance.getRootToken();
+ assertEquals("start",token.getNode().getName());
+ //Move the process to service1
+ processInstance.signal();
+ assertEquals("Service1",token.getNode().getName());
+// Move the process to service2, no timeout on service1
+ processInstance.signal();
+ assertEquals("Service2",token.getNode().getName());
+ //Move the service3
+ processInstance.signal();
+ assertEquals("Service3",token.getNode().getName());
+ processInstance.signal();
+ //Based on the not setting of exceptionCode the conditional transition
+ //should not be taken.
+ assertEquals("end",token.getNode().getName());
+ }
+
+ public static junit.framework.Test suite(){
+ return new JUnit4TestAdapter(ExceptionFlowTest.class);
+ }
+
+}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,118 @@
+/*
+ * 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 java.util.Map;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+import org.dom4j.tree.DefaultElement;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.JBpmObjectMapper;
+import org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler;
+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.junit.BeforeClass;
+import org.junit.Test;
+/**
+ * Tests the capabilities of the JBpmObjectMapper.
+ *
+ * @author kstam
+ *
+ */
+public class JBpmObjectMapperCallbackTest
+{
+ private static String PROCESS_DEF_XML = "JBpmObjectMapperTestProcessDefinition.xml";
+ private static Logger logger = Logger.getLogger(JBpmObjectMapperCallbackTest.class);
+ private static ProcessInstance processInstance = null;
+
+ @BeforeClass
+ public static void setup()
+ {
+ logger.info("Setting up jBPM");
+ //Extract a process definition from the processdefinition.xml file.
+ ProcessDefinition processDefinition
+ = ProcessDefinition.parseXmlResource(PROCESS_DEF_XML);
+ assertNotNull(processDefinition);
+ //Create an instance of the process definition.
+ processInstance = new ProcessInstance(processDefinition);
+ assertTrue(
+ "Instance is in start state",
+ "start".equals(processInstance.getRootToken().getNode().getName()));
+ }
+
+ /**
+ * Tests if the variableMapping can go roundtrip (via the callbackService code)
+ *
+ * @throws Exception
+ */
+ @Test
+ public void esbToJBpmAndBack() throws Exception
+ {
+ SAXReader reader = new SAXReader();
+ Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
+ Element element = document.getRootElement();
+ DefaultElement bpmToEsbVars = (DefaultElement) element.element("start-state").element("transition").element("action").element("bpmToEsbVars");
+ DefaultElement esbToBpmVars = (DefaultElement) element.element("start-state").element("transition").element("action").element("esbToBpmVars");
+
+ String helloWorldTokenScope = "Hello world token scope";
+ String helloWorldGlobalScope = "Hello world process-instance scope";
+
+ Token token = processInstance.getRootToken();
+ processInstance.getContextInstance().createVariable("v1", helloWorldTokenScope, token);
+ processInstance.getContextInstance().createVariable("g2", helloWorldGlobalScope);
+ ExecutionContext executionContext = new ExecutionContext(token);
+
+ JBpmObjectMapper mapper = new JBpmObjectMapper();
+ Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, Boolean.FALSE, executionContext);
+
+ //Setting up return mapping for the callback service.
+ EsbActionHandler esbActionHandler = new EsbActionHandler();
+ EPR epr = esbActionHandler.createReplyTo(esbToBpmVars.asXML(), Boolean.FALSE, executionContext);
+ String esbToBpmXml = epr.getAddr().getExtensionValue(Constants.ESB_TO_BPM_VARS_TAG);
+
+ //Obtaining the VariableMap that is going to be set callback command
+ Map<String,Object> variableMap = mapper.mapFromEsbMessageToJBpmMap(message, esbToBpmXml);
+ logger.info(variableMap);
+ //Let's make sure that what we put in is going to make it roundtrip.
+ assertEquals(helloWorldTokenScope, variableMap.get("x1"));
+ assertEquals(helloWorldGlobalScope,variableMap.get("x2"));
+ }
+
+ public static junit.framework.Test suite(){
+ return new JUnit4TestAdapter(JBpmObjectMapperCallbackTest.class);
+ }
+
+}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/TimerTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/TimerTest.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/TimerTest.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/TimerTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,115 @@
+/*
+ * 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.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+import org.junit.BeforeClass;
+import org.junit.Test;
+/**
+ * Tests the capabilities of jBPM timer, which we are using.
+ *
+ * @author kstam
+ *
+ */
+public class TimerTest
+{
+ private static String PROCESS_DEF_XML = "testTimer.xml";
+ private static Logger logger = Logger.getLogger(TimerTest.class);
+ private static long processInstanceId;
+ //private static ProcessInstance processInstance = null;
+ //private static JbpmContext jbpmContext = null;
+ //private static GraphSession graphSession = null;
+
+ @BeforeClass
+ public static void setup() 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);
+ assertNotNull(processDefinition);
+ //Create an instance of the process definition.
+ jbpmContext.deployProcessDefinition(processDefinition);
+ ProcessInstance processInstance = jbpmContext.newProcessInstance("testTimer");
+ processInstanceId = processInstance.getId();
+ assertTrue(
+ "Instance is in start state",
+ "start".equals(processInstance.getRootToken().getNode().getName()));
+ processInstance.getContextInstance().createVariable("processingTime", "3000");
+ jbpmContext.close();
+ }
+
+ /**
+ * Tests timeout functionality of jBPM
+ *
+ * @throws Exception
+ */
+ @Test
+ public void timeOut() throws Exception
+ {
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+
+ Token token = processInstance.getRootToken();
+ processInstance.signal();
+ assertEquals("wait1",token.getNode().getName());
+ jbpmContext.close();
+
+ int seconds=0;
+ while (true) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {}
+ jbpmContext = jbpmConfiguration.createJbpmContext();
+ processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+ token = processInstance.getRootToken();
+ String currentNode = token.getNode().getName();
+ System.out.println(seconds++ + " " + currentNode);
+ jbpmContext.close();
+ if (currentNode.equals("end")) break;
+ if (seconds > 20) break;
+ }
+
+ //Check that we are now in the end node.
+ assertEquals("end",token.getNode().getName());
+ }
+
+ public static junit.framework.Test suite(){
+ return new JUnit4TestAdapter(TimerTest.class);
+ }
+
+}
Property changes on: labs/jbossesb/trunk/product/services/jbpm/src/test/resources
___________________________________________________________________
Name: svn:ignore
+ .gpd.JBpmObjectMapperTestProcessDefinition.xml
.gpd.testMappingDefinition.xml
.gpd.testExceptionHandling.xml
.gpd.testTimer.xml
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.jpg (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.jpg)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.1"
+ name="JBpmObjectMapperTestDefinition">
+ <start-state name="start">
+ <transition name="to_first_middle_state" to="first-middle">
+ <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbCategoryName>MockCategory</esbCategoryName>
+ <esbServiceName>MockService</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="v1" esb="esbObj1" />
+ <mapping bpm="g2" esb="esbObj2" process-scope="true" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="esbObj1" bpm="x1" process-scope="true" />
+ <mapping esb="esbObj2" bpm="x2" />
+ </esbToBpmVars>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first-middle">
+ <transition name="to_second_middle_state" to="second-middle">
+ <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbCategoryName>MockCategory</esbCategoryName>
+ <esbServiceName>MockService</esbServiceName>
+ <bpmToEsbVars/>
+ </action>
+ </transition>
+ </state>
+ <state name="second-middle">
+ <transition name="to_end" to="end">
+ <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbCategoryName>MockCategory</esbCategoryName>
+ <esbServiceName>MockService</esbServiceName>
+ <bpmToEsbVars>
+ <mapping bpm="token.id" esb="TokenId" />
+ <mapping bpm="token.name" esb="TokenName" />
+ <mapping bpm="node.name" esb="NodeName" />
+ <mapping bpm="node.id" esb="esbNodeId" />
+ <mapping bpm="node.leavingTransitions[0].name" esb="transName" />
+ <mapping bpm="processInstance.id" esb="piId" />
+ <mapping bpm="processInstance.version" esb="piVersion" />
+ </bpmToEsbVars>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/jbpm.cfg.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/resources/jbpm.cfg.xml)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/resources/jbpm.cfg.xml (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/resources/jbpm.cfg.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,13 @@
+<jbpm-configuration>
+
+ <!--
+ This configuration is used when there is no jbpm.cfg.xml file found in the
+ root of the classpath. It is a very basic configuration without persistence
+ and message services. Only the authorization service installed.
+ You can parse and create processes, but when you try to use one of the
+ unavailable services, you'll get an exception.
+ -->
+
+
+
+</jbpm-configuration>
Modified: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/resources/log4j.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/resources/log4j.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -35,10 +35,10 @@
<!-- ================ -->
<category name="org.jbpm">
- <priority value="INFO"/>
+ <priority value="DEBUG"/>
</category>
<category name="org.hibernate">
- <priority value="ERROR"/>
+ <priority value="INFO"/>
</category>
<category name="org.jboss">
<priority value="WARN"/>
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testExceptionHandling.jpg (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/resources/testExceptionHandling.jpg)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testExceptionHandling.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/resources/testExceptionHandling.xml)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testExceptionHandling.xml (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testExceptionHandling.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="testExceptionHandling">
+ <start-state name="start">
+ <transition name="ok" to="Service1"></transition>
+ </start-state>
+ <node name="Service1">
+ <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbCategoryName>MockCategory</esbCategoryName>
+ <esbServiceName>MockService</esbServiceName>
+ </action>
+ <timer name='timeout' duedate='1 seconds' transition='time-out-transition'/>
+ <transition name="ok" to="Service2"></transition>
+ <transition name="time-out-transition" to="ExceptionHandling"></transition>
+ </node>
+ <node name="Service2">
+ <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbCategoryName>MockCategory</esbCategoryName>
+ <esbServiceName>MockService</esbServiceName>
+ <exceptionTransition>exception</exceptionTransition>
+ </action>
+ <transition name="ok" to="Service3"></transition>
+ <transition name="exception" to="ExceptionHandling"></transition>
+ </node>
+ <end-state name="ExceptionHandling"></end-state>
+ <node name="Service3">
+ <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbCategoryName>MockCategory</esbCategoryName>
+ <esbServiceName>MockService</esbServiceName>
+ <esbToBpmVars>
+ <mapping esb="SomeExceptionCode" bpm="exceptionCode"/>
+ </esbToBpmVars>
+ </action>
+ <transition name="ok" to="exceptionDecision"></transition>
+
+ </node>
+ <end-state name="end"></end-state>
+ <decision name="exceptionDecision">
+ <transition name="ok" to="end"></transition>
+ <transition name="exceptionCondition" to="ExceptionHandling">
+ <condition>#{exceptionCode==3}</condition>
+ </transition>
+ </decision>
+</process-definition>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testMappingDefinition.jpg (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/resources/testMappingDefinition.jpg)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testMappingDefinition.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testMappingDefinition.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testMappingDefinition.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -6,19 +6,19 @@
<start-state name="start">
<transition name="to_state" to="first">
<action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
- <esbCategoryName>MOCK_CATEGORY</esbCategoryName>
- <esbServiceName>MOCK_SERVICE</esbServiceName>
+ <esbCategoryName>MockCategory</esbCategoryName>
+ <esbServiceName>MockService</esbServiceName>
<millisToWaitForResponse>1</millisToWaitForResponse>
- <jbpmToEsbVars>
- <mapping jbpm="v1" esb="esbObj1" />
- <mapping jbpm="g2" esb="esbObj2" process-scope="true" />
- <mapping jbpm="body" esb="BODY_CONTENT" />
- </jbpmToEsbVars>
- <returnVars>
- <mapping jbpm="x1" esb="esbObj1" process-scope="true" />
- <mapping jbpm="x2" esb="esbObj2" />
- <mapping jbpm="x3" esb="BODY_CONTENT" />
- </returnVars>
+ <bpmToEsbVars>
+ <mapping bpm="v1" esb="esbObj1" />
+ <mapping bpm="g2" esb="esbObj2" process-scope="true" />
+ <mapping bpm="body" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping bpm="x1" esb="esbObj1" process-scope="true" default="esbObj1 not found"/>
+ <mapping bpm="x2" esb="esbObj2" />
+ <mapping bpm="x3" esb="BODY_CONTENT" />
+ </esbToBpmVars>
</action>
</transition>
</start-state>
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testTimer.jpg (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/resources/testTimer.jpg)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testTimer.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/services/jbpm/src/test/resources/testTimer.xml)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testTimer.xml (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/resources/testTimer.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="testTimer">
+ <start-state name="start">
+ <transition name="toWait" to="wait1"></transition>
+ </start-state>
+ <state name="wait1">
+ <timer duedate="2 seconds" transition="continue" />
+ <transition name="continue" to="mynode" />
+ </state>
+ <node name="mynode">
+ <transition name="toWait2" to="wait2" />
+ </node>
+ <state name="wait2">
+ <timer duedate="2 seconds" transition="continue" />
+ <transition name="continue" to="end" />
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/services/jbrules/src/main/resources/XPathLanguage.dsl
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/main/resources/XPathLanguage.dsl 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/jbrules/src/main/resources/XPathLanguage.dsl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,7 +1,7 @@
#JBossESB Content Based Routing using XPath DSL
-[when]xpathMatch "{xpath}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentMatches(msg, "{xpath}") )
-[when]xpathEquals "{xpath}", "{value}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentEquals(msg, "{xpath}", "{value}") )
-[when]xpathGreaterThan "{xpath}", "{value}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentGreaterThan(msg, "{xpath}", "{value}") )
-[when]xpathLessThan "{xpath}", "{value}"=msg : Message( type == MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentLessThan(msg, "{xpath}", "{value}") )
+[when]xpathMatch "{xpath}"=msg : org.jboss.soa.esb.message.Message( type == org.jboss.soa.esb.message.format.MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentMatches(msg, "{xpath}") )
+[when]xpathEquals "{xpath}", "{value}"=msg : org.jboss.soa.esb.message.Message( type == org.jboss.soa.esb.message.format.MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentEquals(msg, "{xpath}", "{value}") )
+[when]xpathGreaterThan "{xpath}", "{value}"=msg : org.jboss.soa.esb.message.Message( type == org.jboss.soa.esb.message.format.MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentGreaterThan(msg, "{xpath}", "{value}") )
+[when]xpathLessThan "{xpath}", "{value}"=msg : org.jboss.soa.esb.message.Message( type == org.jboss.soa.esb.message.format.MessageType.JBOSS_XML ) and eval( org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.xmlContentLessThan(msg, "{xpath}", "{value}") )
[then]Log : "{message}"=System.out.println("{message}");
[then]Destination : "{message}"=destinations.add("{message}");
Modified: labs/jbossesb/trunk/product/services/soap/lib/ext/build-time/jbossws-core.jar
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/services/soap/lib/ext/build-time/jbossws-jboss42.jar
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/services/soap/lib/ext/build-time/jbossws-spi.jar
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,3 +1,25 @@
+/*
+ * 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.actions.soap;
import java.io.*;
@@ -362,6 +384,7 @@
String request;
try {
request = soapUIInvoker.buildRequest(wsdl, getEndpointOperation(), params, httpClientProps, smooksTransform, soapNs);
+
} catch (IOException e) {
throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
} catch (SAXException e) {
@@ -393,20 +416,24 @@
protected String invokeEndpoint(String request) throws ActionProcessingException {
String endpoint;
+
try {
endpoint = soapUIInvoker.getEndpoint(wsdl, httpClientProps);
+
} catch (IOException e) {
throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
}
PostMethod post = new PostMethod(endpoint);
post.setRequestHeader("Content-Type", "text/xml;charset=UTF-8");
- post.setRequestHeader("SOAPAction", soapAction);
+
+ post.setRequestHeader("SOAPAction", "\"" + soapAction + "\""); /// Customization to add quotes to Soap action
post.setRequestEntity(new StringRequestEntity(request));
try {
int result = httpclient.executeMethod(post);
if(result != HttpStatus.SC_OK) {
// TODO: We need to do more here!!
+
logger.warn("Received status code '" + result + "' on HTTP SOAP (POST) request to '" + endpoint + "'.");
}
return post.getResponseBodyAsString();
Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -19,31 +19,31 @@
*/
package org.jboss.soa.esb.actions.soap;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
import org.jboss.internal.soa.esb.publish.Publish;
import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
import org.jboss.soa.esb.actions.ActionProcessingException;
import org.jboss.soa.esb.actions.ActionUtils;
import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.MessagePayloadProxy;
import org.jboss.soa.esb.message.ResponseHeader;
import org.jboss.soa.esb.message.body.content.BytesBody;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.BasicInvocationContext;
+import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.RequestHandler;
-import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.management.EndpointRegistry;
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import javax.management.ObjectName;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Set;
+
/**
* JBoss Webservices SOAP Processor.
* <p/>
@@ -136,7 +136,7 @@
messageTL.set(message);
RequestHandler requestHandler = endpoint.getRequestHandler();
- InvocationContext invocationContext = new BasicInvocationContext();
+ InvocationContext invocationContext = new InvocationContext();
ByteArrayOutputStream os = new ByteArrayOutputStream();
requestHandler.handleRequest(endpoint, new ByteArrayInputStream(soapMessage), os, invocationContext);
@@ -215,7 +215,9 @@
* @return The service endpoint, or null if the endpoint is not found.
*/
protected static Endpoint getServiceEndpoint(String endpointName) {
- EndpointRegistry registry = EndpointRegistryFactory.getEndpointRegistry();
+ SPIProvider spiProv = SPIProviderResolver.getInstance().getProvider();
+ EndpointRegistryFactory factory = spiProv.getSPI(EndpointRegistryFactory.class);
+ EndpointRegistry registry = factory.getEndpointRegistry();
Set<ObjectName> objectNames = registry.getEndpoints();
for (ObjectName objectName : objectNames) {
Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -19,32 +19,33 @@
*/
package org.jboss.soa.esb.actions.soap;
-import java.io.*;
-import java.net.URI;
-import java.util.List;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.servlet.http.HttpServletRequest;
-
+import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.publish.ActionContractPublisher;
import org.jboss.internal.soa.esb.publish.ContractInfo;
+import org.jboss.internal.soa.esb.util.StreamUtils;
import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.listeners.config.xbeanmodel.ActionDocument;
import org.jboss.soa.esb.listeners.config.xbeanmodel.PropertyDocument;
-import org.jboss.soa.esb.addressing.EPR;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.RequestHandler;
-import org.jboss.ws.core.server.ServletRequestContext;
-import org.xml.sax.SAXException;
-import org.apache.log4j.Logger;
import org.milyn.Smooks;
import org.milyn.container.standalone.StandaloneExecutionContext;
+import org.xml.sax.SAXException;
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
/**
* Contract publisher for a Webservice endpoint.
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
@@ -103,17 +104,13 @@
String targetServiceCat = servletRequest.getParameter("serviceCat");
String targetServiceName = servletRequest.getParameter("serviceName");
String targetProtocol = servletRequest.getParameter("protocol");
- RequestHandler requestHandler = endpoint.getRequestHandler();
- ByteArrayOutputStream wsdlStream = new ByteArrayOutputStream();
- InvocationContext invocationContext;
- invocationContext = new ServletRequestContext(null, servletRequest, null);
-
try {
// Generate the WSDL...
- requestHandler.handleWSDLRequest(endpoint, wsdlStream, invocationContext);
- String wsdl = updateWsdl(new String(wsdlStream.toByteArray()), epr, targetServiceCat, targetServiceName, targetProtocol);
+ String wsdl = getEndpointWsdl(endpoint);
+ wsdl = updateWsdl(wsdl, epr, targetServiceCat, targetServiceName, targetProtocol);
+
return new ContractInfo("text/xml", wsdl);
} catch (Exception e) {
logger.error("Failed to load contract information from JBossWS Endpoint '" + endpointName + "'.", e);
@@ -126,6 +123,26 @@
}
/**
+ * Get the endpoints WSSDL from the JBossWS container.
+ * </p>
+ * See http://jira.jboss.com/jira/browse/JBWS-1909
+ *
+ * @param endpoint The endpoint.
+ * @return The WSDL.
+ * @throws IOException Error reading wsdl.
+ */
+ private String getEndpointWsdl(Endpoint endpoint) throws IOException {
+ URL endpointWsdlAddress = new URL(endpoint.getAddress() + "?wsdl");
+ InputStream wsdlStream = endpointWsdlAddress.openStream();
+
+ try {
+ return StreamUtils.readStreamString(wsdlStream, "UTF-8");
+ } finally {
+ wsdlStream.close();
+ }
+ }
+
+ /**
* Update the supplied wsdl to take account of the ESB endpoint proxying of the JBossWS
* invocation, as well as the fact that the transport may be different.
*
@@ -146,7 +163,7 @@
execContext.setAttribute(WsdlTransformer.TARGET_PROTOCOL, targetProtocol);
transformer.filter(new StreamSource(new StringReader(wsdl)), new StreamResult(writer), execContext);
- return writer.toString();
+ return writer.toString().trim();
}
protected void initializeTransform() throws ConfigurationException {
Modified: labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected.wsdl
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected.wsdl 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected.wsdl 2008-03-04 16:24:20 UTC (rev 18679)
@@ -52,4 +52,4 @@
<soap:address location="socket://x.y.x:8989/"/>
</port>
</service>
-</definitions>
\ No newline at end of file
+</definitions>
Modified: labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -139,6 +139,19 @@
return operationInst;
}
}
+
+ // Try clearing WSDL cache, WSDL may have updated
+ wsdls.remove(wsdl);
+ wsdlInterfaces = getWsdlInterfaces(wsdl, httpClientProps);
+
+ for (WsdlInterface wsdlInterface : wsdlInterfaces) {
+ Operation operationInst = wsdlInterface.getOperationByName(operation);
+
+ if (operationInst != null) {
+ return operationInst;
+ }
+ }
+
throw new UnsupportedOperationException("Operation '" + operation + "' not supported by WSDL '" + wsdl + "'.");
}
Modified: labs/jbossesb/trunk/product/skip.properties-example
===================================================================
--- labs/jbossesb/trunk/product/skip.properties-example 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/skip.properties-example 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/product/tools/configeditor/editor/docs/JBossESBConfigEditor.pdf
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/tools/console/management/build.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,11 +21,19 @@
value="${esb.root.dir}/server/default/deploy/jbossesb.sar/lib">
<available type="dir" file="${esb.root.dir}/server/default/deploy/jbossesb.sar/lib"/>
</condition>
-
+ <condition property="server.lib.dir"
+ value="../../../server/default/lib">
+ <available type="dir" file="../../../server/default/lib"
+/>
+ </condition>
+ <property name="server.lib.dir" value="${esb.lib.dir}"/>
<path id="build.classpath">
<fileset dir="${esb.root.dir}/tools/console/management-web/lib">
<include name="*.jar"/>
</fileset>
+ <fileset dir="${server.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
<fileset dir="${esb.lib.dir}">
<include name="*.jar"/>
</fileset>
Modified: labs/jbossesb/trunk/product/tools/console/management/mysql.properties
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/mysql.properties 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/mysql.properties 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,4 +1,4 @@
db.dialect=org.hibernate.dialect.MySQLDialect
connection.datasource=java:/ManagementDS
db.datasource=ManagementDS
-database.depends=<depends>jboss.jdbc:datasource=ManagementDS,service=metadata</depends>
+database.depends=
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/MonitoringSessionFactory.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/MonitoringSessionFactory.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/MonitoringSessionFactory.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -79,7 +79,7 @@
try {
sessionFactory = new Configuration().configure("monitoring.cfg.xml").buildSessionFactory();
} catch (Exception e) {
- m_Logger.error("", e);
+ m_Logger.error("MonitoringSessionFactory failed to initialize!", e);
}
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -31,6 +31,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import java.util.Vector;
import javax.management.MBeanAttributeInfo;
import javax.management.MBeanInfo;
@@ -43,6 +44,8 @@
import org.apache.log4j.Logger;
import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.soa.esb.monitoring.MonitoringSessionFactory;
import org.jboss.soa.esb.monitoring.StatisticsBean;
@@ -86,11 +89,22 @@
}
public List getClassPatterns() {
- Session sess = (Session) MonitoringSessionFactory.getInstance().openSession();
- sess.beginTransaction();
- List result = sess.createQuery("from JMXPattern").list();
- sess.close();
- return result;
+ SessionFactory sf = MonitoringSessionFactory.getInstance();
+
+ if (sf != null)
+ {
+ Session sess = (Session) sf.openSession();
+ sess.beginTransaction();
+ List result = sess.createQuery("from JMXPattern").list();
+ sess.close();
+ return result;
+ }
+ else
+ {
+ logger.warn("DataCollector.getClassPatterns could not get MonitoringSessionFactory instance!");
+
+ return null;
+ }
}
public List<ObjectName> getObjectNames(JMXPattern jmc, MBeanServerConnection server) {
@@ -157,14 +171,20 @@
public void collectData() {
List jmxPatterns = getClassPatterns();
- for (int i = 0; i < jmxPatterns.size(); i++) {
- JMXPattern jmxc = (JMXPattern) jmxPatterns.get(i);
- List<ObjectName> objectNames = getObjectNames(jmxc, server);
- for (int j = 0; j < objectNames.size(); j++) {
- ObjectName on = (ObjectName) objectNames.get(j);
- insertAttributes(on);
+
+ if (jmxPatterns != null)
+ {
+ for (int i = 0; i < jmxPatterns.size(); i++) {
+ JMXPattern jmxc = (JMXPattern) jmxPatterns.get(i);
+ List<ObjectName> objectNames = getObjectNames(jmxc, server);
+ for (int j = 0; j < objectNames.size(); j++) {
+ ObjectName on = (ObjectName) objectNames.get(j);
+ insertAttributes(on);
+ }
}
}
+ else
+ logger.debug("DataCollector.collectData has no jmxPatterns!");
}
public StatisticsData getData() {
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/Invoker.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/Invoker.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/Invoker.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,3 +1,25 @@
+/*
+ * 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.monitoring.client;
import java.io.IOException;
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/OperationsCollector.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/OperationsCollector.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/OperationsCollector.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,3 +1,25 @@
+/*
+ * 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.monitoring.client;
import java.io.IOException;
@@ -22,6 +44,8 @@
import org.apache.log4j.Logger;
import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.soa.esb.message.body.content.ServiceControlCommand;
import org.jboss.soa.esb.monitoring.MonitoringSessionFactory;
@@ -57,11 +81,22 @@
}
public List getClassPatterns() {
- Session sess = (Session) MonitoringSessionFactory.getInstance().openSession();
- sess.beginTransaction();
- List result = sess.createQuery("from JMXPattern").list();
- sess.close();
- return result;
+ SessionFactory sf = MonitoringSessionFactory.getInstance();
+
+ if (sf != null)
+ {
+ Session sess = (Session) sf.openSession();
+ sess.beginTransaction();
+ List result = sess.createQuery("from JMXPattern").list();
+ sess.close();
+ return result;
+ }
+ else
+ {
+ logger.warn("OperationsCollector.getClassPatterns could not get MonitoringSessionFactory instance!");
+
+ return null;
+ }
}
public List<ObjectName> getObjectNames(JMXPattern jmc, MBeanServerConnection server) {
@@ -128,14 +163,20 @@
public void collectData() {
List jmxPatterns = getClassPatterns();
- for (int i = 0; i < jmxPatterns.size(); i++) {
- JMXPattern jmxc = (JMXPattern) jmxPatterns.get(i);
- List<ObjectName> objectNames = getObjectNames(jmxc, server);
- for (int j = 0; j < objectNames.size(); j++) {
- ObjectName on = (ObjectName) objectNames.get(j);
- insertOperations(on);
+
+ if (jmxPatterns != null)
+ {
+ for (int i = 0; i < jmxPatterns.size(); i++) {
+ JMXPattern jmxc = (JMXPattern) jmxPatterns.get(i);
+ List<ObjectName> objectNames = getObjectNames(jmxc, server);
+ for (int j = 0; j < objectNames.size(); j++) {
+ ObjectName on = (ObjectName) objectNames.get(j);
+ insertOperations(on);
+ }
}
}
+ else
+ logger.debug("OperationsCollector.collectData has no jmxPatterns!");
}
public OperationsData getData() {
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/BeanRegistrationServlet.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/BeanRegistrationServlet.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/BeanRegistrationServlet.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -83,6 +83,7 @@
try {
DataFilerScheduler dfs = new DataFilerScheduler();
+ dfs.start();
dfs.setPollMinuteFrequency(pollMinuteFrequency);
mbeanServer.registerMBean(dfs, dataSchedulerName);
} catch (InstanceAlreadyExistsException e) {
@@ -91,6 +92,8 @@
logger.error("", e);
} catch (NotCompliantMBeanException e) {
logger.error("", e);
+ } catch (Exception e) {
+ logger.error("", e);
}
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFiler.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFiler.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFiler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -26,6 +26,8 @@
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
import org.jboss.soa.esb.monitoring.MonitoringSessionFactory;
import org.jboss.soa.esb.monitoring.StatisticsBean;
import org.jboss.soa.esb.monitoring.StatisticsData;
@@ -160,6 +162,21 @@
* @param f_sb statistics bean
*/
public void insertStatistics(StatisticsBean f_sb) {
+ TransactionStrategy txStrategy = TransactionStrategy.getStrategy();
+ Object txHandle = null;
+
+ if (txStrategy != null)
+ {
+ try
+ {
+ txHandle = txStrategy.suspend();
+ }
+ catch (TransactionStrategyException ex)
+ {
+ // if it failed, then the next work will fail too.
+ }
+ }
+
Session sess = null;
Transaction tx = null;
try {
@@ -187,6 +204,18 @@
sess.flush();
sess.close();
sess = null;
+
+ if (txHandle != null)
+ {
+ try
+ {
+ txStrategy.resume(txHandle);
+ }
+ catch (TransactionStrategyException ex)
+ {
+ logger.error("Problem resuming transaction!", ex);
+ }
+ }
}
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerScheduler.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerScheduler.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerScheduler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -24,6 +24,7 @@
import java.util.Date;
import org.apache.log4j.Logger;
+import org.jboss.system.ServiceMBeanSupport;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
@@ -40,30 +41,46 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
* @since Version 4.2
*/
-public class DataFilerScheduler implements DataFilerSchedulerMBean {
+public class DataFilerScheduler extends ServiceMBeanSupport implements DataFilerSchedulerMBean {
private static final Logger logger = Logger.getLogger(DataFilerScheduler.class);
private static final int DEFAULT_POLL_MINUTE_FREQ = 2;
+ public Scheduler scheduler = null;
+
private int pollMinuteFrequency = DEFAULT_POLL_MINUTE_FREQ;
public int getPollMinuteFrequency() {
return pollMinuteFrequency;
}
+ public void create() throws Exception {
+ super.create();
+ SchedulerFactory schedulerFactory = new StdSchedulerFactory();
+ scheduler = schedulerFactory.getScheduler();
+ }
+
+ public void destroy() {
+ super.destroy();
+ try {
+ scheduler.shutdown();
+ scheduler.deleteJob(DataFilerJob.JOB_GROUP, DataFilerJob.JOB_NAME);
+ } catch (SchedulerException e) {
+ logger.error("", e);
+ }
+ }
+
public void setPollMinuteFrequency(int f_pollMinuteFrequency) {
pollMinuteFrequency = f_pollMinuteFrequency;
long ctime = System.currentTimeMillis();
try {
- SchedulerFactory schedulerFactory = new StdSchedulerFactory();
- Scheduler scheduler = schedulerFactory.getScheduler();
scheduler.deleteJob(DataFilerJob.JOB_GROUP, DataFilerJob.JOB_NAME);
JobDetail jobDetail = new JobDetail(DataFilerJob.JOB_GROUP, DataFilerJob.JOB_NAME, DataFilerJob.class);
-
- final JobDataMap datamap = new JobDataMap() ;
- datamap.put(ClassLoader.class.getName(), Thread.currentThread().getContextClassLoader()) ;
+
+ final JobDataMap datamap = new JobDataMap() ;
+ datamap.put(ClassLoader.class.getName(), Thread.currentThread().getContextClassLoader()) ;
jobDetail.setJobDataMap(datamap) ;
SimpleTrigger simpleTrigger = new SimpleTrigger(DataFilerJob.JOB_GROUP, DataFilerJob.JOB_NAME);
@@ -79,45 +96,7 @@
logger.error("", e);
}
}
-
- public String getName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int getState() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public String getStateString() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void jbossInternalLifecycle(String arg0) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public void create() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public void destroy() {
- // TODO Auto-generated method stub
-
- }
-
- public void start() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public void stop() {
- // TODO Auto-generated method stub
-
- }
+
+
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/Filer.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/Filer.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/Filer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,3 +1,25 @@
+/*
+ * 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.monitoring.server;
public interface Filer {
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/InvokerFiler.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/InvokerFiler.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/InvokerFiler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -25,6 +25,8 @@
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
import org.jboss.soa.esb.monitoring.MonitoringSessionFactory;
import org.jboss.soa.esb.monitoring.pojo.JMXOperation;
import org.jboss.soa.esb.monitoring.pojo.JMXOperationResult;
@@ -65,6 +67,20 @@
* @see org.jboss.soa.esb.monitoring.server.Filer#persistData()
*/
public void persistData() {
+ TransactionStrategy txS = TransactionStrategy.getStrategy();
+ Object txHandle = null;
+
+ if (txS != null)
+ {
+ try
+ {
+ txHandle = txS.suspend();
+ }
+ catch (TransactionStrategyException ex)
+ {
+ }
+ }
+
Session sess = null;
Transaction tx = null;
try {
@@ -86,6 +102,18 @@
sess.flush();
sess.close();
sess = null;
+
+ if (txHandle != null)
+ {
+ try
+ {
+ txS.resume(txHandle);
+ }
+ catch (TransactionStrategyException ex)
+ {
+ logger.error("Problem resuming transaction!", ex);
+ }
+ }
}
}
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/OperationsFiler.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/OperationsFiler.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/OperationsFiler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -28,6 +28,8 @@
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
import org.jboss.soa.esb.message.body.content.ServiceControlCommand;
import org.jboss.soa.esb.monitoring.MonitoringSessionFactory;
import org.jboss.soa.esb.monitoring.OperationsData;
@@ -93,6 +95,20 @@
public void insertOperations(ServiceControlCommand f_ob) {
Session sess = null;
Transaction tx = null;
+ TransactionStrategy txS = TransactionStrategy.getStrategy();
+ Object txHandle = null;
+
+ if (txS != null)
+ {
+ try
+ {
+ txHandle = txS.suspend();
+ }
+ catch (TransactionStrategyException ex)
+ {
+ }
+ }
+
try {
sess = (Session) MonitoringSessionFactory.getInstance().openSession();
tx = sess.beginTransaction();
@@ -119,6 +135,18 @@
sess.flush();
sess.close();
sess = null;
+
+ if (txHandle != null)
+ {
+ try
+ {
+ txS.resume(txHandle);
+ }
+ catch (TransactionStrategyException ex)
+ {
+ logger.error("Problem resuming transaction!", ex);
+ }
+ }
}
}
@@ -130,6 +158,20 @@
public void updateActiveFlag(String serverName) {
Session sess = null;
Transaction tx = null;
+ TransactionStrategy txS = TransactionStrategy.getStrategy();
+ Object txHandle = null;
+
+ if (txS != null)
+ {
+ try
+ {
+ txHandle = txS.suspend();
+ }
+ catch (TransactionStrategyException ex)
+ {
+ }
+ }
+
try {
sess = (Session) MonitoringSessionFactory.getInstance().openSession();
tx = sess.beginTransaction();
@@ -151,6 +193,18 @@
sess.flush();
sess.close();
sess = null;
+
+ if (txHandle != null)
+ {
+ try
+ {
+ txS.resume(txHandle);
+ }
+ catch (TransactionStrategyException ex)
+ {
+ logger.error("Problem resuming transaction!", ex);
+ }
+ }
}
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/StatisticsHelper.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/StatisticsHelper.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/StatisticsHelper.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -212,7 +212,7 @@
*/
public static List getObjectNamesForServer(Session sess, String servername) {
String query = "SELECT DISTINCT jmxa.objectname "
- + "FROM JMXAttribute jmxa, JMXData jmxd "
+ + "FROM JMXATTRIBUTE jmxa, JMXDATA jmxd "
+ "WHERE jmxa.statid = jmxd.statid "
+ "AND jmxd.server = :servername";
SQLQuery sqlq = sess.createSQLQuery(query);
@@ -230,13 +230,13 @@
*/
public static List getAttributes(Session sess, String servername, String objectname) {
String query = "SELECT DISTINCT jmxa.* "
- + "FROM JMXAttribute jmxa, JMXData jmxd "
+ + "FROM JMXATTRIBUTE jmxa, JMXDATA jmxd "
+ "WHERE jmxa.statid = jmxd.statid "
+ "AND jmxd.server = :servername "
+ "AND jmxa.objectname = :objectname";
SQLQuery sqlq = sess.createSQLQuery(query);
sqlq.setString("objectname", objectname);
- sqlq.addEntity(JMXAttribute.class);
+ sqlq.addEntity("JMXATTRIBUTE", JMXAttribute.class);
sqlq.setString("servername", servername);
List result = sqlq.list();
return result;
@@ -252,7 +252,7 @@
*/
public static List getData(Session sess, String servername, Integer attributeId,
Integer timerange) {
- String query = "SELECT data.* from JMXData data "
+ String query = "SELECT data.* from JMXDATA data "
+ "WHERE data.statid = :attributeid "
+ "AND data.server = :servername ";
if (timerange.intValue() != -1) {
Modified: labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/mysql/create_database.sql
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/mysql/create_database.sql 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/mysql/create_database.sql 2008-03-04 16:24:20 UTC (rev 18679)
@@ -13,7 +13,7 @@
STATDATE datetime,
timevalue float,
countvalue integer,
- textvalue varchar(255),
+ textvalue text,
primary key (id)
);
@@ -53,4 +53,4 @@
add index FKD2EA449F4522DA9F(OPID),
add constraint FKD2EA449F4522DA9F
foreign key (OPID)
- references JMXOPERATION(opid);
\ No newline at end of file
+ references JMXOPERATION(opid);
Copied: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/WEB-INF (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/tools/console/management-web/src/main/webapp/WEB-INF)
Deleted: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/tools/console/management-web/src/main/webapp/WEB-INF/jboss-web.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/WEB-INF/jboss-web.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
-
-<jboss-web>
- <depends>jboss.esb:service=ManagementDatabaseInitializer</depends>
-</jboss-web>
Copied: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/WEB-INF/jboss-web.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/product/tools/console/management-web/src/main/webapp/WEB-INF/jboss-web.xml)
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/WEB-INF/jboss-web.xml (rev 0)
+++ labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/WEB-INF/jboss-web.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <depends>jboss.esb:service=ManagementDatabaseInitializer</depends>
+</jboss-web>
Modified: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/attribute.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/attribute.jsp 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/attribute.jsp 2008-03-04 16:24:20 UTC (rev 18679)
@@ -40,7 +40,7 @@
<table cellpadding="5">
<tr>
<td><a href="/jbossesb/operations.jsp">Management</a></td>
- <td><a href="/jbossesb">Back to Console index</a></td>
+ <td><a href="/jbossesb/index.jsp">Back to Console index</a></td>
</table>
<hr>
<%
Modified: labs/jbossesb/trunk/qa/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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"/>
@@ -75,18 +101,19 @@
<echo message="Cleaning..."/>
<delete dir="${build.location}" />
- <ant dir="quickstarts" target="ci-clean" />
</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"/>
+ <jvmarg value="-XX:MaxPermSize=128m"/>
</start-server>
- <wait-on-server/>
+ <wait-on-server seconds="${server.timeout.seconds}"/>
</target>
<target name="stop-server" depends="esb.init">
Modified: labs/jbossesb/trunk/qa/junit/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/junit/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/resources/server/jbpmAsync (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync)
Copied: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/META-INF)
Deleted: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/deployment.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/META-INF/deployment.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,4 +0,0 @@
-<jbossesb-deployment>
- <depends>jboss.esb.qa.junit.destination:service=Queue,name=jbpm_channel</depends>
- <depends>jboss.esb:test=JbpmServer</depends>
-</jbossesb-deployment>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/deployment.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/META-INF/deployment.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/deployment.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,4 @@
+<jbossesb-deployment>
+ <depends>jboss.esb.qa.junit.destination:service=Queue,name=jbpm_channel</depends>
+ <depends>jboss.esb:test=JbpmServer</depends>
+</jbossesb-deployment>
Deleted: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/META-INF/jboss-esb.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,21 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
- <providers>
- <jms-jca-provider name="JBossMQ" connection-factory="ConnectionFactory">
- <jms-bus busid="jbpm_channel">
- <jms-message-filter dest-type="QUEUE" dest-name="queue/jbpm_channel"/>
- </jms-bus>
- </jms-jca-provider>
- </providers>
-
- <services>
- <service category="TestJBPMAsyncESB" name="Echo" description="Echo service">
- <listeners>
- <jms-listener name="JBPM-ESBListener" busidref="jbpm_channel" maxThreads="1"/>
- </listeners>
- <actions>
- <action name="echoAction" class="org.jboss.soa.esb.server.jbpmAsync.EchoSuspendAction"/>
- </actions>
- </service>
- </services>
-</jbossesb>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/jboss-esb.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/META-INF/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/META-INF/jboss-esb.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,21 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+ <providers>
+ <jms-jca-provider name="JBossMQ" connection-factory="ConnectionFactory">
+ <jms-bus busid="jbpm_channel">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/jbpm_channel"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="TestJBPMAsyncESB" name="Echo" description="Echo service">
+ <listeners>
+ <jms-listener name="JBPM-ESBListener" busidref="jbpm_channel" maxThreads="1"/>
+ </listeners>
+ <actions>
+ <action name="echoAction" class="org.jboss.soa.esb.server.jbpmAsync.EchoSuspendAction"/>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Deleted: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbm-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/esb-jbm-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbm-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.qa.junit.destination:service=Queue,name=jbpm_channel"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbm-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/esb-jbm-service.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbm-service.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbm-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=jbpm_channel"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbmq-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/esb-jbmq-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbmq-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.qa.junit.destination:service=Queue,name=jbpm_channel">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbmq-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/esb-jbmq-service.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbmq-service.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/esb-jbmq-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=jbpm_channel">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/jbpmAsyncTest.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/jbpmAsyncTest.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/jbpmAsyncTest.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process-definition name="jBPMAsyncTest">
- <start-state name="start">
- <transition to="node1"/>
- </start-state>
-
- <node name="node1">
- <action name="sendToESB" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
- <esbCategoryName>TestJBPMAsyncESB</esbCategoryName>
- <esbServiceName>Echo</esbServiceName>
- </action>
- <transition to="node2"/>
- </node>
-
- <node name="node2">
- <action name="waitForNotification" class="org.jboss.soa.esb.server.jbpmAsync.JbpmAsyncActionHandler"/>
- <transition to="end"/>
- </node>
-
- <end-state name="end"/>
-</process-definition>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/jbpmAsyncTest.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/jbpmAsyncTest.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/jbpmAsyncTest.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/jbpmAsyncTest.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition name="jBPMAsyncTest">
+ <start-state name="start">
+ <transition to="node1"/>
+ </start-state>
+
+ <node name="node1">
+ <action name="sendToESB" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbCategoryName>TestJBPMAsyncESB</esbCategoryName>
+ <esbServiceName>Echo</esbServiceName>
+ </action>
+ <transition to="node2"/>
+ </node>
+
+ <node name="node2">
+ <action name="waitForNotification" class="org.jboss.soa.esb.server.jbpmAsync.JbpmAsyncActionHandler"/>
+ <transition to="end"/>
+ </node>
+
+ <end-state name="end"/>
+</process-definition>
Deleted: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/test-jbpm-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/test-jbpm-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/test-jbpm-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
- <mbean name="jboss.esb:test=JbpmServer" code="org.jboss.soa.esb.server.jbpmAsync.JbpmServer"/>
-</server>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/test-jbpm-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/resources/server/jbpmAsync/test-jbpm-service.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/test-jbpm-service.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/jbpmAsync/test-jbpm-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <mbean name="jboss.esb:test=JbpmServer" code="org.jboss.soa.esb.server.jbpmAsync.JbpmServer"/>
+</server>
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync)
Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/EchoSuspendAction.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncActionHandler.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmAsyncUnitTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServer.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/jbpmAsync/JbpmServerMBean.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -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) ;
+}
Property changes on: labs/jbossesb/trunk/qa/quickstarts
___________________________________________________________________
Name: svn:ignore
- output
build
+ output
build
junit*.properties
Modified: labs/jbossesb/trunk/qa/quickstarts/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/build.xml 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/build.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -18,7 +18,7 @@
<property name="qa.quickstarts.build" location="${qa.build}/quickstarts"/>
<property name="qa.quickstarts.build.lib" location="${qa.quickstarts.build}/lib"/>
<property name="qa.quickstarts.classes" location="${qa.quickstarts.build}/classes"/>
- <property name="qa.junit.resources" location="resources"/>
+ <property name="qa.quickstarts.resources" location="resources"/>
<property name="qa.quickstarts.report" location="${qa.quickstarts.build}/report"/>
<property name="qa.quickstarts.memory" value="128m"/>
@@ -55,6 +55,12 @@
</path>
<path id="qa.quickstarts.cp">
+ <fileset dir="${product.dir}/services/jbossesb/build">
+ <include name="**/*.jar"/>
+ </fileset>
+ <fileset dir="${product.dir}/services/jbpm/lib/ext">
+ <include name="jbpm-ant.jar"/>
+ </fileset>
<!-- include qs specific jars -->
<fileset dir="${org.jboss.esb.test.quickstarts.dir}">
<include name="bpm_orchestration1/lib/**/*.jar"/>
@@ -68,6 +74,9 @@
<include name="recipient_list/lib/**/*.jar"/>
<include name="scripting_groovy/lib/**/*.jar"/>
<include name="simple_cbr/lib/**/*.jar"/>
+ <include name="spring_aop/lib/**/*.jar"/>
+ <include name="spring_helloworld/lib/**/*.jar"/>
+ <include name="spring_jpetstore/lib/**/*.jar"/>
<include name="static_router/lib/**/*.jar"/>
<include name="transform_CSV2XML/lib/**/*.jar"/>
<include name="transform_EDI2XML_Groovy_XSLT/lib/**/*.jar"/>
@@ -80,28 +89,50 @@
<!-- include qs specific classes -->
<dirset dir="${org.jboss.esb.test.quickstarts.dir}">
<include name="bpm_orchestration1/build/classes"/>
+ <include name="bpm_orchestration2/build/classes"/>
+ <include name="bpm_orchestration3/build/classes"/>
+ <include name="business_rules_service/build/classes"/>
+ <include name="custom_action/build/classes"/>
+ <include name="deadletter/build/classes"/>
<include name="dynamic_router/build/classes"/>
- <include name="fun_cbr/build/classes"/>
+ <include name="exceptions_faults/build/classes"/>
+ <include name="fun_cbr/build/classes"/>
+ <include name="groovy_gateway/build/classes"/>
<include name="helloworld/build/classes"/>
<include name="helloworld_action/build/classes"/>
<include name="helloworld_db_registration/build/classes"/>
<include name="helloworld_file_action/build/classes"/>
+ <include name="helloworld_file_notifier/build/classes"/>
<include name="helloworld_sql_action/build/classes"/>
+ <include name="jms_secured/build/classes"/>
+ <include name="jms_topic/build/classes"/>
+ <include name="load_generator/build/classes"/>
+ <include name="load_generator/load_generator_classes"/>
+ <include name="messagefilter/build/classes"/>
+ <include name="messagestore/build/classes"/>
+ <include name="native_client/build/classes"/>
<include name="recipient_list/build/classes"/>
- <include name="scripting_groovy/build/classes"/>
+ <include name="scheduled_services/build/classes"/>
+ <include name="scripting_groovy/build/classes"/>
<include name="simple_cbr/build/classes"/>
+ <include name="spring_aop/build/classes"/>
+ <include name="spring_helloworld/build/classes"/>
+ <include name="spring_jpetstore/build/classes"/>
<include name="static_router/build/classes"/>
<include name="transform_CSV2XML/build/classes"/>
<include name="transform_EDI2XML_Groovy_XSLT/build/classes"/>
<include name="transform_XML2POJO/build/classes"/>
<include name="transform_XML2XML_date_manipulation/build/classes"/>
<include name="transform_XML2XML_simple/build/classes"/>
- <include name="wiretap/build/classes"/>
+ <include name="webservice_consumer1/build/classes"/>
+ <include name="webservice_consumer2/build/classes"/>
+ <include name="webservice_producer/build/classes"/>
+ <include name="wiretap/build/classes"/>
</dirset>
<fileset dir="${product.lib.ext}" includes="*.jar"/>
<fileset dir="${product.lib}" includes="*.jar"/>
- <pathelement location="${qa.junit.resources}"/>
+ <pathelement location="${qa.quickstarts.resources}"/>
<path refid="base.cp"/>
</path>
@@ -148,29 +179,51 @@
<target name="ci-clean" depends="init, clean-esb"/>
- <target name="compile" depends="compile-esb">
+ <target name="compile" depends="clean, compile-esb">
<echo message="Compiling JUnit based Quickstart tests..."/>
<!-- Build the tests... -->
<mkdir dir="${qa.quickstarts.classes}"/>
-
<javac srcdir="${qa.quickstarts.src}" destdir="${qa.quickstarts.classes}" classpathref="qa.quickstarts.cp" debug="on"/>
-
+ <jar jarfile="${qa.quickstarts.build.lib}/QuickstartMessageStoreServer.sar">
+ <fileset dir="${qa.quickstarts.classes}">
+ <include name="org/jboss/soa/esb/server/*.class"/>
+ </fileset>
+ <fileset dir="${qa.quickstarts.resources}/server"/>
+ </jar>
</target>
<target name="clean-esb" if="quickstarts.exist">
<exec-quickstart quickstart="bpm_orchestration1" target="clean"/>
+ <exec-quickstart quickstart="bpm_orchestration2" target="clean"/>
+ <exec-quickstart quickstart="bpm_orchestration3" target="clean"/>
+ <exec-quickstart quickstart="business_rules_service" target="clean"/>
+ <exec-quickstart quickstart="custom_action" target="clean"/>
+ <exec-quickstart quickstart="deadletter" target="clean"/>
<exec-quickstart quickstart="dynamic_router" target="clean"/>
+ <exec-quickstart quickstart="exceptions_faults" target="clean"/>
<exec-quickstart quickstart="fun_cbr" target="clean"/>
+ <exec-quickstart quickstart="groovy_gateway" target="clean"/>
<exec-quickstart quickstart="helloworld" target="clean"/>
<exec-quickstart quickstart="helloworld_action" target="clean"/>
<exec-quickstart quickstart="helloworld_db_registration" target="clean"/>
<exec-quickstart quickstart="helloworld_file_action" target="clean"/>
+ <exec-quickstart quickstart="helloworld_file_notifier" target="clean"/>
<exec-quickstart quickstart="helloworld_sql_action" target="clean"/>
+ <exec-quickstart quickstart="jms_secured" target="clean"/>
+ <exec-quickstart quickstart="jms_topic" target="clean"/>
+ <exec-quickstart quickstart="load_generator" target="clean"/>
+ <exec-quickstart quickstart="messagefilter" target="clean"/>
+ <exec-quickstart quickstart="messagestore" target="clean"/>
+ <exec-quickstart quickstart="native_client" target="clean"/>
<exec-quickstart quickstart="recipient_list" target="clean"/>
+ <exec-quickstart quickstart="scheduled_services" target="clean"/>
<exec-quickstart quickstart="scripting_groovy" target="clean"/>
<exec-quickstart quickstart="simple_cbr" target="clean"/>
+ <exec-quickstart quickstart="spring_aop" target="clean"/>
+ <exec-quickstart quickstart="spring_helloworld" target="clean"/>
+ <exec-quickstart quickstart="spring_jpetstore" target="clean"/>
<exec-quickstart quickstart="static_router" target="clean"/>
<exec-quickstart quickstart="transform_CSV2XML" target="clean"/>
<exec-quickstart quickstart="transform_EDI2XML_Groovy_XSLT" target="clean"/>
@@ -178,48 +231,96 @@
<exec-quickstart quickstart="transform_XML2XML_date_manipulation" target="clean"/>
<exec-quickstart quickstart="transform_XML2XML_simple" target="clean"/>
<exec-quickstart quickstart="wiretap" target="clean"/>
+ <exec-quickstart quickstart="webservice_consumer1" target="clean"/>
+ <exec-quickstart quickstart="webservice_consumer2" target="clean"/>
+ <exec-quickstart quickstart="webservice_producer" target="clean"/>
</target>
<target name="compile-esb">
<echo>Compile ESB Packages</echo>
<exec-quickstart quickstart="bpm_orchestration1" target="prepare-deployment"/>
+ <exec-quickstart quickstart="bpm_orchestration2" target="prepare-deployment"/>
+ <exec-quickstart quickstart="bpm_orchestration3" target="prepare-deployment"/>
+ <exec-quickstart quickstart="business_rules_service" target="prepare-deployment"/>
+ <exec-quickstart quickstart="custom_action" target="prepare-deployment"/>
+ <exec-quickstart quickstart="deadletter" target="prepare-deployment"/>
<exec-quickstart quickstart="dynamic_router" target="prepare-deployment"/>
+ <exec-quickstart quickstart="exceptions_faults" target="prepare-deployment"/>
+
<exec-quickstart quickstart="fun_cbr" target="prepare-deployment"/>
+ <exec-quickstart quickstart="groovy_gateway" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_action" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_db_registration" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_file_action" target="prepare-deployment"/>
+ <exec-quickstart quickstart="helloworld_file_notifier" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_sql_action" target="prepare-deployment"/>
+ <exec-quickstart quickstart="jms_secured" target="prepare-deployment"/>
+ <exec-quickstart quickstart="jms_topic" target="prepare-deployment"/>
+ <!--
+ <exec-quickstart quickstart="load_generator" target="prepare-deployment"/>
+ -->
+ <exec-quickstart quickstart="messagefilter" target="prepare-deployment"/>
+ <exec-quickstart quickstart="messagestore" target="prepare-deployment"/>
+ <exec-quickstart quickstart="native_client" target="prepare-deployment"/>
<exec-quickstart quickstart="recipient_list" target="prepare-deployment"/>
+ <exec-quickstart quickstart="scheduled_services" target="prepare-deployment"/>
<exec-quickstart quickstart="scripting_groovy" target="prepare-deployment"/>
<exec-quickstart quickstart="simple_cbr" target="prepare-deployment"/>
+ <exec-quickstart quickstart="spring_aop" target="prepare-deployment"/>
+ <exec-quickstart quickstart="spring_helloworld" target="prepare-deployment"/>
+ <exec-quickstart quickstart="spring_jpetstore" target="prepare-deployment"/>
<exec-quickstart quickstart="static_router" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_CSV2XML" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_EDI2XML_Groovy_XSLT" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_XML2POJO" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_XML2XML_date_manipulation" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_XML2XML_simple" target="prepare-deployment"/>
+ <exec-quickstart quickstart="webservice_consumer1" target="prepare-deployment"/>
+ <exec-quickstart quickstart="webservice_consumer2" target="prepare-deployment"/>
+ <exec-quickstart quickstart="webservice_producer" target="prepare-deployment"/>
<exec-quickstart quickstart="wiretap" target="prepare-deployment"/>
-
<copy todir="${qa.quickstarts.build.lib}" flatten="true">
<fileset dir="${org.jboss.esb.test.quickstarts.dir}">
<include name="bpm_orchestration1/build/*.esb"/>
+ <include name="bpm_orchestration2/build/*.esb"/>
+ <include name="bpm_orchestration3/build/*.esb"/>
+ <include name="business_rules_service/build/*.esb"/>
+ <include name="custom_action/build/*.esb"/>
+ <include name="deadletter/build/*.esb"/>
<include name="dynamic_router/build/*.esb"/>
+ <include name="exceptions_faults/build/*.esb"/>
<include name="fun_cbr/build/*.esb"/>
+ <include name="groovy_gateway/build/*.esb"/>
<include name="helloworld/build/*.esb"/>
<include name="helloworld_action/build/*.esb"/>
<include name="helloworld_db_registration/build/*.esb"/>
<include name="helloworld_file_action/build/*.esb"/>
+ <include name="helloworld_file_notifier/build/*.esb"/>
<include name="helloworld_sql_action/build/*.esb"/>
+ <include name="jms_secured/build/*.esb"/>
+ <include name="jms_topic/build/*.esb"/>
+ <include name="load_generator/build/*.esb"/>
+ <include name="messagefilter/build/*.esb"/>
+ <include name="messagestore/build/*.esb"/>
+ <include name="native_client/build/*.esb"/>
<include name="recipient_list/build/*.esb"/>
<include name="scripting_groovy/build/*.esb"/>
+ <include name="scheduled_services/build/*.esb"/>
<include name="simple_cbr/build/*.esb"/>
+ <include name="spring_aop/build/*.esb"/>
+ <include name="spring_helloworld/build/*.esb"/>
+ <include name="spring_jpetstore/build/*.esb"/>
<include name="static_router/build/*.esb"/>
<include name="transform_CSV2XML/build/*.esb"/>
<include name="transform_EDI2XML_Groovy_XSLT/build/*.esb"/>
<include name="transform_XML2POJO/build/*.esb"/>
<include name="transform_XML2XML_date_manipulation/build/*.esb"/>
<include name="transform_XML2XML_simple/build/*.esb"/>
+ <include name="webservice_consumer1/build/*.esb"/>
+ <include name="webservice_consumer1/build/*.war"/>
+ <include name="webservice_consumer2/build/*.esb"/>
+ <include name="webservice_producer/build/*.esb"/>
<include name="wiretap/build/*.esb"/>
</fileset>
</copy>
@@ -261,16 +362,38 @@
<fileset dir="${qa.quickstarts.src}">
<include name="**/${tests.filter}Test.java"/>
<exclude name="${tests.exclude}"/>
+ <!-- Aggregator QS only runs standalone -->
+ <exclude name="**/AggregatorTest.java"/>
+ <!-- GroovyGateway QS requires UI interaction -->
+ <exclude name="**/GroovyGatewayTest.java"/>
+ <!-- SpringJPetStore requires additional configuration
+ files and hsqldb. The QS needs some work before
+ the CI test can run. -->
+ <exclude name="**/SpringJPetStoreTest.java"/>
<exclude name="**/HelloWorldSQLActionTest.java"/>
+ <exclude name="**/BPMOrchestration1Test.java"/>
+ <!-- The following quickstart is broken -->
+ <exclude name="**/BPMOrchestration3Test.java"/>
+ <exclude name="**/HelloWorldFileNotifierTest.java"/>
<exclude name="**/RecipientlistTest.java"/>
- <exclude name="**/FunCBRTest.java"/>
- <exclude name="**/BPMOrchestrationTest.java"/>
- <exclude name="**/SimpleCBRTest.java"/>
+ <exclude name="**/ExceptionsFaultsTest.java"/>
<exclude name="**/DynamicRouterTest.java"/>
+ <!-- The Groovy Gateway test requires testing UI -->
+ <exclude name="**/GroovyGatewayTest.java"/>
+ <exclude name="**/LoadGeneratorTest.java"/>
<exclude name="**/StaticRouterTest.java"/>
- <exclude name="**/WebserviceAdapterTest.java"/>
<exclude name="**/HelloWorldDBRegistrationTest.java"/>
+ <!-- Requires ActiveBPEL and AS -->
<exclude name="**/WebserviceBPELTest.java"/>
+ <!-- The WebService ws-* quickstarts require AS -->
+ <exclude name="**/WebServiceWSAddressingTest.java"/>
+ <exclude name="**/WebServiceWSSecurityTest.java"/>
+ <!-- The WSConsumer QS requires war deployment -->
+ <exclude name="**/WebserviceAdapterTest.java"/>
+ <exclude name="**/WebserviceBPELTest.java"/>
+ <exclude name="**/WebServiceConsumer1Test.java"/>
+ <exclude name="**/WebServiceConsumer2Test.java"/>
+ <exclude name="**/WebServiceProducerTest.java"/>
</fileset>
</batchtest>
<classpath>
@@ -291,8 +414,10 @@
value="${org.jboss.soa.esb.paramsRepository.file.root}"/>
<!-- Sys Props from the test.properties file... -->
+ <!--
<sysproperty key="org.jboss.soa.esb.jndi.server.type" value="${org.jboss.soa.esb.jndi.server.type}"/>
<sysproperty key="org.jboss.soa.esb.jndi.server.url" value="${org.jboss.soa.esb.jndi.server.url}"/>
+ -->
<!-- Sys Props from the deployment.properties file... -->
<sysproperty key="org.jboss.esb.test.ftp.hostname" value="${org.jboss.esb.test.ftp.hostname}"/>
Copied: labs/jbossesb/trunk/qa/quickstarts/resources/server (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/resources/server)
Copied: labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/resources/server/META-INF)
Deleted: labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF/jboss-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/resources/server/META-INF/jboss-service.xml 2008-02-29 14:55:02 UTC (rev 18638)
+++ labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF/jboss-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
- <mbean code="org.jboss.soa.esb.server.QuickstartMessageStoreImpl"
- name="jboss.esb:test=QuickstartMessageStoreServer"/>
-</server>
Copied: labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF/jboss-service.xml (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/resources/server/META-INF/jboss-service.xml)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF/jboss-service.xml (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/resources/server/META-INF/jboss-service.xml 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <mbean code="org.jboss.soa.esb.server.QuickstartMessageStoreImpl"
+ name="jboss.esb:test=QuickstartMessageStoreServer"/>
+</server>
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import java.lang.reflect.UndeclaredThrowableException;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+import org.jboss.soa.esb.server.QuickstartMessageStore;
+import org.jboss.soa.esb.server.QuickstartMessageStoreImplMBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Abstract test case for Quickstart tests
+ *
+ * @author <a href="mailto:kconner at redhat.com">Kevin Conner</a>
+ */
+public abstract class AbstractQuickstartTestCase extends JBossTestCase
+{
+ /**
+ * Construct the test case with the specified name.
+ * @param name The test name.
+ */
+ protected AbstractQuickstartTestCase(final String name)
+ {
+ super(name) ;
+ }
+
+ /**
+ * Clear the messages in the sink.
+ * @throws Exception for unexpected errors.
+ */
+ protected void clearMessages()
+ throws Exception
+ {
+ getQuickstartMessageStore().clearMessages() ;
+ }
+
+ /**
+ * Wait for the specified count of messages.
+ * @param numberOfMessages The expected number of messages.
+ * @param maxDelay The maximum delay to wait for the messages.
+ * @return The message list if present, otherwise current contents.
+ * @throws Exception for unexpected errors.
+ */
+ protected String[] waitForMessages(final int numberOfMessages, final long maxDelay)
+ throws Exception
+ {
+ final String[] sinkMessages = getQuickstartMessageStore().waitForMessages(numberOfMessages, maxDelay) ;
+ final int numberOfSinkMessages = (sinkMessages == null ? 0 : sinkMessages.length) ;
+ assertEquals("Message count", numberOfMessages, numberOfSinkMessages) ;
+ return sinkMessages ;
+ }
+
+ /**
+ * Check the stored messages against the expected messages.
+ * @param maxDelay The maximum delay to wait for the messages.
+ * @param expectedMessages The expected messages.
+ * @throws Exception for unexpected errors.
+ */
+ protected void checkMessages(final long maxDelay, String ... expectedMessages)
+ throws Exception
+ {
+ final int numberOfMessages = (expectedMessages == null ? 0 : expectedMessages.length) ;
+ final String[] sinkMessages = waitForMessages(numberOfMessages, maxDelay) ;
+
+ for(int count = 0 ; count < numberOfMessages ; count++)
+ {
+ assertEquals("Message: " + count, expectedMessages[count],
+ sinkMessages[count]) ;
+ }
+ }
+
+ /**
+ * Check the stored messages against the expected patterns.
+ * @param maxDelay The maximum delay to wait for the messages.
+ * @param expectedPatterns The patterns of the expected messages.
+ * @throws Exception for unexpected errors.
+ */
+ protected void checkPatternMessages(final long maxDelay, String ... expectedPatterns)
+ throws Exception
+ {
+ final int numberOfMessages = (expectedPatterns == null ? 0 : expectedPatterns.length) ;
+ final String[] sinkMessages = waitForMessages(numberOfMessages, maxDelay) ;
+ for(int count = 0 ; count < numberOfMessages ; count++)
+ {
+ final String sinkMessage = sinkMessages[count] ;
+ assertTrue("Message: " + count, (sinkMessage != null) && sinkMessage.matches(expectedPatterns[count])) ;
+ }
+ }
+
+ /**
+ * Get a proxy to the quickstart message store MBean.
+ * @return The mbean proxy.
+ * @throws Exception for unexpected errors.
+ */
+ private QuickstartMessageStore getQuickstartMessageStore()
+ throws Exception
+ {
+ return new QuickstartMessageStoreProxy(getServer()) ;
+ }
+
+ /**
+ * Proxy class to simplify the interactions with the MBean.
+ * @author kevin
+ */
+ private static final class QuickstartMessageStoreProxy implements QuickstartMessageStore
+ {
+ private final MBeanServerConnection serverConnection ;
+
+ QuickstartMessageStoreProxy(final MBeanServerConnection serverConnection)
+ {
+ this.serverConnection = serverConnection ;
+ }
+
+ public void clearMessages()
+ {
+ try
+ {
+ serverConnection.invoke(new ObjectName(QuickstartMessageStoreImplMBean.objectName), "clearMessages",
+ null, null) ;
+ }
+ catch (final RuntimeException re)
+ {
+ throw re ;
+ }
+ catch (final Error error)
+ {
+ throw error ;
+ }
+ catch (final Throwable th)
+ {
+ throw new UndeclaredThrowableException(th) ;
+ }
+ }
+
+ public String[] waitForMessages(int numberOfMessages, long maxDelay)
+ {
+ try
+ {
+ return (String[])serverConnection.invoke(new ObjectName(QuickstartMessageStoreImplMBean.objectName), "waitForMessages",
+ new Object[] {Integer.valueOf(numberOfMessages), Long.valueOf(maxDelay)},
+ new String[] {Integer.TYPE.getName(), Long.TYPE.getName()}) ;
+ }
+ catch (final RuntimeException re)
+ {
+ throw re ;
+ }
+ catch (final Error error)
+ {
+ throw error ;
+ }
+ catch (final Throwable th)
+ {
+ throw new UndeclaredThrowableException(th) ;
+ }
+ }
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AggregatorTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AggregatorTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AggregatorTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AggregatorTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,44 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+/**
+ * This is intended to be a placeholder for a test for the aggregator QS. The aggregator
+ * QS only runs standalone - does not run within AS, so
+ *
+ * @author tcunning
+ *
+ */
+public class AggregatorTest extends AbstractQuickstartTestCase {
+ public AggregatorTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(HelloWorldTest.class, "QuickstartMessageStoreServer.sar, Quickstart_Aggregator.esb");
+ }
+}
\ No newline at end of file
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage;
+
+/**
+ * CI test for the bpmorchestration1 test.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class BPMOrchestration1Test extends AbstractQuickstartTestCase {
+ private static final String DEPLOY_MESSAGE = "Go Deploy It";
+ private static final String START_MESSAGE = "Start It Up";
+
+ public BPMOrchestration1Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendDeployMessage() ;
+ checkMessages(30000, DEPLOY_MESSAGE) ;
+
+ clearMessages() ;
+ sendStartMessage() ;
+ checkMessages(30000, START_MESSAGE) ;
+ }
+
+ public void sendDeployMessage() throws Exception {
+ SendTestMessage sm = new SendTestMessage();
+ sm.sendMessage(Helpers.getQuickstartLocation("bpm_orchestration1/build/inputdir"), ".deployProcessGW", DEPLOY_MESSAGE);
+ }
+
+ public void sendStartMessage() throws Exception {
+ SendTestMessage stm = new SendTestMessage();
+ stm.sendMessage(Helpers.getQuickstartLocation("bpm_orchestration1/build/inputdir"), ".startProcessGW", START_MESSAGE);
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(BPMOrchestration1Test.class, "QuickstartMessageStoreServer.sar, Quickstart_bpm_orchestration1.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.test.SendJMSMessageDeploy;
+import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.test.SendJMSMessageStart;
+
+import org.jbpm.ant.DeployProcessToServerTask;
+import org.jbpm.ant.ProcessDeployer;
+
+/**
+ * CI test for the bpmorchestration2 test.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class BPMOrchestration2Test extends AbstractQuickstartTestCase {
+ private static final String DEPLOY_DEF_MESSAGE = "Hello World: Deploy the process def";
+
+ private static final String GETTING_STARTED_MESSAGE = "Getting Started";
+ private static final String RECEIVE_ORDER_MESSAGE = GETTING_STARTED_MESSAGE + " 'Receive Order' " ;
+ private static final String CREDIT_CHECK_MESSAGE = RECEIVE_ORDER_MESSAGE + " 'Credit Check' " ;
+ private static final String VALIDATE_ORDER_MESSAGE = CREDIT_CHECK_MESSAGE + " 'Validate Order' " ;
+ private static final String INVENTORY_CHECK_MESSAGE = VALIDATE_ORDER_MESSAGE + " 'Inventory Check' " ;
+ private static final String SHIPPED_MESSAGE = " 'Shipped' " ;
+
+ public BPMOrchestration2Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ sendDeployMessage() ;
+
+ clearMessages() ;
+ sendStartMessage() ;
+
+ final String[] messages = waitForMessages(9, 30000) ;
+ assertEquals(GETTING_STARTED_MESSAGE, messages[0]) ;
+ assertEquals(RECEIVE_ORDER_MESSAGE, messages[1]) ;
+ assertEquals(CREDIT_CHECK_MESSAGE, messages[2]) ;
+ assertEquals(VALIDATE_ORDER_MESSAGE, messages[3]) ;
+ assertEquals(INVENTORY_CHECK_MESSAGE, messages[4]) ;
+ assertTrue("Shipped triggered", (messages[8] != null) && messages[8].endsWith(SHIPPED_MESSAGE)) ;
+ }
+
+ public void sendDeployMessage() throws Exception {
+ ProcessDeployer pd = new ProcessDeployer();
+ ArrayList<File> files = new ArrayList<File>();
+ String processDef = Helpers.getQuickstartLocation("bpm_orchestration2/processDefinition");
+ File processDefDir = new File(processDef);
+ File[] processFiles = processDefDir.listFiles();
+ for (int i= 0; i< processFiles.length; i++) {
+ files.add(processFiles[i]);
+ }
+ pd.execute("localhost", "8080", "/jbpm-console/upload", files);
+ }
+
+ public void sendStartMessage() throws Exception {
+ SendJMSMessageStart sm = new SendJMSMessageStart();
+ sm.setupConnection();
+ sm.sendAMessage(GETTING_STARTED_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(BPMOrchestration2Test.class, "QuickstartMessageStoreServer.sar, Quickstart_bpm_orchestration2.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration3.test.SendJMSMessage;
+
+/**
+ * CI test for the bpmorchestration3 test.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class BPMOrchestration3Test extends AbstractQuickstartTestCase {
+ private static final String DEPLOY_MESSAGE = "Hello Deploy";
+ private static final String START_MESSAGE = "Hello start";
+ private static final String SERVICE_1_MESSAGE = START_MESSAGE + " 'Service 1' ";
+ private static final String SERVICE_2_MESSAGE = SERVICE_1_MESSAGE + " 'Service 2' ";
+ private static final String SERVICE_3_MESSAGE = SERVICE_2_MESSAGE + " 'Service 3' ";
+
+ public BPMOrchestration3Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendDeployMessage() ;
+ checkMessages(30000, DEPLOY_MESSAGE, "Success:" + DEPLOY_MESSAGE) ;
+
+ clearMessages() ;
+ sendStartMessage() ;
+ checkMessages(30000, START_MESSAGE, SERVICE_1_MESSAGE,
+ SERVICE_2_MESSAGE, SERVICE_3_MESSAGE) ;
+ }
+
+ public void sendDeployMessage() throws Exception {
+ SendJMSMessage sdm = new SendJMSMessage();
+ sdm.setupConnection("queue/quickstart_bpm_orchestration3_deploy_Request_gw");
+ sdm.sendAMessage("Hello Deploy", null);
+ sdm.stop();
+ }
+
+ public void sendStartMessage() throws Exception {
+ SendJMSMessage ssm = new SendJMSMessage();
+ ssm.setupConnection("queue/quickstart_bpm_orchestration3_start_Request_gw");
+ ssm.sendAMessage("Hello start", "${token}");
+ ssm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(BPMOrchestration3Test.class, "QuickstartMessageStoreServer.sar, Quickstart_bpm_orchestration3.esb");
+ }
+}
Deleted: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,56 +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.quickstart.test;
-
-import junit.framework.Test;
-
-import org.jboss.test.JBossTestCase;
-
-
-/**
- * Sample client for the jboss container.
- *
- * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
- */
-public class BPMOrchestrationTest
- extends JBossTestCase
-{
- public BPMOrchestrationTest(String name)
- {
- super(name);
- }
-
- public void testMessage() throws Exception
- {
- sendMessage();
- Thread.sleep(10000); // wait for message to post.
- }
-
- public void sendMessage() throws Exception
- {
- }
-
- public static Test suite() throws Exception
- {
- return getDeploySetup(BPMOrchestrationTest.class, "Quickstart_bpm_orchestration1.esb");
- }
-}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.businessrules.test.SendJMSMessage;
+
+/**
+ * CI test for the businessrulesservice quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class BusinessRulesServiceTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE =
+ "<Order netAmount=\"59.97\" orderDate=\"Wed Nov 15 13:45:28 EST 2006\" orderId=\"1\" statusCode=\"0\" tax=\"4.95\" totalAmount=\"64.92\">" +
+ " <Customer firstName=\"Harry\" lastName=\"Fletcher\" state=\"SD\" userName=\"user1\"/>" +
+ " <OrderLines>" +
+ " <OrderLine position=\"1\" quantity=\"1\">" +
+ " <Product price=\"29.98\" productId=\"364\" title=\"The 40-Year-Old Virgin \"/>" +
+ " </OrderLine>" +
+ " <OrderLine position=\"2\" quantity=\"1\">" +
+ " <Product price=\"29.99\" productId=\"299\" title=\"Pulp Fiction\"/>" +
+ " </OrderLine>" +
+ " </OrderLines>" +
+ "</Order>" ;
+
+ public BusinessRulesServiceTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages();
+ sendMessage();
+ final String[] messages = waitForMessages(1, 30000) ;
+ assertTrue("XML response message", Helpers.compareXMLContent(JMS_MESSAGE, messages[0])) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ String fileContent = sm.readAsciiFile(Helpers.getQuickstartLocation("business_rules_service/SampleOrder.xml"));
+ sm.sendAMessage(fileContent) ;
+ sm.stop();
+
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(BusinessRulesServiceTest.class, "QuickstartMessageStoreServer.sar, Quickstart_business_rules_service.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/CustomActionTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/CustomActionTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/CustomActionTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/CustomActionTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,58 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import org.jboss.soa.esb.samples.quickstart.customaction.test.SendJMSMessage;
+
+import junit.framework.Test;
+
+/**
+ * CI test for customaction test.
+ *
+ * @author tcunning
+ */
+public class CustomActionTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "Via Gateway";
+
+ public CustomActionTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage();
+ final String[] sinkMessages = waitForMessages(1, 30000) ;
+ assertTrue("Expected to find string " + JMS_MESSAGE + " found " + sinkMessages[0],
+ sinkMessages[0].contains(JMS_MESSAGE));
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE) ;
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(CustomActionTest.class, "QuickstartMessageStoreServer.sar, Quickstart_custom_action.esb");
+ }
+}
\ No newline at end of file
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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-2007,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.deadletter.test.SendJMSMessage;
+
+
+/**
+ * CI test for the DeadLetter quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class DeadLetterTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "DeadLetterTest message";
+
+ public DeadLetterTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage();
+ checkPatternMessages(30000, '^' + JMS_MESSAGE + ".*$") ;
+ } /* method */
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE) ;
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(DeadLetterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_deadletter.esb");
+ }
+} /* class */
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,29 +21,19 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.dynamicRouter.test.ReceiveJMSMessage;
import org.jboss.soa.esb.samples.quickstart.dynamicRouter.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the dynamicouter QS.
*
- * @author <a href="mailto:"></a>
- * @version $Id: $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
-public class DynamicRouterTest extends JBossTestCase
+public class DynamicRouterTest extends AbstractQuickstartTestCase
{
private static final String JMS_MESSAGE = "DynamicRouterTest message";
- private static final String FILE_NAME = "DynamicRouterTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 3;
public DynamicRouterTest(String name)
{
@@ -52,35 +42,9 @@
public void testMessage() throws Exception
{
- sendMessage();
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail ("Event file " + LOG_FILE + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE, EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail ("Event file " + LOG_FILE + " not complete - expected " + EXPECTED_RECORD_COUNT
- + " records - found " + temp.size() + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage1 = (String) theTable.get("Message1");
- String theMessage2 = (String) theTable.get("Message2");
- String theMessage3 = (String) theTable.get("Message3");
-
- assertEquals("The strings1 should match", theMessage1, JMS_MESSAGE);
- assertEquals("The strings2 should match", theMessage2, JMS_MESSAGE);
- assertEquals("The strings3 should match", theMessage3, JMS_MESSAGE);
-
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception
@@ -94,12 +58,12 @@
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception
{
- return getDeploySetup(DynamicRouterTest.class, "Quickstart_dynamic_router.esb");
+ return getDeploySetup(DynamicRouterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_dynamic_router.esb");
}
}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,57 @@
+/*
+ * 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.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.exceptions.test.SendJMSMessage;
+
+/**
+ * CI test for the exceptionsfaults quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:ldimaggi at redhat.com">Len Dimaggio</a>
+ */
+public class ExceptionsFaultsTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "HelloWorldTest message";
+
+ public ExceptionsFaultsTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE, "CHECK") ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection("queue/quickstart_exceptions_faults_GW");
+ sm.sendAMessage("ExceptionCaughtService", "Via Gateway");
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(ExceptionsFaultsTest.class, "QuickstartMessageStoreServer.sar, Quickstart_exceptions_faults.esb");
+ }
+}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -23,35 +23,44 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
+import org.jboss.soa.esb.samples.quickstart.funcbr.test.SendJMSMessage;
/**
- * Sample client for the jboss container.
+ * CI test for the funcbr quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:ldimaggi at redhat.com">Len Dimaggio</a>
*/
+public class FunCBRTest
+ extends AbstractQuickstartTestCase {
-public class FunCBRTest
- extends JBossTestCase
-{
- public FunCBRTest(String name)
- {
+ private static String theXML = "<Order orderId=\"1\" "
+ + "orderDate=\"Wed Nov 15 13:45:28 EST 2006\" "
+ + "statusCode=\"0\" " + "netAmount=\"59.97\" "
+ + "totalAmount=\"64.92\" " + "tax=\"4.95\" "
+ + "junk=\"FunCBRTest message\"></Order>";
+
+ public FunCBRTest(String name) {
super(name);
- }
+ } /* method */
- public void testMessage() throws Exception
- {
- sendMessage();
- Thread.sleep(10000); // wait for message to post.
- }
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
+ assertTrue("XML Content", Helpers.compareXMLContent(theXML, messages[0])) ;
+ } /* method */
- public void sendMessage() throws Exception
- {
- }
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(theXML);
+ sm.stop();
+ } /* method */
- public static Test suite() throws Exception
- {
- return getDeploySetup(FunCBRTest.class, "Quickstart_fun_cbr.esb");
- }
-}
+ public static Test suite() throws Exception {
+ return getDeploySetup(FunCBRTest.class, "QuickstartMessageStoreServer.sar, Quickstart_fun_cbr.esb");
+ } /* method */
+
+} /* class */
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/GroovyGatewayTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/GroovyGatewayTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/GroovyGatewayTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/GroovyGatewayTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,44 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+/**
+ * This is intended to be a placeholder for a test for the groovygateway QS. The groovygateway
+ * QS requires GUI interaction, so this is a placeholder for a future test.
+ *
+ * @author tcunning
+ *
+ */
+public class GroovyGatewayTest extends AbstractQuickstartTestCase {
+ public GroovyGatewayTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(GroovyGatewayTest.class, "QuickstartMessageStoreServer.sar, Quickstart_groovy_gateway.esb");
+ }
+}
\ No newline at end of file
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,76 +21,39 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworldaction.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the helloworldaction quickstart.
*
- * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z
- * scott.stark at jboss.org $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class HelloWorldActionTest extends JBossTestCase {
+public class HelloWorldActionTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldActionTest message";
- private static final String RESPONSE_MESSAGE = "BEFORE**" + JMS_MESSAGE + "AFTER**" ;
- private static final String FILE_NAME = "HelloWorldActionTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
+ private static final String RESPONSE_MESSAGE = "\nBEFORE**\n" + JMS_MESSAGE + "\nAFTER**\n" ;
public HelloWorldActionTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", RESPONSE_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, RESPONSE_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
return getDeploySetup(HelloWorldActionTest.class,
- "Quickstart_helloworld_action.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_helloworld_action.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,72 +21,37 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworlddbregistration.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the helloworlddbregistration quickstart.
*
- * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z
- * scott.stark at jboss.org $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
-public class HelloWorldDBRegistrationTest extends JBossTestCase {
+public class HelloWorldDBRegistrationTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldDBRegistrationTest message";
- private static final String FILE_NAME = "HelloWorldDBRegistrationTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
public HelloWorldDBRegistrationTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", theMessage, JMS_MESSAGE);
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
return getDeploySetup(HelloWorldDBRegistrationTest.class,
- "Quickstart_db_registration.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_db_registration.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -24,31 +24,21 @@
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
-import java.util.Hashtable;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.test.JBossTestCase;
-
/**
- * Sample client for the jboss container.
+ * CI test for the helloworldfileaction quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
public class HelloWorldFileActionTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
- private static final String FILE_NAME = "HelloWorldFileActionTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
private static final String INPUT_DIRECTORY = "helloworld_file_action/build/dirs/input/";
private static final String INPUT_FILE_NAME = "MyInput.dat";
- private static final String OUTPUT_DIRECTORY = "helloworld_file_action/build/dirs/output/";
- private static final String OUTPUT_FILE_NAME = OUTPUT_DIRECTORY + "MyInput.dat.sentToEsb";
private static final String FILE_CONTENTS = "Hello World In A File";
- private static final String RESPONSE_CONTENTS = "BEFORE"+FILE_CONTENTS+"AFTER";
+ private static final String RESPONSE_CONTENTS = "\nBEFORE\n"+FILE_CONTENTS+"\nAFTER\n";
public HelloWorldFileActionTest(String name)
{
@@ -57,79 +47,23 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
- final String outputFileName = Helpers.getQuickstartLocation(OUTPUT_FILE_NAME) ;
-
- createFileAction();
-
- /* Verify that the output file is created */
- boolean fileExists = Helpers.checkForFile(outputFileName);
- if (!fileExists) {
- fail("File " + outputFileName
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is created */
- fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the log file is complete */
- boolean logFileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!logFileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("File Action Output file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- /* Check the log file */
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings in the log file should match", RESPONSE_CONTENTS, theMessage);
-
- /* Verify that the output file is complete */
- boolean fileComplete = Helpers.checkFileContent(outputFileName,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(outputFileName);
- fail("File Action Output file " + outputFileName + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- theTable = Helpers.getMessageString(outputFileName);
- theMessage = (String) theTable.get("Message1");
- assertEquals("The strings in output file should match", FILE_CONTENTS, theMessage);
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ createFileAction();
+ checkMessages(30000, RESPONSE_CONTENTS) ;
} /* method */
public void createFileAction() throws Exception
{
- String tempStr = FILE_CONTENTS + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END;
final String inputDirectory = Helpers.getQuickstartLocation(INPUT_DIRECTORY) ;
File x = new File(inputDirectory, INPUT_FILE_NAME);
- try {
BufferedWriter out = new BufferedWriter(new FileWriter(x));
- out.write(tempStr.toCharArray());
+ out.write(FILE_CONTENTS);
out.close();
- } catch (Exception e) {
- System.out.println("Error while writing the file: " + x.getAbsolutePath());
- System.out.println(e.getMessage());
- }
} /* method */
public static Test suite() throws Exception
{
- return getDeploySetup(HelloWorldFileActionTest.class, "Quickstart_helloworld_file_action.esb");
+ return getDeploySetup(HelloWorldFileActionTest.class, "QuickstartMessageStoreServer.sar, Quickstart_helloworld_file_action.esb");
} /* method */
} /*/class */
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,56 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.helloworldfilenotifier.test.SendJMSMessage;
+
+/**
+ * CI test for the helloworldfilenotifier quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class HelloWorldFileNotifierTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "HelloWorldFileNotifierTest message";
+
+ public HelloWorldFileNotifierTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(HelloWorldFileNotifierTest.class, "QuickstartMessageStoreServer.sar, Quickstart_helloworld_file_notifier.esb");
+ }
+}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,32 +21,27 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import junit.framework.Test;
-
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.test.JBossTestCase;
-
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
import java.util.Vector;
+import junit.framework.Test;
+
/**
- * Sample client for the jboss container.
+ * CI test for the helloworldsqlaction quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class HelloWorldSQLActionTest extends JBossTestCase {
+public class HelloWorldSQLActionTest extends AbstractQuickstartTestCase {
- private static final String FILE_NAME = "HelloWorldSQLActionTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
-
-
public HelloWorldSQLActionTest(String name) {
super(name);
}
public void testMessage() throws Exception {
+ fail("Not supported yet") ;
sendMessage();
// Commented out 20070824 - ldimaggi - the log file is not
@@ -102,22 +97,21 @@
// Could not connect to the database
}
- String loggingInfo = StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + LOG_FILE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END;
Vector<String> theRecords = new Vector<String>();
- String tempStr = "insert into gateway_table values(0,'data 111111 " + loggingInfo + " ','p')";
+ String tempStr = "insert into gateway_table values(0,'data 111111','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data 22 " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data 22','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data 333333333333111111 " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data 333333333333111111','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data d d d d " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data d d d d','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data data last record " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data data last record','p')";
theRecords.add(tempStr);
for (int i = 0; i < theRecords.size(); i++) {
@@ -134,7 +128,7 @@
public static Test suite() throws Exception {
return getDeploySetup(HelloWorldSQLActionTest.class,
- "Quickstart_helloworld_SQL_action.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_helloworld_SQL_action.esb");
}/* method */
} /* class */
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,78 +21,36 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the helloworld quickstart.
*
- * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z
- * scott.stark at jboss.org $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
-public class HelloWorldTest extends JBossTestCase {
+public class HelloWorldTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldTest message";
- private static final String FILE_NAME = "HelloWorldTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public HelloWorldTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END) ;
+ sm.sendAMessage(JMS_MESSAGE) ;
sm.stop();
}
public static Test suite() throws Exception {
- return getDeploySetup(HelloWorldTest.class, "Quickstart_helloworld.esb");
+ return getDeploySetup(HelloWorldTest.class, "QuickstartMessageStoreServer.sar, Quickstart_helloworld.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -23,134 +23,26 @@
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileReader;
import java.io.IOException;
import java.io.StringReader;
-import java.util.Hashtable;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.testutils.IdentitySAXHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import junit.framework.Assert;
-
/**
* Helper class for quickstart tests
*
*/
public class Helpers {
- public static final int FILE_TIMER = 3000;
- public static final int FILE_COUNTER = 5;
- /* Read the message files into a hash */
- public static Hashtable<String, String> getMessageString(String fileName) {
- Hashtable<String,String> returnTable = new Hashtable<String,String>();
- int theCounter = 1;
- try {
- BufferedReader in = new BufferedReader(new FileReader(fileName));
- String str;
- while ((str = in.readLine()) != null) {
- final int startTag = str.indexOf(StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START);
- if (startTag == -1) {
- break ;
- }
- final int endTag = str.indexOf(StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END) ;
- final String returnString ;
- if (endTag > startTag) {
- final int endIndex = endTag + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END.length() ;
- if (endIndex < str.length()-1) {
- returnString = str.substring(0, startTag) + str.substring(endIndex) ;
- } else {
- returnString = str.substring(0, startTag) ;
- }
- } else {
- returnString = str ;
- }
- returnTable.put("Message" + theCounter++, returnString);
- }
- in.close();
- } catch (IOException e) {
- Assert.fail("Cannot read file: " + fileName);
- }
- return returnTable;
- } /* method */
-
- /* Read the message files into a hash- used by HelloWorldFileActionTest */
- public static Hashtable<String, String> getFileActionMessageString(String fileName) {
- Hashtable<String,String> returnTable = new Hashtable<String,String>();
- int theCounter = 1;
- try {
- BufferedReader in = new BufferedReader(new FileReader(fileName));
- String str;
- while ((str = in.readLine()) != null) {
- returnTable.put("Message" + theCounter++, str);
- }
- in.close();
- } catch (IOException e) {
- Assert.fail("Cannot read file: " + fileName);
- }
- return returnTable;
- } /* method */
-
- /* Determine if the event file has been written */
- public static boolean checkForFile(String fileName) throws Exception {
- boolean wasFileFound = false;
- /* Look for file, if it's there, set the boolean and return, if it's
- * not, wait and try again */
- final File file = new File(fileName) ;
- for (int i = 0; i < FILE_COUNTER; i++) {
- boolean exists = file.exists();
- if (exists) {
- wasFileFound = true;
- break;
- }
- else {
- Thread.sleep(FILE_TIMER);
- }
- }
- return wasFileFound;
- } /* method */
-
- /* Determine if the event file has the correct # of entries written to it - this is probably
- * only needed for tests that write the same message to multiple queues - for example,
- * the RecipientlistTest */
- public static boolean checkFileContent(String fileName, int recordCount) throws Exception {
- boolean correctFileSize = false;
-
- /* Determine the number of records in the file, if it's not correct
- * wait and try again */
- for (int i = 0; i < FILE_COUNTER; i++) {
- Hashtable<String, String> theTable = getMessageString(fileName);
- int theKeys = theTable.size();
- if (theKeys == recordCount){
- correctFileSize = true;
- break;
- }
- else {
- Thread.sleep(FILE_TIMER);
- }
- }
- return correctFileSize;
- } /* method */
-
-
- public static String getTempDir(String filename)
- {
- String tmpDir="";
- if (!filename.startsWith(File.separator)) {
- tmpDir = System.getProperty("java.io.tmpdir") + File.separator;
- }
- return tmpDir;
- }
-
public static String getQuickstartLocation(final String location)
throws IOException
{
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSSecuredTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSSecuredTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSSecuredTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSSecuredTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,56 @@
+/*
+ * 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.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.jmssecured.test.SendJMSMessage;
+
+/**
+ * CI test for the jms_secured quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class JMSSecuredTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "Hello Secured JMS World";
+
+ public JMSSecuredTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages();
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE);
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(JMSSecuredTest.class, "QuickstartMessageStoreServer.sar, Quickstart_JMS_Secured.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,56 @@
+/*
+ * 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.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.jmstopic.SendJMSMessage;
+
+/**
+ * CI test for the jmstopic quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class JMSTopicTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "JMSTopic message";
+
+ public JMSTopicTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(JMSTopicTest.class, "QuickstartMessageStoreServer.sar, Quickstart_jms_topic.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,55 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+/**
+ * CI test for the loadgenerator quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class LoadGeneratorTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "HelloWorldTest message";
+
+ public LoadGeneratorTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ fail("Not yet implemented") ;
+ sendMessage();
+ }
+
+ public void sendMessage() throws Exception {
+ // The groovy classes below need to be compiled intot the esb
+
+ //JMSLoadAgent jmsla = new JMSLoadAgent("load_generator_classes/load.xml");
+ //jmsla.generateLoad();
+ //LoadReport reporter = new LoadReport("load_generator_classes/load.xml");
+ //reporter.generateMetrics();
+
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(LoadGeneratorTest.class, "QuickstartMessageStoreServer.sar, Quickstart_load_generator.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,59 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.messagefilter.Order;
+import org.jboss.soa.esb.samples.quickstart.messagefilter.test.SendJMSMessage;
+
+/**
+ * CI test for the messagefilter quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class MessageFilterTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "10";
+ private static final String RESULT_PATTERN = "org.jboss.soa.esb.samples.quickstart.messagefilter.Order.*";
+
+ public MessageFilterTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkPatternMessages(30000, RESULT_PATTERN) ;
+ }
+
+ public void sendMessage() throws Exception {
+ Order order = new Order();
+ order.setQuantity(Integer.valueOf(JMS_MESSAGE));
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(order);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(MessageFilterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_messagefilter.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,55 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.messagestore.test.SendJMSMessage;
+
+/**
+ * CI test for the messagestore quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class MessageStoreTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "MessageStoreTest message";
+
+ public MessageStoreTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE, "Success:" + JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(MessageStoreTest.class, "QuickstartMessageStoreServer.sar, Quickstart_messagestore.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/NativeClientTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/NativeClientTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/NativeClientTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/NativeClientTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,42 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+/**
+ * This is intended to be a placeholder for a test for the nativeclient QS.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class NativeClientTest extends AbstractQuickstartTestCase {
+ public NativeClientTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(NativeClientTest.class, "QuickstartMessageStoreServer.sar, Quickstart_native_client.esb");
+ }
+}
\ No newline at end of file
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,29 +21,20 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.recipientList.test.SendCBRJMSMessage;
import org.jboss.soa.esb.samples.quickstart.recipientList.test.SendStaticRouterJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the recipientlist quickstart.
*
- * @author <a href="mailto:"></a>
- * @version $Id: $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
-public class RecipientlistTest extends JBossTestCase {
+public class RecipientlistTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "RecipientlistTest message";
- private static final String FILE_NAME = "RecipientlistTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
private static final String JMS_CBR_MESSAGE = "<Order sampleData=\"CBR test\" testDate=\"20070518\" routeToFollow=\"both\"><Customer userName=\"user1\" firstName=\"Harry\" lastName=\"Fletcher\" state=\"SD\"/></Order>";
- private static final int EXPECTED_RECORD_COUNT = 3;
public RecipientlistTest(String name) {
super(name);
@@ -58,56 +49,27 @@
}
public void testStaticMessage() throws Exception {
- sendStaticRouterJMSMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail ("Event file " + LOG_FILE + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE, EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail ("Event file " + LOG_FILE + " not complete - expected " + EXPECTED_RECORD_COUNT
- + " records - found " + temp.size() + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage1 = (String) theTable.get("Message1");
- String theMessage2 = (String) theTable.get("Message2");
- String theMessage3 = (String) theTable.get("Message3");
-
- assertEquals("The strings should match1", theMessage1, JMS_MESSAGE);
- assertEquals("The strings should match2", theMessage2, JMS_MESSAGE);
- assertEquals("The strings should match3", theMessage3, JMS_MESSAGE);
-
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendStaticRouterJMSMessage() ;
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE, JMS_MESSAGE) ;
}
public void sendCBRJMSMessage() throws Exception {
SendCBRJMSMessage sm = new SendCBRJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_CBR_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_CBR_MESSAGE);
sm.stop();
}
public void sendStaticRouterJMSMessage() throws Exception {
SendStaticRouterJMSMessage sm = new SendStaticRouterJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
return getDeploySetup(RecipientlistTest.class,
- "Quickstart_recipient_list.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_recipient_list.esb");
}
}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,45 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+/**
+ * CI test for the scheduledservices quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class ScheduledServicesTest extends AbstractQuickstartTestCase {
+ private static final String RESULT = "Hello Scheduled World .*";
+
+ public ScheduledServicesTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ // No clear or send on this
+ checkPatternMessages(30000, RESULT, RESULT) ;
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(ScheduledServicesTest.class, "QuickstartMessageStoreServer.sar, Quickstart_scheduled_services.esb");
+ }
+}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -22,76 +22,37 @@
package org.jboss.soa.esb.quickstart.test;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
+
import org.jboss.soa.esb.samples.quickstart.scriptinggroovy.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
-import java.io.File;
-import java.util.Hashtable;
-
/**
- * Sample client for the jboss container.
+ * CI test for the scriptinggroovy quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
public class ScriptingGroovyTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "ScriptingGroovyTest message";
- private static final String FILE_NAME = "ScriptingGroovyTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public ScriptingGroovyTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE);
- if (logFile.exists()) {
- assertTrue("Deleting logfile", logFile.delete());
- }
-
+ clearMessages() ;
sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = theTable.get("Message1");
-
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete());
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
- return getDeploySetup(ScriptingGroovyTest.class, "scripting-groovy-quickstart.esb");
+ return getDeploySetup(ScriptingGroovyTest.class, "QuickstartMessageStoreServer.sar, scripting-groovy-quickstart.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -23,34 +23,43 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
+import org.jboss.soa.esb.samples.quickstart.simplecbr.test.SendJMSMessage;
/**
- * Sample client for the jboss container.
+ * CI test for the simplecbr quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:ldimaggi at redhat.com">Len Dimaggio</a>
*/
public class SimpleCBRTest
- extends JBossTestCase
-{
- public SimpleCBRTest(String name)
- {
+ extends AbstractQuickstartTestCase {
+
+ private static String theXML = "<Order orderId=\"1\" "
+ + "orderDate=\"Wed Nov 15 13:45:28 EST 2006\" "
+ + "statusCode=\"0\" " + "netAmount=\"59.97\" "
+ + "totalAmount=\"64.92\" " + "tax=\"4.95\" "
+ + "junk=\"SimpleCBRTest message\"></Order>";
+
+ public SimpleCBRTest(String name) {
super(name);
- }
+ } /* method */
- public void testMessage() throws Exception
- {
- sendMessage();
- Thread.sleep(10000); // wait for message to post.
- }
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, theXML) ;
+ } /* method */
- public void sendMessage() throws Exception
- {
- }
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(theXML);
+ sm.stop();
+ } /* method */
- public static Test suite() throws Exception
- {
- return getDeploySetup(SimpleCBRTest.class, "Quickstart_simple_cbr.esb");
- }
-}
+ public static Test suite() throws Exception {
+ return getDeploySetup(SimpleCBRTest.class, "QuickstartMessageStoreServer.sar, Quickstart_simple_cbr.esb");
+ } /* method */
+
+} /* class */
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,59 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.spring_aop.test.SendJMSMessage;
+
+/**
+ * CI test for the springAOP quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+
+public class SpringAOPTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "SpringAOPTest message";
+ private static final String RESULT_MESSAGE = "I used AOP to change the greeting! JMS has got nothin on me!";
+
+ public SpringAOPTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, RESULT_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE) ;
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(SpringAOPTest.class, "QuickstartMessageStoreServer.sar, Quickstart_spring_aop.esb");
+ }
+}
+
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,59 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.spring_helloworld.test.SendJMSMessage;
+
+/**
+ * CI test for the SpringHelloWorld quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+
+public class SpringHelloWorldTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "SpringHelloWorldTest message";
+ private static final String RESULT_MESSAGE = "SpringHelloWorldTest message\nhello from Spring\ngoodbye from Spring\nhello from Spring\ngoodbye from Spring";
+
+ public SpringHelloWorldTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, RESULT_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE) ;
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(SpringHelloWorldTest.class, "QuickstartMessageStoreServer.sar, spring_helloworld.esb");
+ }
+}
+
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,65 @@
+
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.spring_jpetstore.test.SendJMSMessage;
+import org.jboss.soa.esb.util.FileUtil;
+
+/**
+ * CI test for the SpringJPetStore quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+
+public class SpringJPetStoreTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "SpringJPetStoreTest message";
+
+ public SpringJPetStoreTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ String orderFile = Helpers.getQuickstartLocation("spring_jpetstore/sample-order.xml");
+ File target = new File(orderFile);
+ String targetString = FileUtil.readTextFile(target);
+ sm.sendAMessage(targetString);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(SpringJPetStoreTest.class, "QuickstartMessageStoreServer.sar, spring_jpetstore.esb");
+ }
+}
+
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -23,16 +23,14 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
-
/**
- * Sample client for the jboss container.
+ * CI test for the staticrouter quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class StaticRouterTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
public StaticRouterTest(String name)
{
@@ -41,6 +39,7 @@
public void testMessage() throws Exception
{
+ fail("Not yet implemented") ;
sendMessage();
Thread.sleep(10000); // wait for message to post.
}
@@ -51,6 +50,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(StaticRouterTest.class, "Quickstart_static_router.esb");
+ return getDeploySetup(StaticRouterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_static_router.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,58 +21,45 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
import org.jboss.soa.esb.samples.quickstart.transformcsv2xml.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
/**
- * Sample client for the jboss container.
+ * CI test for the transformCSV2XML quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformCSV2XMLTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
private static final String FILE_NAME = "transformedmessageCSV2XML.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public TransformCSV2XMLTest(String name)
{
super(name);
}
-
+
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0] + " , expected, " + expectedString, match) ;
}
public void sendMessage() throws Exception
@@ -85,6 +72,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformCSV2XMLTest.class, "transformation-CSV2XML-quickstart.esb");
+ return getDeploySetup(TransformCSV2XMLTest.class, "QuickstartMessageStoreServer.sar, transformation-CSV2XML-quickstart.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,27 +21,23 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.transformxml2xmldatemanipulation.test.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the transformdatemanipulation quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformDateManipulationTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageDateManipulation.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
public TransformDateManipulationTest(String name)
{
@@ -50,30 +46,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -86,6 +74,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformDateManipulationTest.class, "transformation-date-manipulation-quickstart.esb");
+ return getDeploySetup(TransformDateManipulationTest.class, "QuickstartMessageStoreServer.sar, transformation-date-manipulation-quickstart.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,29 +21,24 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.transformedi2xmlgroovyxslt.test.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the transformEDI2XMLGroovyXSLT quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformEDI2XMLGroovyXSLTTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageEDI2XMLGroovyXSL.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public TransformEDI2XMLGroovyXSLTTest(String name)
{
super(name);
@@ -51,42 +46,36 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ // For some reason the smooks action is taking a long time
+ // on Windows, 45 seconds in one instance
+ final String[] messages = waitForMessages(1, 60000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
{
SendJMSMessage sm = new SendJMSMessage();
- sm.setupConnection();
- sm.sendAMessage(Helpers.getQuickstartLocation("transform_EDI2XML_Groovy_XSLT/SampleOrder.edi"));
- sm.stop();
+ sm.setupConnection();
+ sm.sendAMessage(Helpers.getQuickstartLocation("transform_EDI2XML_Groovy_XSLT/SampleOrder.edi"));
+ sm.stop();
}
public static Test suite() throws Exception
{
- return getDeploySetup(TransformEDI2XMLGroovyXSLTTest.class, "transformation-edi2xml_groovy-quickstart.esb");
+ return getDeploySetup(TransformEDI2XMLGroovyXSLTTest.class, "QuickstartMessageStoreServer.sar, transformation-edi2xml_groovy-quickstart.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -1,27 +1,42 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.transformxml2pojo.test.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the transformXML2POJO quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformXML2PojoTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageXML2POJO.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public TransformXML2PojoTest(String name)
{
@@ -30,30 +45,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
+ // Make sure the file matches expected output
+ final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
+ final String expectedString ;
+ try
{
- assertTrue("Deleting logfile", logFile.delete()) ;
+ expectedString = FileUtil.readStream(is);
}
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- // Make sure the file matches expected output
- final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareNonXMLContent(expectedString, targetString, true);
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareNonXMLContent(expectedString, messages[0], true);
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -68,6 +75,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformXML2PojoTest.class, "transformation-pojo-quickstart.esb");
+ return getDeploySetup(TransformXML2PojoTest.class, "QuickstartMessageStoreServer.sar, transformation-pojo-quickstart.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,26 +21,22 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
import org.jboss.soa.esb.samples.quickstart.transformxml2xmlsimple.test.SendJMSMessage;
+import org.jboss.soa.esb.testutils.FileUtil;
/**
- * Sample client for the jboss container.
+ * CI test for the transformXMLSimple quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformXMLSimpleTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageXML2Simple.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
public TransformXMLSimpleTest(String name)
{
@@ -49,30 +45,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -85,6 +73,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformXMLSimpleTest.class, "transformation-simple-quickstart.esb");
+ return getDeploySetup(TransformXMLSimpleTest.class, "QuickstartMessageStoreServer.sar, transformation-simple-quickstart.esb");
}
}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,60 @@
+/*
+ * 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.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendEsbMessage;
+
+import org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendJMSMessage;
+
+/**
+ * CI test for the webservice_consumer1 quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class WebServiceConsumer1Test extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "Jimbo";
+
+ public WebServiceConsumer1Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage();
+ String[] sinkMessages = waitForMessages(1, 30000);
+ assertTrue("Expected to find string " + JMS_MESSAGE + " found " + sinkMessages[0],
+ sinkMessages[0].contains(JMS_MESSAGE));
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(WebServiceConsumer1Test.class, "QuickstartMessageStoreServer.sar, Quickstart_webservice_consumer1.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,59 @@
+/*
+ * 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.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.webservice_consumer2.test.SendJMSMessage;
+
+/**
+ * CI test for the webservice_consumer2 quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class WebServiceConsumer2Test extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "Jimbo";
+ private static final String RESULT_STRING = "{processOrderResponse.return.comment=order processed, processOrderResponse.return.id=1, processOrderResponse.return.returnCode=1}";
+
+ public WebServiceConsumer2Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage();
+ String[] sinkMessages = waitForMessages(1, 30000);
+ assertTrue("Expected to find string " + RESULT_STRING + " found " + sinkMessages[0],
+ sinkMessages[0].equals(RESULT_STRING));
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(WebServiceConsumer2Test.class, "QuickstartMessageStoreServer.sar, Quickstart_webservice_consumer2.esb");
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,45 @@
+package org.jboss.soa.esb.quickstart.test;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.webserviceproducer.test.SendMessage;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jgroups.protocols.JMS;
+
+/**
+ * CI test for the webservice_producer quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class WebServiceProducerTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "jms";
+ private static final String RESULT_STRING = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"
+ + "<env:Header></env:Header><env:Body><ns2:sayGoodbyeResponse xmlns:ns2=\"http://webservice_producer/goodbyeworld\">"
+ + "<return>... Ah Goodbye then!!!! - Goodbye!!</return></ns2:sayGoodbyeResponse></env:Body></env:Envelope>";
+
+ public WebServiceProducerTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ String[] sinkMessages = waitForMessages(1, 30000);
+ assertTrue("Expected to find string " + RESULT_STRING + " found " + sinkMessages[0],
+ sinkMessages[0].equals(RESULT_STRING));
+ }
+
+ public void sendMessage() throws Exception {
+ SendMessage sm = new SendMessage();
+ String location = Helpers.getQuickstartLocation("webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/soap_message_01.xml");
+ File file = new File(location);
+ String targetString = FileUtil.readTextFile(file);
+ sm.sendMessageOverJMS(targetString);
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(WebServiceProducerTest.class, "QuickstartMessageStoreServer.sar, Quickstart_webservice_producer.esb");
+ }
+}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -23,16 +23,14 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
-
/**
- * Sample client for the jboss container.
+ * CI test for the webserviceadapter quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class WebserviceAdapterTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
public WebserviceAdapterTest(String name)
{
@@ -41,6 +39,7 @@
public void testMessage() throws Exception
{
+ fail("Not yet implemented") ;
sendMessage();
Thread.sleep(10000); // wait for message to post.
}
@@ -51,6 +50,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(WebserviceAdapterTest.class, "transformation-simple-quickstart.esb");
+ return getDeploySetup(WebserviceAdapterTest.class, "QuickstartMessageStoreServer.sar, transformation-simple-quickstart.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -23,16 +23,14 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
-
/**
- * Sample client for the jboss container.
+ * CI test for the webserviceBPEL quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class WebserviceBPELTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
public WebserviceBPELTest(String name)
{
@@ -41,6 +39,7 @@
public void testMessage() throws Exception
{
+ fail("Not yet implemented") ;
sendMessage();
Thread.sleep(10000); // wait for message to post.
}
@@ -51,6 +50,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(WebserviceBPELTest.class, "transformation-simple-quickstart.esb");
+ return getDeploySetup(WebserviceBPELTest.class, "QuickstartMessageStoreServer.sar, transformation-simple-quickstart.esb");
}
}
Modified: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java 2008-03-04 15:57:43 UTC (rev 18678)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -21,75 +21,39 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.wiretap.test.SendStaticRouterJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * Test for wiretap quickstart.
*
- * @author <a href="mailto:"></a>
+ * @author <a href="mailto:tcunning at redhat.com"></a>
* @version $Id: $
*/
-public class WiretapTest extends JBossTestCase {
+public class WiretapTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "Wiretap Message";
- private static final String FILE_NAME = "Wiretap.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 2;
public WiretapTest(String name) {
super(name);
} /* method */
public void testStaticRouterMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendStaticRouterJMSMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail ("Event file " + LOG_FILE + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE, EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail ("Event file " + LOG_FILE + " not complete - expected " + EXPECTED_RECORD_COUNT
- + " records - found " + temp.size() + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage1 = (String) theTable.get("Message1");
- String theMessage2 = (String) theTable.get("Message2");
-
- assertEquals("The strings1 should match", theMessage1, JMS_MESSAGE);
- assertEquals("The strings2 should match", theMessage2, JMS_MESSAGE);
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendStaticRouterJMSMessage() ;
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE) ;
} /* method */
public void sendStaticRouterJMSMessage() throws Exception {
SendStaticRouterJMSMessage sm = new SendStaticRouterJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
} /* method */
public static Test suite() throws Exception {
- return getDeploySetup(WiretapTest.class, "Quickstart_wiretap.esb");
+ return getDeploySetup(WiretapTest.class, "QuickstartMessageStoreServer.sar, Quickstart_wiretap.esb");
} /* method */
} /* class */
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +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.server;
+
+/**
+ * Interface to monitor message flow in quickstart tests.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public interface QuickstartMessageStore
+{
+ public String[] waitForMessages(final int numberOfMessages, final long maxDelay) ;
+
+ public void clearMessages() ;
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +1,62 @@
+/*
+* 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;
+
+import org.jboss.soa.esb.actions.TestMessageStore;
+import org.jboss.soa.esb.actions.TestMessageStoreSink;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ * MBean to monitor message flow in quickstart tests.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class QuickstartMessageStoreImpl extends ServiceMBeanSupport implements QuickstartMessageStoreImplMBean
+{
+ private TestMessageStoreSink sink = new TestMessageStoreSink() ;
+
+ @Override
+ protected void startService() throws Exception
+ {
+ System.out.println("Starting service " + QuickstartMessageStoreImplMBean.objectName) ;
+ super.startService();
+ TestMessageStore.setMessageStoreSink(sink) ;
+ }
+
+ @Override
+ protected void stopService() throws Exception
+ {
+ System.out.println("Stopping service " + QuickstartMessageStoreImplMBean.objectName) ;
+ TestMessageStore.setMessageStoreSink(null) ;
+ super.stopService();
+ }
+
+ public String[] waitForMessages(final int numberOfMessages, final long maxDelay)
+ {
+ return sink.waitForMessages(numberOfMessages, maxDelay) ;
+ }
+
+ public void clearMessages()
+ {
+ sink.clearMessages() ;
+ }
+}
Copied: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java (from rev 18638, labs/jbossesb/tags/JBESB_4_2_1_GA_CP1/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java)
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java (rev 0)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java 2008-03-04 16:24:20 UTC (rev 18679)
@@ -0,0 +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.server;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * MBean to monitor message flow in quickstart tests.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public interface QuickstartMessageStoreImplMBean extends ServiceMBean, QuickstartMessageStore
+{
+ public static final String objectName = "jboss.esb:test=QuickstartMessageStoreServer";
+}
More information about the jboss-svn-commits
mailing list