[jboss-svn-commits] JBL Code SVN: r17282 - in labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2: product/etc/schemas/xml and 64 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Dec 17 01:24:49 EST 2007
Author: kevin.conner at jboss.com
Date: 2007-12-17 01:24:48 -0500 (Mon, 17 Dec 2007)
New Revision: 17282
Added:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/juddi-2.0rc5.jar
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/juddi-client-2.0rc5.jar
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/TextElement.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_attachment.ser
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_body.ser
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.ser
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_properties.ser
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_attachment.ser
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_body.ser
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.ser
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_properties.ser
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/lib/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/readme.txt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/rss.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbm-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbmq-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.jpg
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/jbpm.cfg.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testMappingDefinition.jpg
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/Service4Action.java
Removed:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/juddi-20071022.191630-27.jar
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/juddi-client-20071022.191630-6.jar
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/lib/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/readme.txt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/JbpmTestUtil.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java
Modified:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build-distr.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/etc/schemas/xml/jbossesb-1.0.1.xsd
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/MapBodyImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/MapBodyImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/ObjectBodyImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/TextBodyImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ParsingSupport.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/StreamHelper.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/LogicalEPR.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/Util.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/LogicalEPRUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounterUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/MessageAttachmentSerializeTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/MessagePropertiesSerializeTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/processDefinition/processdefinition.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/processDefinition/processdefinition.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/readme.txt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/scripts/iTunesTop10.groovy
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/deployment.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jbm-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jbmq-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/deployment.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jbm-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jbmq-queue-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/hibernate.cfg.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm.cfg.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/testSingleCommands.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testMappingDefinition.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/LogicalEPRUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/deployment.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/jms-service.xml
Log:
Updated SOA branch to CP IR5
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build-distr.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build-distr.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build-distr.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -39,11 +39,8 @@
</fileset>
</copy>
<copy file="tools/console/contract-web/build/contract.war" todir="${esbserver.dist.dir}/tools" failonerror="false" />
- <copy todir="${esbserver.dist.dir}/docs/schema" failonerror="false">
- <fileset dir="${build.dir}/jbossesb/xml">
- <include name="**/*"/>
- </fileset>
- </copy>
+ <copy file="${build.dir}/jbossesb/xml/jbossesb-1.0.1.xsd"
+ todir="${esbserver.dist.dir}/docs/schema"/>
<copy todir="${esbserver.dist.dir}">
<fileset dir="${build.dir}/jbossesb">
<include name="*.txt"/>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -91,7 +91,10 @@
<attribute name="serverConfig"/>
<attribute name="seconds" default="120"/>
<sequential>
- <echo message="Waiting for ESB server to stop..."/>
+ <tstamp>
+ <format property="shutdown.time" pattern="yyyy-MM-dd HH:mm:ss z"/>
+ </tstamp>
+ <echo message="${shutdown.time}: waiting for ESB server to stop, checking file @{serverHome}/server/@{serverConfig}/log/server.log ..."/>
<waitfor maxwait="@{seconds}" maxwaitunit="second" checkevery="5" checkeveryunit="second" timeoutproperty="shutdown.timeout">
<available file="server.log">
<filepath>
@@ -178,11 +181,7 @@
file="${esb.config.location}/ftpd.properties" overwrite="true"/>
</target>
- <!-- initialise the classpath for the server -->
- <target name="esb.init-classpath">
- </target>
-
- <target name="esb.init" depends="esb.init-app-server, esb.init-esb-server, esb.init-ftp-server, esb.init-classpath"
+ <target name="esb.init" depends="esb.init-app-server, esb.init-esb-server, esb.init-ftp-server"
description="target for initialising properties">
<path id="server.classpath">
<pathelement location="${java.home}/lib/tools.jar"/>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/etc/schemas/xml/jbossesb-1.0.1.xsd
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2007-12-17 06:24:48 UTC (rev 17282)
@@ -1138,24 +1138,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')
@@ -1184,8 +1184,8 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute name="insert-timestamp-column" use="optional"
- type="xsd:string" default="insert_timestamp">
+ <xsd:attribute name="insert-timestamp-column" use="required"
+ type="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Holds the timestamp when the record was
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/juddi-2.0rc5.jar (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/lib/ext/juddi-2.0rc5.jar)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/juddi-20071022.191630-27.jar
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/juddi-client-2.0rc5.jar (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/lib/ext/juddi-client-2.0rc5.jar)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/lib/ext/juddi-client-20071022.191630-6.jar
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -1,211 +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 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.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();
-
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node n = nl.item(i);
-
- if ((n.getPrefix() != null) && (n.getLocalName() != null))
- {
- if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.TO_TAG)))
- {
- call.setTo(EPRHelper.fromXML((Element) header, true));
- }
-
- if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.FROM_TAG)))
- {
- call.setFrom(EPRHelper.fromXML((Element) n, false));
- }
-
- if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.REPLY_TO_TAG)))
- {
- call.setReplyTo(EPRHelper.fromXML((Element) n, false));
- }
-
- if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.RELATES_TO_TAG)))
- {
- 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);
- }
- }
-
- if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.FAULT_TO_TAG)))
- {
- call.setFaultTo(EPRHelper.fromXML((Element) n, false));
- }
-
- if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.ACTION_TAG)))
- {
- 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);
- }
- }
-
- if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.MESSAGE_IDENTIFIER_TAG)))
- {
- 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);
- }
- }
- }
- }
-
- return call;
- }
-
-}
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -21,125 +21,49 @@
* @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;
+import org.jboss.soa.esb.addressing.PortReference;
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.
@@ -151,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);
}
/**
@@ -164,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);
- }
}
/**
@@ -234,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)
@@ -315,7 +185,7 @@
}
}
- private final static EPR getSpecificEPR(EPR epr)
+ public final static EPR getSpecificEPR(EPR epr)
{
String eprType = epr.getAddr().getExtensionValue(EPR_TYPE);
@@ -342,7 +212,7 @@
else if (eprType.equals(FileEpr.type().toString()))
return new FileEpr(epr);
else if (eprType.equals(LogicalEPR.type().toString()))
- return new LogicalEPR(epr.getAddr());
+ return new LogicalEPR(epr);
else
return epr;
} else {
@@ -350,64 +220,28 @@
}
}
- /**
- * 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.getAddr());
- else
- return epr;
- } else {
- return epr;
- }
- }
-
+ /**
+ * Create a copy of the EPR, including the specified extensions.
+ * @param epr The current EPR.
+ * @param extensions The extensions to add.
+ * @return The EPR copy.
+ */
+ public static EPR copyEPR(final EPR epr, final List<Extension> extensions)
+ {
+ final EPR copyEPR = new EPR(epr.getAddr().copy()) ;
+ final PortReference addr = copyEPR.getAddr() ;
+ if (extensions != null)
+ {
+ for(Extension extension: extensions)
+ {
+ if (!(EPR_TYPE.equals(extension.getTag()) &&
+ XMLUtil.JBOSSESB_NAMESPACE_URI.equals(extension.getURI()) &&
+ XMLUtil.JBOSSESB_PREFIX.equals(extension.getPrefix())))
+ {
+ addr.addExtension(extension) ;
+ }
+ }
+ }
+ return copyEPR ;
+ }
}
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -158,7 +158,7 @@
_logger.debug(roll);
}
}
-
+
_logger.debug("SQL exception during deliver", e);
throw new CourierException(e);
}
@@ -192,6 +192,7 @@
return result;
}
}
+
catch (SQLException e) {
_logger.debug("SQL Exception during pickup", e);
return null;
@@ -276,7 +277,6 @@
deleteStatement().setString(iParm++, messageId);
_conn.execUpdWait(deleteStatement(), 3);
_conn.commit();
-
}
private void changeStatus(String messageId, State to) throws SQLException {
@@ -285,7 +285,6 @@
updateStatusStatement().setString(iParm++, messageId);
_conn.execUpdWait(updateStatusStatement(), 3);
_conn.commit();
-
}
private ResultSet getRowList() throws CourierException {
@@ -356,36 +355,47 @@
return _conn;
} // ________________________________
- protected PreparedStatement listStatement() {
+ protected PreparedStatement listStatement() throws SQLException
+ {
if (null == _prepGetList)
try {
String[] columns =
{_epr.getMessageIdColumn(), _epr.getTimestampColumn()};
- StringBuilder sb = new StringBuilder("select");
- int i1 = 0;
- for (String col : columns)
- sb.append((i1++ < 1) ? " " : ",").append(col);
- sb.append(" from ").append(_epr.getTableName());
- sb.append(" where ").append(_epr.getStatusColumn())
- .append("='").append(State.Pending.getColumnValue())
- .append("'").append(" order by 2");
- _prepGetList = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e) {
- _logger.debug("Unable to prepare SQL statement", e);
- return null;
- }
- return _prepGetList;
- } // ________________________________
+ StringBuilder sb = new StringBuilder("select");
+ int i1 = 0;
+ for (String col : columns)
+ sb.append((i1++ < 1) ? " " : ",").append(col);
+ sb.append(" from ").append(_epr.getTableName());
+ sb.append(" where ").append(_epr.getStatusColumn())
+ .append("='").append(State.Pending.getColumnValue())
+ .append("'").append(" order by 2");
+ _prepGetList = getConn().prepareStatement(sb.toString());
+ }
+ catch (SQLException ex)
+ {
+ throw ex;
+ }
+ catch (Exception e)
+ {
+ _logger.warn("Unable to prepare SQL statement", e);
+
+ throw new SQLException("Unable to prepare SQL statement: "+e);
+ }
+
+ return _prepGetList;
+ } // ________________________________
- protected PreparedStatement select4UpdateStatement() {
- if (_prepSel4Upd == null) {
- try {
- /*
- * TODO make this dynamic using a factory pattern.
- */
+ protected PreparedStatement select4UpdateStatement() throws SQLException
+ {
+ if (_prepSel4Upd == null)
+ {
+ try
+ {
+ /*
+ * TODO make this dynamic using a factory pattern.
+ */
StringBuilder sb = null;
@@ -401,8 +411,7 @@
* HSQL does not support FOR UPDATE! All tables appear to
* be inherently updatable!
*/
-
- sb = new StringBuilder("select ").append(
+ sb = new StringBuilder("select ").append(
_epr.getDataColumn()).append(" from ").append(
_epr.getTableName()).append(" where ").append(
_epr.getMessageIdColumn()).append("=?").append(
@@ -410,70 +419,97 @@
.append("=?");
}
- _prepSel4Upd = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e) {
- _logger.debug(e);
- return null;
- }
- }
+ _prepSel4Upd = getConn().prepareStatement(sb.toString());
+ }
+ catch (SQLException ex)
+ {
+ throw ex;
+ }
+ catch (Exception e)
+ {
+ _logger.warn(e);
+
+ throw new SQLException("Caught exception during prepared statement: "+e);
+ }
+ }
+
+ return _prepSel4Upd;
+ }
+
+ protected PreparedStatement updateStatusStatement() throws SQLException
+ {
+ if (null == _prepUpdateStatus)
+ try
+ {
+ StringBuilder sb = new StringBuilder("update ").append(
+ _epr.getTableName()).append(" set ").append(
+ _epr.getStatusColumn()).append("= ?").append(" where ")
+ .append(_epr.getMessageIdColumn()).append("=?");
+ _prepUpdateStatus = getConn().prepareStatement(sb.toString());
+ }
+ catch (SQLException ex)
+ {
+ throw ex;
+ }
+ catch (Exception e)
+ {
+ _logger.warn(e);
+
+ throw new SQLException("Caught exception during prepared statement: "+e);
+ }
+ return _prepUpdateStatus;
+ } // ________________________________
- return _prepSel4Upd;
- } // ________________________________
+ protected PreparedStatement insertStatement() throws SQLException {
+ if (null == _prepInsert)
+ try {
+ String[] columns =
+ {_epr.getMessageIdColumn(), _epr.getDataColumn(),
+ _epr.getStatusColumn(), _epr.getTimestampColumn()};
+ StringBuilder sb = new StringBuilder("insert into ").append(
+ _epr.getTableName()).append("(");
+ int i1 = 0;
+ for (String col : columns)
+ sb.append((i1++ < 1) ? " " : ",").append(col);
+ sb.append(") values (?,?,?,?)");
+ _prepInsert = getConn().prepareStatement(sb.toString());
+ }
+ catch (SQLException ex)
+ {
+ throw ex;
+ }
+ catch (Exception e)
+ {
+ _logger.warn(e);
+
+ throw new SQLException("Caught exception during prepared statement: "+e);
+ }
+ return _prepInsert;
+ } // ________________________________
- protected PreparedStatement updateStatusStatement() {
- if (null == _prepUpdateStatus)
- try {
- StringBuilder sb = new StringBuilder("update ").append(
- _epr.getTableName()).append(" set ").append(
- _epr.getStatusColumn()).append("= ?").append(" where ")
- .append(_epr.getMessageIdColumn()).append("=?");
- _prepUpdateStatus = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e) {
- _logger.debug(e);
- return null;
- }
- return _prepUpdateStatus;
- } // ________________________________
+ protected PreparedStatement deleteStatement() throws SQLException
+ {
+ if (null == _prepDelete)
+ try
+ {
+ StringBuilder sb = new StringBuilder("delete from ").append(
+ _epr.getTableName()).append(" where ").append(
+ _epr.getMessageIdColumn()).append(" =?");
+ _prepDelete = getConn().prepareStatement(sb.toString());
+ }
+ catch (SQLException ex)
+ {
+ throw ex;
+ }
+ catch (Exception e)
+ {
+ _logger.warn(e);
+
+ throw new SQLException("Caught exception during prepared statement: "+e);
+ }
+ return _prepDelete;
+ } // ________________________________
- protected PreparedStatement insertStatement() {
- if (null == _prepInsert)
- try {
- String[] columns =
- {_epr.getMessageIdColumn(), _epr.getDataColumn(),
- _epr.getStatusColumn(), _epr.getTimestampColumn()};
-
- StringBuilder sb = new StringBuilder("insert into ").append(
- _epr.getTableName()).append("(");
- int i1 = 0;
- for (String col : columns)
- sb.append((i1++ < 1) ? " " : ",").append(col);
- sb.append(") values (?,?,?,?)");
- _prepInsert = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e) {
- _logger.debug(e);
- return null;
- }
- return _prepInsert;
- } // ________________________________
-
- protected PreparedStatement deleteStatement() {
- if (null == _prepDelete)
- try {
- StringBuilder sb = new StringBuilder("delete from ").append(
- _epr.getTableName()).append(" where ").append(
- _epr.getMessageIdColumn()).append(" =?");
- _prepDelete = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e) {
- _logger.debug(e);
- return null;
- }
- return _prepDelete;
- } // ________________________________
-
protected enum State {
Pending, WorkInProgress, Done, Error;
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/DeferredDeserialisationException.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedValueImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/MapBodyImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/MapBodyImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/MapBodyImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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,64 +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)
{
assertValidAttachment(value);
- 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 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
{
assertValidAttachment(value);
- return _list.set(index, (Serializable) value);
+ return unwrap(_list.set(index, new SerializedValueImpl((Serializable) value)));
}
public void addItem(Object value)
{
assertValidAttachment(value);
- _list.add((Serializable) value);
+ _list.add(new SerializedValueImpl((Serializable) value));
}
public void addItemAt(int index, Object value)
throws IndexOutOfBoundsException
{
assertValidAttachment(value);
- _list.add(index, (Serializable) value);
+ _list.add(index, new SerializedValueImpl((Serializable) value));
}
public int getNamedCount()
@@ -122,172 +133,59 @@
}
/**
- * 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);
-
- if (anonymous != null)
- {
- 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);
-
- if (named != null)
- {
- 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.");
@@ -296,6 +194,11 @@
}
}
- 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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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.thirdparty.Base64;
-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(Base64
- .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(Base64
- .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(Base64.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(Base64.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(Base64.decode(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(Base64.decode(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(Base64.decode(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(Base64.decode(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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/SerializedValueImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/MapBodyImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/MapBodyImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/MapBodyImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/ObjectBodyImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/ObjectBodyImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/ObjectBodyImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/TextBodyImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/TextBodyImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/TextBodyImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalValueImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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;
-
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/NamedElement.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ParsingSupport.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ParsingSupport.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/ParsingSupport.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -66,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:
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/StreamHelper.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/StreamHelper.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/StreamHelper.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -337,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.
@@ -363,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()) ;
+ }
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/TextElement.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/TextElement.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/TextElement.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/TextElement.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -0,0 +1,106 @@
+/*
+ * 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;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * Utility class representing a text element.
+ * @author kevin
+ */
+public class TextElement extends ElementContent
+{
+ /**
+ * The value of the text element.
+ */
+ private String text ;
+
+ /**
+ * Construct the text element.
+ * @param text The text element.
+ */
+ public TextElement(final String text)
+ {
+ this.text = text ;
+ }
+
+ /**
+ * Construct the text element.
+ * @param in The current input stream.
+ * @throws XMLStreamException For errors during reading.
+ */
+ public TextElement(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
+ /**
+ * Get the text value of this element.
+ * @return The text value of this element.
+ */
+ public String getText()
+ {
+ return text ;
+ }
+
+ /**
+ * 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
+ {
+ text = value ;
+ }
+
+ /**
+ * 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
+ {
+ throw new XMLStreamException("Text elements cannot have embedded elements.") ;
+ }
+
+ /**
+ * 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
+ {
+ if (text != null)
+ {
+ out.writeCharacters(text) ;
+ }
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/stax/URIElement.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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() ;
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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,
@@ -107,6 +116,11 @@
_extensions.add(new Extension(tag, prefix, uri, value, parent));
}
+ public void addExtensions(final List<Extension> extensions)
+ {
+ _extensions.addAll(extensions);
+ }
+
// placeholders only
public void addPortType(String qName)
@@ -142,6 +156,11 @@
return _extensions.iterator();
}
+ public List<Extension> getAllExtensions()
+ {
+ return _extensions;
+ }
+
public void clearExtensions()
{
_extensions.clear();
@@ -162,8 +181,9 @@
* But should be ok here because the invariants are known and field-wise
* copying should therefore be safe.
*/
-
- return (PortReference) clone();
+ final PortReference clone = (PortReference)clone() ;
+ clone._extensions = new LinkedList<Extension>(_extensions) ;
+ return clone;
}
catch (Exception ex)
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -206,6 +206,11 @@
{
return "EmailEpr [ "+super.getAddr().extendedToString()+" ]";
}
+
+ public EPR copy ()
+ {
+ return new EmailEpr(this);
+ }
public static final URI type ()
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -92,6 +92,11 @@
{
return "HTTPEpr [ "+super.getAddr().extendedToString()+" ]";
}
+
+ public EPR copy ()
+ {
+ return new HTTPEpr(this);
+ }
public static final URI type ()
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -419,6 +419,11 @@
}
}
+ public EPR copy ()
+ {
+ return new JMSEpr(this);
+ }
+
public String toString ()
{
return "JMSEpr [ "+super.getAddr().extendedToString()+" ]";
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/LogicalEPR.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/LogicalEPR.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/LogicalEPR.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -25,6 +25,7 @@
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.PortReference;
import org.jboss.soa.esb.client.ServiceInvoker;
+import org.w3c.dom.Element;
import java.net.URI;
import java.net.URISyntaxException;
@@ -47,14 +48,22 @@
}
public LogicalEPR(PortReference addr) {
- this(URI.create(((PortReference)AssertArgument.isNotNull(addr, "addr")).getAddress()));
+ this(new EPR(addr)) ;
}
public LogicalEPR(URI uri) {
- super((URI)AssertArgument.isNotNull(uri, "uri"));
- assertValidLogicalURI(uri);
+ this(new EPR(uri)) ;
}
+ public LogicalEPR(final EPR epr) {
+ super(epr);
+ assertValidLogicalURI(URI.create(((PortReference)AssertArgument.isNotNull(epr.getAddr(), "addr")).getAddress()));
+ }
+
+ public LogicalEPR(final EPR epr, final Element header) {
+ this(epr);
+ }
+
public LogicalEPR(String serviceCategory, String serviceName) {
super(toLogicalURI(serviceCategory, serviceName));
}
@@ -86,7 +95,7 @@
public ServiceInvoker getServiceInvoker() throws MessageDeliverException {
if(serviceInvoker == null) {
- serviceInvoker = new ServiceInvoker(toService());
+ serviceInvoker = new ServiceInvoker(toService(), getAddr().getAllExtensions());
}
return serviceInvoker;
}
@@ -124,6 +133,11 @@
}
}
+ public EPR copy ()
+ {
+ return new LogicalEPR(this);
+ }
+
public static URI type() {
return _type;
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -30,6 +30,7 @@
import org.jboss.soa.esb.Service;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.MalformedEPRException;
+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.couriers.Courier;
@@ -72,11 +73,15 @@
/**
* The target service.
*/
- private Service service;
+ private final Service service;
/**
+ * The list of any extensions to be added to the target address.
+ */
+ private final List<PortReference.Extension> extensions ;
+ /**
* Load balancer.
*/
- private LoadBalancePolicy loadBalancer;
+ private final LoadBalancePolicy loadBalancer;
/**
* Cluster info.
*/
@@ -104,8 +109,20 @@
* @throws MessageDeliverException Failed to deliver message to endpoint.
*/
public ServiceInvoker(Service service) throws MessageDeliverException {
+ this(service, null) ;
+ }
+
+ /**
+ * Public constructor.
+ *
+ * @param service The Service to which this instance will deliver messages.
+ * @param extensions The extensions to be added to the target service.
+ * @throws MessageDeliverException Failed to deliver message to endpoint.
+ */
+ public ServiceInvoker(final Service service, final List<PortReference.Extension> extensions) throws MessageDeliverException {
AssertArgument.isNotNull(service, "service");
this.service = service;
+ this.extensions = extensions ;
String lbClass = Configuration.getLoadBalancerPolicy();
registryCacheLife = Long.valueOf(Configuration.getRegistryCacheLife());
try {
@@ -399,19 +416,28 @@
private Message attemptDelivery(Message message, EPR epr) throws FaultMessageException, MalformedEPRException {
TwoWayCourier courier = null;
+ final EPR targetEPR ;
+ if ((extensions != null) && (extensions.size() > 0))
+ {
+ targetEPR = EPRHelper.copyEPR(epr, extensions) ;
+ }
+ else
+ {
+ targetEPR = epr ;
+ }
// Get a courier for the EPR...
try {
- courier = getCourier(epr);
+ courier = getCourier(targetEPR);
} catch (CourierException e) {
- logger.debug("Courier lookup failed for EPR [" + epr + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", e);
+ logger.debug("Courier lookup failed for EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", e);
} catch (MalformedEPRException e) {
// probably an ESB-unaware EPR in the registry!!
- logger.info("Badly formed EPR [" + epr + "] for Service [" + service + "] and Message ["+message.getHeader()+"]." + e.getMessage());
+ logger.info("Badly formed EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"]." + e.getMessage());
throw e;
} catch (Throwable t) {
- logger.warn("Unexpected exception during Courier lookup for EPR [" + epr + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", t);
+ logger.warn("Unexpected exception during Courier lookup for EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", t);
}
// Try delivering the message using the courier we just looked up....
@@ -424,14 +450,14 @@
try {
EPR replyToEPR = message.getHeader().getCall().getReplyTo();
- message.getHeader().getCall().setTo(epr);
+ message.getHeader().getCall().setTo(targetEPR);
if (synchronous) {
if (replyToEPR == null)
- replyToEPR = getReplyToAddress(epr);
+ replyToEPR = getReplyToAddress(targetEPR);
if (replyToEPR == null) {
- logger.debug("Not using epr [" + epr + "] for Service [" + service + "] and Message ["+message.getHeader()+"]. No reply-to address available for synchronous response.");
+ logger.debug("Not using epr [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"]. No reply-to address available for synchronous response.");
return null;
}
message.getHeader().getCall().setReplyTo(replyToEPR);
@@ -451,14 +477,14 @@
} catch (FaultMessageException e) {
throw e;
} catch (CourierException e) {
- logger.debug("Badly formed EPR [" + epr + "] for Service [" + service + "] and Message ["+message.getHeader()+"]. " + e.getMessage());
+ 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)??
- logger.warn("Unexpected error. Badly formed EPR [" + epr + "] for Service [" + service + "]. But the EPR has already been validated!!");
+ logger.warn("Unexpected error. Badly formed EPR [" + targetEPR + "] for Service [" + service + "]. But the EPR has already been validated!!");
throw e;
} catch (Throwable t) {
- logger.warn("Unexpected exception during attempted message delivery over Courier for EPR [" + epr + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", t);
+ logger.warn("Unexpected exception during attempted message delivery over Courier for EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", t);
} finally {
// TODO: So does this mean that Couriers are stateful? If so, do we need to synchronize on using them??
CourierUtil.cleanCourier(courier);
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/Util.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/Util.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/Util.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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 ;
}
} // ________________________________
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -12,7 +12,7 @@
<listener name="null-listener" busidref="null" />
</listeners>
- <actions>
+ <actions mep="OneWay">
<action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
<property name="destinations">
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -12,7 +12,7 @@
<listener name="null-listener" busidref="null" />
</listeners>
- <actions>
+ <actions mep="OneWay">
<action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
<property name="destinations">
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/LogicalEPRUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/LogicalEPRUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/LogicalEPRUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -67,7 +67,17 @@
assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
assertEquals("My / Category", epr.toService().getCategory());
assertEquals("My / Name", epr.toService().getName());
+
+ epr = new LogicalEPR(new EPR(URI.create("logical:My%20/%20Category#My%20/%20Name")));
+ assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
+ assertEquals("My / Category", epr.toService().getCategory());
+ assertEquals("My / Name", epr.toService().getName());
+ epr = new LogicalEPR(new EPR(new PortReference("logical:My%20/%20Category#My%20/%20Name")));
+ assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
+ assertEquals("My / Category", epr.toService().getCategory());
+ assertEquals("My / Name", epr.toService().getName());
+
epr = new LogicalEPR();
epr.setAddr(new PortReference("logical:My%20/%20Category#My%20/%20Name"));
assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
@@ -97,6 +107,20 @@
}
try {
+ new LogicalEPR(new EPR(URI.create("xxxx:a#b")));
+ fail("Expected IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ assertEquals("'xxxx:a#b' is not a valid URI for a Logical EPR - URI scheme must be 'logical'.", e.getMessage());
+ }
+
+ try {
+ new LogicalEPR(new EPR(new PortReference("logical://a#b")));
+ fail("Expected IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ assertEquals("'logical://a#b' is not a valid URI for a Logical EPR - URI must be opaque.", e.getMessage());
+ }
+
+ try {
LogicalEPR epr = new LogicalEPR();
epr.setAddr(new PortReference("logical:a"));
fail("Expected IllegalArgumentException");
@@ -114,29 +138,23 @@
}
public void test_Serialize_Deserialize()
+ throws Exception
{
Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
- try
- {
- EPR epr = new LogicalEPR(new PortReference("logical:a#b"));
+ EPR epr = new LogicalEPR(new PortReference("logical:a#b"));
- msg.getHeader().getCall().setTo(epr);
+ msg.getHeader().getCall().setTo(epr);
- final String xmlRepresentation = XMLMessageUnitTest.msgToXML((MessageImpl)msg) ;
+ final String xmlRepresentation = XMLMessageUnitTest.msgToXML((MessageImpl)msg) ;
- final MessageImpl nImpl = XMLMessageUnitTest.msgFromXML(xmlRepresentation) ;
+ final MessageImpl nImpl = XMLMessageUnitTest.msgFromXML(xmlRepresentation) ;
- EPR theEpr = nImpl.getHeader().getCall().getTo();
+ EPR theEpr = nImpl.getHeader().getCall().getTo();
- assertTrue("Expected a Logical EPR", theEpr instanceof LogicalEPR);
+ assertTrue("Expected a Logical EPR", theEpr instanceof LogicalEPR);
- assertEquals("logical:a#b", theEpr.getAddr().getAddress());
- }
- catch (Exception ex)
- {
- fail(ex.toString());
- }
+ assertEquals("logical:a#b", theEpr.getAddr().getAddress());
}
private MockCourier courier1;
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -23,9 +23,11 @@
package org.jboss.soa.esb.addressing.tests;
import java.net.URI;
+import java.net.URISyntaxException;
import junit.framework.TestCase;
+import org.jboss.internal.soa.esb.message.format.xml.CallImpl;
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.addressing.EPR;
@@ -192,4 +194,35 @@
}
}
+ public void testSerialisation()
+ throws Exception
+ {
+ final Call call = new Call() ;
+ call.setAction(new URI("urn:action")) ;
+ call.setFaultTo(getEPR("urn:faultTo", "faultToTag", "faultToValue")) ;
+ call.setFrom(getEPR("urn:from", "fromTag", "fromValue")) ;
+ call.setMessageID(new URI("urn:messageID")) ;
+ call.setRelatesTo(new URI("urn:relatesTo")) ;
+ call.setReplyTo(getEPR("urn:replyTo", "replyToTag", "replyToValue")) ;
+ call.setTo(getEPR("urn:to", "toTag", "toValue")) ;
+
+ final String content = CallImpl.toXML(call) ;
+ final Call result = CallImpl.fromXML(content) ;
+
+ assertEquals("Action URI", call.getAction(), result.getAction()) ;
+ assertEquals("FaultTo EPR", call.getFaultTo(), result.getFaultTo()) ;
+ assertEquals("From EPR", call.getFrom(), result.getFrom()) ;
+ assertEquals("MessageID URI", call.getMessageID(), result.getMessageID()) ;
+ assertEquals("RelatesTo URI", call.getRelatesTo(), result.getRelatesTo()) ;
+ assertEquals("ReplyTo URI", call.getReplyTo(), result.getReplyTo()) ;
+ assertEquals("To URI", call.getTo(), result.getTo()) ;
+ }
+
+ private EPR getEPR(final String uri, final String tag, final String value)
+ throws URISyntaxException
+ {
+ final EPR epr = new EPR(new URI(uri)) ;
+ epr.getAddr().addExtension(tag, value) ;
+ return epr ;
+ }
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounterUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounterUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounterUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/MessageAttachmentSerializeTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/MessageAttachmentSerializeTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/MessageAttachmentSerializeTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/MessagePropertiesSerializeTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/MessagePropertiesSerializeTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/MessagePropertiesSerializeTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/DeserializedValuesMessageUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedValueUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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;
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_attachment.ser (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_attachment.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_body.ser (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_body.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.ser (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_message.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_properties.ser (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/new_properties.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_attachment.ser (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_attachment.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_body.ser (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_body.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.ser (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.ser)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_message.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_properties.ser (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/old_properties.ser)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -116,10 +116,10 @@
<property name="command" value="NewProcessInstanceCommand" />
<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" />
+ <mapping esb="eVar1" bpm="counter" value="45" />
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
</property>
</action>
@@ -134,10 +134,10 @@
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">
+ <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" />
+ <mapping esb="eVar1" bpm="counter" value="45" />
+ <mapping esb="BODY_CONTENT" bpm="theBody" />
</property>
</action>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -14,12 +14,12 @@
<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>
</node>
@@ -28,12 +28,12 @@
<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>
</node>
@@ -42,12 +42,12 @@
<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>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody"/>
+ </esbToBpmVars>
</action>
<transition name="" to="Send Results"></transition>
</node>
@@ -60,12 +60,12 @@
<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>
+ <bpmToEsbVars>
+ <mapping bpm="theBody" esb="BODY_CONTENT" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping esb="BODY_CONTENT" bpm="theBody"/>
+ </esbToBpmVars>
</action>
<transition name="" to="end1"></transition>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -104,9 +104,9 @@
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>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/processDefinition/processdefinition.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/processDefinition/processdefinition.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/processDefinition/processdefinition.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -94,9 +94,9 @@
<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>
</actions>
@@ -123,9 +123,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>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/processDefinition/processdefinition.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/processDefinition/processdefinition.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/processDefinition/processdefinition.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/readme.txt
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/readme.txt 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/readme.txt 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -157,7 +157,7 @@
</path>
</target>
- <target name="jbossesb-source-dependencies" if="build.jbossesb">
+ <target name="jbossesb-quickstart-override">
<condition
property="org.jboss.esb.server.config"
value="${quickstart.org.jboss.esb.server.config}">
@@ -169,7 +169,10 @@
value="${quickstart.org.jboss.esb.server.home}">
<isset property="quickstart.org.jboss.esb.server.home"/>
</condition>
+ </target>
+ <target name="jbossesb-source-dependencies"
+ depends="jbossesb-quickstart-override" if="build.jbossesb">
<!-- check for installation deployment.properties -->
<property name="install.dir" value="${product.dir}/install"/>
<property file="${install.dir}/deployment.properties" prefix="install" />
@@ -193,7 +196,9 @@
</target>
<!-- Configure dependencies for jbossesb-server distribution -->
- <target name="jbossesb-server-dependencies" if="hierarchy.jbossesb-server">
+ <target name="jbossesb-server-dependencies"
+ depends="jbossesb-quickstart-override"
+ if="hierarchy.jbossesb-server">
<property name="org.jboss.esb.server.home" value="${product.dir}"/>
<condition property="jbossesb-server-production">
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/build.xml 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/build.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/build.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/build.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/build.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/build.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/deployment.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbm-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbmq-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb-unfiltered.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/jndi.properties 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/juddi.properties 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/lib (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/lib)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/log4j.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/readme.txt
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/readme.txt 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/readme.txt 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/readme.txt (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/readme.txt)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/readme.txt (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/readme.txt 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/MyJMSListenerAction.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/ReceiveJMSMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/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_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendEsbMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/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_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java 2007-12-17 05:31:45 UTC (rev 17277)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_topic_notifier/src/org/jboss/soa/esb/samples/quickstart/helloworldtopicnotifier/test/SendJMSMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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();
+
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -58,7 +58,7 @@
public void stop() throws JMSException
{
- tc.close();
+ tc.stop();
session.close();
tc.close();
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/build.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/build.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/rss.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/samples/quickstarts/scripting_groovy/rss.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/rss.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/rss.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/scripts/iTunesTop10.groovy
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/scripts/iTunesTop10.groovy 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/scripts/iTunesTop10.groovy 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/deployment.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/deployment.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/deployment.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jbm-queue-service.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jbm-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jbmq-queue-service.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jbmq-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -50,7 +50,6 @@
MessageType.JBOSS_XML);
requestMessage.getBody().add(message);
- requestMessage.getProperties().setProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "WebServicesConsumer1Test.log");
// Deliver the request message synchronously - timeout after 20
// seconds...
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -52,7 +52,7 @@
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
- que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer1_esb");
+ que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer1_Request_gw");
session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
System.out.println("Connection Started");
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/deployment.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/deployment.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/deployment.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jbm-queue-service.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jbm-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jbmq-queue-service.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jbmq-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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">
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -54,7 +54,7 @@
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
- que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer2_esb");
+ que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer2_Request_gw");
session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
System.out.println("Connection Started");
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -52,6 +52,7 @@
public class DBMessageStoreImpl implements RedeliverStore
{
public static final String DEFAULT_TABLE_NAME = "message";
+ public static final String UNCLASSIFIED_CLASSIFICATION = "UNCLASSIFIED";
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 UNCLASSIFIED 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 UNCLASSIFIED 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);
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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,17 +81,26 @@
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
{
+ CallbackCommand,
DeployProcessDefinition
// AbstractCancelCommand
// ,AbstractGetObjectBaseCommand
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -0,0 +1,243 @@
+/**
+ *
+ */
+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");
+ value =mapping.getDefaultValue();
+ }
+ log.debug("value=" + value);
+ return value;
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Mapping.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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;
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -19,65 +19,41 @@
* 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.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.cmd.MessageHelper;
-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
+ * Send messages to ESB services from jBPM applications, and leaves the node
+ * in a wait state, waiting for a call back.
+ *
+ * <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>
*
* @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;
@@ -86,192 +62,131 @@
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 = createReplyTo(esbToBpmVars.asXML(), 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());
+ }
+ portReference.addExtension(Constants.TOKEN_ID, String.valueOf(executionContext.getToken().getId()));
+ 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;
+ Long counter = Long.getLong(String.valueOf(executionContext.getVariable(counterName)));
+ if (counter!=null) {
+ counter = counter + 1;
+ } else {
+ counter = 0l;
+ }
+ //Adding to the jBPM variableMap
+ executionContext.setVariable(counterName, counter.toString());
+ //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()));
-
- MessageHelper.setLongValue(template, Constants.TOKEN_ID, _token.getId());
- Node node = _token.getNode();
- if (null != node)
- MessageHelper.setStringValue(template, Constants.CURRENT_NODE_NAME, node
- .getName());
-
- ProcessInstance instance = _token.getProcessInstance();
- MessageHelper.setLongValue(template, Constants.PROCESS_INSTANCE_ID, instance
- .getId());
-
- ProcessDefinition process = instance.getProcessDefinition();
- MessageHelper.setObjectValue(template, Constants.PROCESS_DEFINITION_NAME,
- process.getName());
- MessageHelper.setIntValue(template, Constants.PROCESS_DEFINITION_VERSION,
- process.getVersion());
- MessageHelper.setLongValue(template, Constants.PROCESS_DEFINITION_ID, process
- .getId());
-
- return template;
- } // ________________________________
-
+
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbNotifier.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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 jbpmToEsbVars;
+ /**
+ * 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(jbpmToEsbVars, 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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -26,17 +26,16 @@
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;
import org.jboss.soa.esb.services.jbpm.cmd.MessageFacade;
-import org.jbpm.JbpmException;
/**
*
-* 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)
*
@@ -45,53 +44,38 @@
*/
public class BpmProcessor implements ActionLifecycle
{
- protected MessageFacade _stuffer;
- protected ConfigTree _config;
+ protected MessageFacade messageFacade;
+ protected ConfigTree configTree;
private static Logger _logger = Logger.getLogger(BpmProcessor.class);
- public static final String COMMAND_ATTRIBUTE_TAG = "command";
-
- public void destroy() throws ActionLifecycleException {
+ 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 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 config) throws ConfigurationException
+ public BpmProcessor(ConfigTree configTree) throws ConfigurationException
{
- _config = config;
- checkMyParms();
+ this.configTree = configTree;
}
- public Constants.OpCode getOpCode() { return _stuffer.getOpCode(); }
-
- protected void checkMyParms() throws ConfigurationException
- {
- _stuffer = MessageFacade.getFacade(_config);
- }
- public void process(Message message)
- throws ActionProcessingException
+ public Message process(Message message) throws ConfigurationException
{
- message.getBody().add(Constants.COMMAND_CODE,getOpCode().toString());
- _stuffer.setJBPMContextParameters(message);
- try
- {
- CommandExecutor commandExecutor = CommandExecutor.getInstance();
- String commandString = (String)message.getBody().get(Constants.COMMAND_CODE);
- commandExecutor.getCommand(commandString).execute(message);
- }
- catch (JbpmException e)
- {
- throw new ActionProcessingException(e.getMessage(), e);
- }
- catch (Exception e)
- {
- _logger.error(e.getMessage(), e);
- throw new ActionProcessingException(e.getMessage(), e);
- }
+ 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;
}
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/JBpmCallback.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackCommand.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -0,0 +1,120 @@
+/**
+ *
+ */
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jbpm.JbpmContext;
+import org.jbpm.command.SignalCommand;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+
+/**
+ * @author kstam
+ *
+ */
+public class CallbackCommand extends SignalCommand {
+
+ private Logger logger = Logger.getLogger(this.getClass());
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private EPR callbackEpr;
+
+ public CallbackCommand() {
+ super();
+ }
+
+ public CallbackCommand(long tokenId, String transitionName) {
+ super(tokenId, transitionName);
+ }
+
+ public CallbackCommand(long tokenId, String transitionName, EPR callbackEpr)
+ {
+ super(tokenId, transitionName);
+ this.callbackEpr = callbackEpr;
+ }
+
+ public EPR getCallbackEpr() {
+ return callbackEpr;
+ }
+ public void setCallbackEpr(EPR callbackEpr) {
+ this.callbackEpr = callbackEpr;
+ }
+
+ public Object execute(JbpmContext jbpmContext)
+ {
+ try {
+ long tokenId = checkCurrentState(jbpmContext, callbackEpr);
+ //if the state is ok, then goahead with the signalling the transition
+ this.setTokenId(tokenId);
+ return super.execute(jbpmContext);
+ } catch (CallbackException jbpmCe) {
+ logger.warn(jbpmCe.getMessage());
+ return null;
+ }
+ }
+
+ /**
+ * Checks whether the current state in jBPM is the expected state. If so it returns the tokenId
+ * on which we can invoke a signal.
+ *
+ * @param replyTo
+ * @return
+ * @throws CallbackException
+ */
+ protected long checkCurrentState(JbpmContext jbpmContext, EPR callbackEpr)
+ throws CallbackException
+ {
+ long nodeId = Long.parseLong(callbackEpr.getAddr().getExtensionValue(Constants.NODE_ID));
+ long tokenId = Long.parseLong(callbackEpr.getAddr().getExtensionValue(Constants.TOKEN_ID));
+ long processInstanceId = Long.parseLong(callbackEpr.getAddr().getExtensionValue(Constants.PROCESS_INSTANCE_ID));
+ String counterName = Constants.PROCESS_NODE_VERSION_COUNTER + nodeId;
+ long processNodeVersion = Long.parseLong(callbackEpr.getAddr().getExtensionValue(counterName));
+ if (logger.isDebugEnabled()) logger.debug("Expected nodeId=" + nodeId +
+ ", tokenId=" + tokenId + ", processNodeVersion=" + processNodeVersion);
+ //get update on current state of things.
+ ProcessInstance instance = jbpmContext.getProcessInstance(processInstanceId);
+ Long currentTokenId = null;
+ Long currentNodeId = null;
+ List tokens = instance.findAllTokens();
+ for (Object object : tokens) {
+ Token token = (Token) object;
+ if (token.getId()==tokenId) {
+ currentTokenId = token.getId();
+ currentNodeId = token.getNode().getId();
+ break;
+ }
+ }
+ //Compare current with expected
+ StringBuilder unExpected = new StringBuilder();
+ if (nodeId!=currentNodeId) {
+ unExpected.append("A timeout occured or something else signaled the node, " + currentNodeId +
+ "causing it to move away from the expected node with id= ").append(nodeId).append(". ");
+ }
+ if (tokenId!=currentTokenId) {
+ unExpected.append("The process is at the expected Node, but the current Token (id=" + currentTokenId +
+ ") is not the expected Token (").append(tokenId).append("), ");
+ }
+ if (logger.isDebugEnabled()) logger.debug("Current state nodeId=" + currentNodeId);
+ //get the current processNode Version
+ Long currentProcessNodeVersion = Long.parseLong(String.valueOf(
+ instance.getContextInstance().getVariable(counterName)));
+ if (logger.isDebugEnabled()) logger.debug("ProcessNodeVersion=" + currentProcessNodeVersion);
+ if (processNodeVersion!=currentProcessNodeVersion) {
+ unExpected.append("The current processNodeVersion (id=" + currentProcessNodeVersion +
+ ") is not the expected version (version=").append(processNodeVersion).append("). ");
+ }
+ if (!"".equals(unExpected.toString())) {
+ throw new CallbackException(unExpected.toString());
+ }
+ return tokenId;
+ }
+
+
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CallbackException.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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);
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -26,10 +26,13 @@
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;
@@ -54,9 +57,9 @@
{
static CommandExecutor commandExecutor;
- private static Logger _logger = Logger.getLogger(CommandExecutor.class);
- private static JbpmConfiguration s_jbpmConfig;
- private static CommandService s_jbpmService;
+ private static Logger logger = Logger.getLogger(CommandExecutor.class);
+ private static JbpmConfiguration jbpmConfig;
+ private static CommandService jbpmService;
public static CommandExecutor getInstance()
{
@@ -66,36 +69,36 @@
return commandExecutor;
}
- public Command getCommand(String commandString) throws Exception
+ public Command getCommand(String commandString) throws ConfigurationException
{
Constants.OpCode opCode = Constants.OpCode.valueOf(commandString);
Command command = _values.get(opCode);
if (null==command)
- throw new Exception(opCode.toString()+" not implemented,");
+ throw new ConfigurationException(opCode.toString()+" not implemented,");
return command;
}
protected static final Command DEPLOY_PROCESS_DEF_EXECUTOR = new Command()
{
- public void execute(Message request) throws JbpmException
+ public void execute(Message message) throws JbpmException
{
- Object obj = MessageHelper.getObjectValue(request, Constants.PROCESS_DEFINITION);
+ Object obj = MessageHelper.getObjectValue(message, Constants.PROCESS_DEFINITION);
if (null==obj)
{
obj = ProcessDefinition.parseXmlString
- ((String)MessageHelper.getObjectValue(request,Constants.PROCESS_DEFINITION_XML));
+ ((String)MessageHelper.getObjectValue(message,Constants.PROCESS_DEFINITION_XML));
}
final ProcessDefinition def = (ProcessDefinition)obj;
- _logger.debug("Deploying new process definition " + def.getName());
+ logger.debug("Deploying new process definition " + def.getName());
executeJbpmCommand(new org.jbpm.command.Command()
{
private static final long serialVersionUID = 1L;
ProcessDefinition _def = def;
- public Object execute(JbpmContext jbpmCtx) throws Exception
+ public Object execute(JbpmContext jbpmCtx)
{
jbpmCtx.deployProcessDefinition(_def);
- _logger.info("Process Definition '" + def.getName() + "' is deployed.");
+ logger.info("Process Definition '" + def.getName() + "' is deployed.");
return null;
}
});
@@ -105,52 +108,83 @@
protected static final Command CANCEL_PROCESS_INSTANCE_EXECUTOR = new Command()
{
- public void execute(Message request) throws JbpmException
+ public void execute(Message message) throws JbpmException
{
- long processId = MessageHelper.getLongValue(request,Constants.PROCESS_INSTANCE_ID);
- _logger.debug("Cancel Process Instance Command for ProcessId=" + processId);
+ 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 request) throws JbpmException
+ public void execute(Message message) throws JbpmException
{
SignalCommand command = new SignalCommand();
- Long tokenId = MessageHelper.getLongValue(request,Constants.TOKEN_ID);
+ Long tokenId = MessageHelper.getLongValue(message,Constants.TOKEN_ID);
if (null== tokenId)
{
- Long processId = MessageHelper.getLongValue(request,Constants.PROCESS_INSTANCE_ID);
- _logger.debug("TokenId was not found, so try to obtain the root token from this process definition, " +
- " with ProcessId=" + processId);
+ 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 (processId==null) {
+ 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(processId));
+ .execute(new GetProcessInstanceCommand(processInstanceId));
tokenId = inst.getRootToken().getId();
}
command.setTokenId(tokenId);
- String transition = MessageHelper.getStringValue(request, Constants.TRANSITION_NAME);
+ String transition = MessageHelper.getStringValue(message, Constants.TRANSITION_NAME);
if (null!=transition)
command.setTransitionName(transition);
-
- Map map = (Map)MessageHelper.getObjectValue(request, Constants.VARIABLE_VALUES);
+
+ //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);
+ 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.DeployProcessDefinition ,DEPLOY_PROCESS_DEF_EXECUTOR);
@@ -171,7 +205,7 @@
perform(request,_start);
}
- private void perform(Message request, boolean start) throws JbpmException
+ private void perform(Message request, boolean start)
{
ObjectMapper objectMapper = new ObjectMapper();
NewProcessInstanceCommand command = null;
@@ -202,7 +236,7 @@
String key = String.valueOf(objectMapper.getObjectFromMessage(request, keyPath));
command.setKey(key);
} catch (ObjectMappingException e) {
- _logger.error("Could not locate key " + e.getMessage(), e);
+ logger.error("Could not locate key " + e.getMessage(), e);
}
}
String actorId=MessageHelper.getStringValue(request, Constants.ACTOR_ID);
@@ -212,31 +246,30 @@
Map<String, Object> variables = MessageHelper.getVariablesMap(request, Constants.VARIABLE_VALUES);
if (null!=variables) command.setVariables(variables);
- _logger.debug("New process instance with command=" + command);
+ logger.debug("New process instance with command=" + command);
executeJbpmCommand(command);
}
}
- private static void executeJbpmCommand(org.jbpm.command.Command command) throws JbpmException
+ private static void executeJbpmCommand(org.jbpm.command.Command command)
{
- if (_logger.isDebugEnabled()) {
- _logger.debug(command);
+ if (logger.isDebugEnabled()) {
+ logger.debug(command);
}
getJbpmCommandService().execute(command);
}
/**
- * Encapsulate obtention of jBPM CommandService here
- * <br/>If it can't be cached, we only need to change this method.
+ * Encapsulate obtention of jBPM CommandService.
* @return CommandService
*/
public static CommandService getJbpmCommandService()
{
- if (null== s_jbpmService) {
- s_jbpmConfig = JbpmConfiguration.getInstance();
- s_jbpmService = new CommandServiceImpl(s_jbpmConfig);
+ if (null== jbpmService) {
+ jbpmConfig = JbpmConfiguration.getInstance();
+ jbpmService = new CommandServiceImpl(jbpmConfig);
}
- return s_jbpmService;
+ return jbpmService;
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/ConfigUtil.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -1,136 +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.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.message.mapping.ObjectMapper;
-import org.jboss.soa.esb.message.mapping.ObjectMappingException;
-import org.jboss.soa.esb.services.jbpm.Constants;
-
-public class FacadeUtil
-{
- static Boolean booleanFromConfig(ConfigTree tree, String tag)
- throws ConfigurationException
- {
- 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");
- try
- {
- return Boolean.parseBoolean(childs[0].getAttribute("value"));
- }
- catch (Exception e)
- {
- throw new ConfigurationException("<"+tag
- +"> must have a 'value' attribute containing 'true' or 'false'");
- }
- } //________________________________
-
- static VariableMapping variablesFromConfig(ConfigTree tree, boolean acceptValue)
- throws ConfigurationException
- {
- VariableMapping ret = new VariableMapping();
- ConfigTree[] objectList = tree.getChildren(Constants.OBJECT_PATH_TAG);
- if (objectList != null) {
- for (ConfigTree curr : objectList) {
- String esbName = curr.getAttribute(Constants.ESB_VARNAME_TAG);
- String jbpmName = curr.getAttribute(Constants.JBPM_VARNAME_TAG);
- String value = curr.getAttribute("value");
- ret.setVariable(esbName, jbpmName, value);
- }
- }
- return ret;
- }
-
- 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;
- }
-
-
- static void populateVariableValues (Message message, VariableMapping mapping)
- {
- if (null==mapping || mapping.size()<1)
- return;
-
- Body body = message.getBody();
- HashMap<String,Object> map = new HashMap<String, Object>();
- for (Map.Entry<String, Object> curr: mapping.esbVariables().entrySet())
- {
- String esbName = curr.getKey();
- String jbpmName = mapping.getJbpmName(esbName);
-
- ObjectMapper objectMapper = new ObjectMapper();
- Object value = null;
- try {
- value = objectMapper.getObjectFromMessage(message, esbName);
- } catch (ObjectMappingException ome) {
- throw new IllegalArgumentException(ome.getMessage(), ome);
- }
- // if object not found in body, use default value (from config)
- if (null==value)
- value = curr.getValue();
- // only put it in the map if it's not null
- if (null!=value)
- map.put(jbpmName, value);
- }
- body.add(Constants.VARIABLE_VALUES, map);
- }
-
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -7,7 +7,6 @@
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.actions.BpmProcessor;
/**
* @author kstam
@@ -36,11 +35,11 @@
throws ConfigurationException, UnsupportedOperationException
{
Constants.OpCode opCode = null;
- String sAux = config.getRequiredAttribute(BpmProcessor.COMMAND_ATTRIBUTE_TAG);
- try { opCode = Constants.OpCode.valueOf(sAux); }
- catch (IllegalArgumentException e)
- {
- throw new ConfigurationException("Attribute '"+BpmProcessor.COMMAND_ATTRIBUTE_TAG+"' has an invalid value"
+ 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");
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -22,11 +22,16 @@
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;
/**
@@ -51,17 +56,18 @@
_actor = config.getAttribute(Constants.ONE_ACTOR_TAG);
_processName= config.getAttribute(Constants.PROCESS_DEFINITION_NAME_TAG);
_keyPath = config.getAttribute(Constants.KEY_TAG);
- String aux = config.getAttribute(Constants.PROCESS_DEFINITION_ID_TAG);
- if (null!=aux)
- try {_processId = Long.parseLong(aux); }
- catch(NumberFormatException e)
- {
+ 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+"'");
}
- _variables = FacadeUtil.variablesFromConfig(config, true);
-
- if (_start)
+ }
+ _esbToBpm = ConfigUtil.getMappingConfig(config);
+ if (_start) {
_transitionName = config.getAttribute(Constants.TRANSITION_NAME_TAG);
+ }
}
public void setJBPMContextParameters(Message message)
@@ -77,8 +83,9 @@
body.add(Constants.PROCESS_DEFINITION_ID ,_processId);
if (null!=_transitionName)
body.add(Constants.TRANSITION_NAME, _transitionName);
-
- FacadeUtil.populateVariableValues(message,_variables);
+ Map<String,Object> variableMap = _mapper.mapFromEsbMessageToJBpmMap(message,_esbToBpm);
+ if (null!=variableMap)
+ body.add(Constants.VARIABLE_VALUES, variableMap);
}
boolean _start;
@@ -87,5 +94,6 @@
String _processName;
String _transitionName;
Long _processId;
- VariableMapping _variables;
+ List<Mapping> _esbToBpm;
+ JBpmObjectMapper _mapper = new JBpmObjectMapper();
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -22,11 +22,16 @@
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;
/**
@@ -43,7 +48,7 @@
public SignalFacade(ConfigTree config) throws ConfigurationException
{
_transition = config.getAttribute(Constants.TRANSITION_NAME_TAG);
- _variables = FacadeUtil.variablesFromConfig(config, false);
+ _esbToBpm = ConfigUtil.getMappingConfig(config);
}
public void setJBPMContextParameters(Message message)
@@ -51,9 +56,12 @@
Body body = message.getBody();
if (null!=_transition)
body.add(Constants.TRANSITION_NAME, _transition);
- FacadeUtil.populateVariableValues(message, _variables);
+ Map<String,Object> variableMap = _mapper.mapFromEsbMessageToJBpmMap(message, _esbToBpm);
+ if (null!=variableMap)
+ body.add(Constants.VARIABLE_VALUES, variableMap);
}
-
- String _transition;
- VariableMapping _variables;
+
+ String _transition;
+ List<Mapping> _esbToBpm;
+ JBpmObjectMapper _mapper = new JBpmObjectMapper();
}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -1,66 +0,0 @@
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.soa.esb.util.Util;
-
-/**
- * A container for variable names and values with access both by esb name and jbpm name.
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public class VariableMapping
-{
- // internal key is always esb name
- private Map<String,Object> _values = new HashMap<String, Object>();
- // map jbpm names to esb names
- private Map<String,String> _jbpmNames = new HashMap<String, String>();
- // map esb names to jbpm names
- private Map<String,String> _esbNames = new HashMap<String, String>();
-
- public int size() { return _values.size(); }
-
- private String setMapping(String esbName, String jbpmName)
- {
- if (Util.isNullString(esbName) && Util.isNullString(jbpmName))
- throw new IllegalArgumentException("You must specify at least one valid variable name (esb or bpm)");
- if (Util.isNullString(jbpmName))
- jbpmName = getName(esbName);
- if (Util.isNullString(esbName))
- esbName = getName(jbpmName);
- String oldMapping = _esbNames.get(jbpmName);
- if (null!=oldMapping && !oldMapping.equals(jbpmName))
- throw new IllegalArgumentException
- ("Illegal mapping esb=<"+esbName+"> was mapped to bpm=<"+oldMapping+ "> cannot remap to "+jbpmName);
-
- _esbNames .put(esbName, jbpmName);
- _jbpmNames .put(jbpmName, esbName);
- // Internally, esbName is the key to the variable values
- return esbName;
- }
-
- protected String getName(String path)
- {
- String name = path;
- int index = path.lastIndexOf(".");
- if (index > 0) {
- name = path.substring(index+1);
- }
- return name;
- }
-
- public void setVariable(String esbName, String jbpmName, Object value)
- {
- _values .put(setMapping(esbName, jbpmName), value);
- }
-
- public String getEsbName (String key) { return _jbpmNames.get(key); }
- public String getJbpmName (String key) { return _esbNames.get(key); }
-
- public Object getEsbVariable (String key) { return _values.get(key); }
- public Object getJbpmVariable(String key) { return _values.get(_jbpmNames.get(key)); }
-
- public Map<String,Object> esbVariables() { return _values; }
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/META-INF/jboss-esb.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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-provider name="CallbackQueue-JMS-Provider" connection-factory="ConnectionFactory">
+ <jms-bus busid="jBPMCallbackBus">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/CallbackQueue"
+ />
+ </jms-bus>
+ </jms-provider>
+ </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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/hibernate.cfg.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/hibernate.cfg.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/hibernate.cfg.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbm-queue-service.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/main/resources/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbm-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbmq-queue-service.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/main/resources/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbmq-queue-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm.cfg.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm.cfg.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/resources/jbpm.cfg.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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);
+ }
+
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -22,59 +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;
-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
{
@@ -97,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(
@@ -119,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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/JBpmObjectMapperCallbackTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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);
+ }
+
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -25,12 +25,15 @@
import static org.junit.Assert.assertTrue;
import java.io.File;
+import java.io.InputStream;
import junit.framework.JUnit4TestAdapter;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.services.jbpm.cmd.MessageHelper;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jboss.soa.esb.util.ClassUtil;
import org.jbpm.JbpmConfiguration;
import org.junit.AfterClass;
import org.junit.Test;
@@ -71,10 +74,12 @@
{
try
{
- String xml = JbpmTestUtil.stringFromFile("testDeployFromFile.xml");
+ InputStream in = ClassUtil.getResourceAsStream("testDeployFromFile.xml",getClass());
+ String xml = FileUtil.readStream(in);
ConfigTree[] actions = ConfigTree.fromXml(xml).getChildren("action");
BpmProcessor command = new BpmProcessor(actions[0]);
+ command.initialise();
command.process(MessageHelper.commandMessageTemplate());
}
catch (Exception e)
@@ -90,10 +95,12 @@
{
try
{
- String xml = JbpmTestUtil.stringFromFile("testSingleCommands.xml");
+ InputStream in = ClassUtil.getResourceAsStream("testSingleCommands.xml",getClass());
+ String xml = FileUtil.readStream(in);
ConfigTree[] actions = ConfigTree.fromXml(xml).getChildren("action");
int index = 0;
BpmProcessor command = new BpmProcessor(actions[index++]);
+ command.initialise();
command.process(MessageHelper.commandMessageTemplate());
}
catch (Exception e)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/JbpmTestUtil.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/JbpmTestUtil.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/JbpmTestUtil.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -1,110 +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 java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.util.ClassUtil;
-
-public class JbpmTestUtil
-{
- private static final Class thisClass = JbpmTestUtil.class;
-
- public static String stringFromFile(String pFileName) throws IOException
- {
- InputStream in = ClassUtil.getResourceAsStream(pFileName,thisClass);
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- byte[]ba = new byte[1000];
- int iQ = -1;
- while (-1<(iQ=in.read(ba)))
- if (iQ>0) out.write(ba,0,iQ);
- in.close();
- return out.toString();
- }
-
- public static void copyFile(String resource, File target) throws IOException
- {
- InputStream in = thisClass.getResourceAsStream(resource);
- FileOutputStream out = new FileOutputStream(target);
- byte[]ba = new byte[1000];
- int iQ = -1;
- while (-1<(iQ=in.read(ba)))
- if (iQ>0) out.write(ba,0,iQ);
- out.close();
- in.close();
- }
-
- public static String dumpResponse(Message message, Constants.OpCode opCode)
- {
- StringBuilder sb = new StringBuilder("\nInvoked: ").append(opCode.toString()).append("\n");
- if (null==message)
- return sb.append(" - No response received").toString();
- sb.append(getObject(message,Constants.RETURN_CODE));
- sb.append(getObject(message,Constants.ERROR_MESSAGE));
- sb.append(getObject(message,Constants.EXCEPTION));
- sb.append(getObject(message,Constants.ACTOR_ID));
- sb.append(getObject(message,Constants.ACTOR_NAMES_ARRAY));
- sb.append(getObject(message,Constants.CURRENT_NODE_NAME));
- sb.append(getObject(message,Constants.JBPM_RETURN_OBJECT));
- sb.append(getObject(message,Constants.PROCESS_DEFINITION_NAME));
- sb.append(getObject(message,Constants.PROCESS_DEFINITION_VERSION));
- sb.append(getObject(message,Constants.PROCESS_INSTANCE_ID));
- sb.append(getObject(message,Constants.TASK_INSTANCE_ID));
- sb.append(getObject(message,Constants.TOKEN_ID));
- sb.append(getObject(message,Constants.HAS_ENDED));
- sb.append(getObject(message,Constants.BODY_CONTENT_VARIABLE_NAME));
- sb.append(getObject(message,Constants.JBPM_LOG_MAP));
-
- return sb.append("_______________________________________________________________________")
- .toString();
- }
-
- public static String getObject(Message message, String key)
- {
- Object obj = null;
- if(Constants.BODY_CONTENT_VARIABLE_NAME.equals(key))
- {
- obj = message.getBody().get();
- return "Message body content = "
- +((null==obj) ? "<null>" : obj)
- +"\n";
- }
-
- obj = message.getBody().get(key);
- if (null==obj)
- return "";
- if (!(obj instanceof Exception))
- return key+" = "+obj.toString()+"\n";
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
- ((Exception)obj).printStackTrace(new PrintStream(ba));
- return key+" = "+obj.toString()+"\n"+ba.toString();
- }
-
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/testSingleCommands.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/testSingleCommands.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/testSingleCommands.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -7,10 +7,10 @@
actor="FrankSinatra"
key="body.key"
>
- <object-path esb="BODY_CONTENT" bpm="theBody" value="DEF DEF DEF"/>
- <object-path esb="body.eVar1" bpm="j1" value="AAAbbb111" />
- <object-path esb="eVar2" bpm="vJ22" value="998877" />
- <object-path esb="body.newVar" value="123" />
+ <mapping esb="BODY_CONTENT" bpm="theBody" default="DEF DEF DEF"/>
+ <mapping esb="body.eVar1" bpm="j1" default="AAAbbb111" />
+ <mapping esb="eVar2" bpm="vJ22" default="998877" />
+ <mapping esb="body.newVar" default="123" />
</action>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -1,55 +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 static org.junit.Assert.assertEquals;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.jboss.soa.esb.services.jbpm.cmd.VariableMapping;
-import org.junit.Test;
-
-
-/**
- * @author kstam
- *
- */
-public class VariableMappingUnitTest
-{
-
- @Test
- public void testGetName()
- {
- VariableMapping mapper = new VariableMapping();
- String path = "body.someobjectname";
- String name = mapper.getName(path);
- assertEquals("someobjectname",name);
- }
-
-
-
-
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(VariableMappingUnitTest.class);
- }
-}
Property changes on: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources
___________________________________________________________________
Name: svn:ignore
+ .gpd.JBpmObjectMapperTestProcessDefinition.xml
.gpd.testMappingDefinition.xml
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.jpg (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.jpg)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/JBpmObjectMapperTestProcessDefinition.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/jbpm.cfg.xml (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/test/resources/jbpm.cfg.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/jbpm.cfg.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/jbpm.cfg.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testMappingDefinition.jpg (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/product/services/jbpm/src/test/resources/testMappingDefinition.jpg)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testMappingDefinition.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testMappingDefinition.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/resources/testMappingDefinition.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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.*;
@@ -148,7 +170,7 @@
* Option 2 (above) provides a quick-and-dirty way to populate a SOAP message without having to create an Object
* model ala Option 1. The OGNL expressions that correspond with the SOAP operation parameters are exactly the same
* as for Option 1, except that there's not Object Graph Navigation involved. The OGNL expression is simply used as
- * the key into the {@link Map}, with the corresponding key-value being the parameter.
+ * the key into the {@link Map}, with the corresponding key-value being the parameter.
*
* <h2>SOAP Response Message Consumption</h2>
* The SOAP response object instance can be is attached to the ESB {@link Message} instance in one of the
@@ -215,10 +237,10 @@
* with a Smooks transformation configuration property as follows:
* <pre>
* <property name="smooksTransform" value="/transforms/order-transform.xml" /></pre>
- *
+ *
* The value of the "smooksTransform" property is resolved by first checking it as a filesystem based resource.
- * Failing that, it's checked as a classpath resource and failing that, as a URI based resource.
- *
+ * Failing that, it's checked as a classpath resource and failing that, as a URI based resource.
+ *
* <h3>Specifying a different SOAP schema</h3>
* <pre>
* <property name="SOAPNS" value="http://www.w3.org/2009/09/soap-envelope"/>
@@ -295,7 +317,7 @@
public void initialise() throws ActionLifecycleException {
super.initialise();
// Create the SoapUIInvoker instance for this SOAPClient...
- soapUIInvoker = new SoapUIInvoker();
+ soapUIInvoker = new SoapUIInvoker();
}
private void extractHttpClientProps(ConfigTree config) {
@@ -330,6 +352,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) {
@@ -342,7 +365,7 @@
return message;
}
-
+
public String getSoapNS()
{
return soapNs;
@@ -361,20 +384,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();
@@ -493,7 +520,7 @@
private static DocumentBuilderFactory createDocumentBuilderFactory() {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-
+
factory.setNamespaceAware(true);
factory.setExpandEntityReferences(true);
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/LogicalEPRUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/LogicalEPRUnitTest.java 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/LogicalEPRUnitTest.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -21,6 +21,9 @@
import junit.framework.Test;
import org.jboss.soa.esb.TestUtils;
+import org.jboss.soa.esb.addressing.eprs.LogicalEPR;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.testutils.FileUtil;
import org.jboss.soa.esb.testutils.JMSUtil;
import org.jboss.soa.esb.util.DeploymentArchive;
@@ -63,6 +66,25 @@
assertEquals("org.jboss.soa.esb.actions.ActionProcessingException: Service2Action fault", actualOutput);
}
+ public void test_logical_extension() throws Exception {
+ final LogicalEPR logicalEPR = new LogicalEPR("MyServiceCategory", "MyService4") ;
+ final String tag = "TestTag" ;
+ final String prefix = "TestPrefix" ;
+ final String value = "TestValue" ;
+
+ logicalEPR.getAddr().addExtension(tag, prefix, Service4Action.TEST_URI, value) ;
+
+ final Message message = MessageFactory.getInstance().getMessage() ;
+ message.getBody().add("Incoming Test Payload") ;
+ logicalEPR.getServiceInvoker().deliverAsync(message) ;
+
+ assertTrue("Test output file '" + TEST_OUTPUT_FILE + "' not dropped.", TestUtils.waitForFile(TEST_OUTPUT_FILE.getAbsolutePath()));
+
+ final String actualOutput = FileUtil.readStream(new FileInputStream(TEST_OUTPUT_FILE));
+ final String expectedOutput = "Prefix " + prefix + " Tag " + tag + " value " + value ;
+ assertEquals(expectedOutput, actualOutput);
+ }
+
public static Test suite() throws Exception {
DeploymentArchive deployment = new DeploymentArchive("LogicalEPRUnitTest.esb");
@@ -73,6 +95,7 @@
deployment.addEntry(Service2Action.class);
deployment.addEntry(Service3Action1.class);
deployment.addEntry(Service3Action2.class);
+ deployment.addEntry(Service4Action.class);
deployment.create();
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/Service4Action.java (from rev 17277, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR5/qa/junit/src/org/jboss/soa/esb/epr/Service4Action.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/Service4Action.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/Service4Action.java 2007-12-17 06:24:48 UTC (rev 17282)
@@ -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, JBoss Inc.
+ */
+package org.jboss.soa.esb.epr;
+
+import java.util.Iterator;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference.Extension;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * @author <a href="mailto:Kevin.Conner at jboss.com">Kevin Conner</a>
+ */
+public class Service4Action extends AbstractActionPipelineProcessor
+{
+ public static final String TEST_URI = "http://labs.jboss.org/jbossesb/testing/test-uri" ;
+
+ public Service4Action(final ConfigTree config)
+ throws MessageDeliverException
+ {
+ }
+
+ public Message process(final Message message)
+ throws ActionProcessingException
+ {
+ final Call call = message.getHeader().getCall() ;
+ final EPR toEPR = call.getTo() ;
+ final Iterator<Extension> extensions = toEPR.getAddr().getExtensions() ;
+ if (extensions.hasNext())
+ {
+ final StringBuilder sb = new StringBuilder() ;
+ do
+ {
+ final Extension extension = extensions.next() ;
+ if (TEST_URI.equals(extension.getURI()))
+ {
+ sb.append("Prefix " + extension.getPrefix()) ;
+ sb.append(" Tag " + extension.getTag()) ;
+ sb.append(" value " + extension.getValue()) ;
+ }
+ }
+ while(extensions.hasNext()) ;
+ message.getBody().add(sb.toString()) ;
+ }
+
+ return message;
+ }
+}
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/deployment.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/deployment.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/deployment.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -3,4 +3,5 @@
<depends>jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service1</depends>
<depends>jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service2</depends>
<depends>jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service3</depends>
+ <depends>jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service4</depends>
</jbossesb-deployment>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/jboss-esb.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/jboss-esb.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -20,6 +20,9 @@
<jms-bus busid="service3">
<jms-message-filter dest-type="QUEUE" dest-name="queue/LogicalEPRUnitTest_service3"/>
</jms-bus>
+ <jms-bus busid="service4">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/LogicalEPRUnitTest_service4"/>
+ </jms-bus>
</jms-provider>
</providers>
@@ -71,6 +74,18 @@
</actions>
</service>
+ <service category="MyServiceCategory" name="MyService4" description="Service 4">
+ <listeners>
+ <jms-listener name="JMS-ESBListener" busidref="service4"/>
+ </listeners>
+ <actions>
+ <action name="Service4Action" class="org.jboss.soa.esb.epr.Service4Action" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
+ <property name="filename" value="LogicalEPRUnitTest.log" />
+ <property name="raw" value="true"/>
+ </action>
+ </actions>
+ </service>
</services>
</jbossesb>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/jms-service.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/jms-service.xml 2007-12-17 06:21:05 UTC (rev 17281)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/epr/jms-service.xml 2007-12-17 06:24:48 UTC (rev 17282)
@@ -29,4 +29,11 @@
<depends>jboss.messaging:service=PostOffice</depends>
</mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service4"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
</server>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list