[jboss-svn-commits] JBL Code SVN: r19607 - in labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product: etc/schemas/xml and 90 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Apr 17 11:31:53 EDT 2008
Author: tfennelly
Date: 2008-04-17 11:31:52 -0400 (Thu, 17 Apr 2008)
New Revision: 19607
Added:
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/InVMRegistry.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/RegsitryEntry.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/InVMEpr.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/InVMCourierUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java.bak
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/InVMUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/InVMListenerUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/SetPayloadAction.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-01.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-02.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-03.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/jbossesb-properties-01.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/build.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/deployment.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbm-queue-service.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbmq-queue-service.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jndi.properties
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/juddi.properties
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/listener.log
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/log4j.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/readme.txt
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/samples/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/samples/quickstart/invm/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/samples/quickstart/invm/test/
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/samples/quickstart/invm/test/SendJMSMessage.java
Modified:
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/validation/build.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/xml/jbossesb-1.0.1.xsd
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/test/resources/jbossesb-unittest-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/install/conf/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/install/tomcat/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRConnectionFactory.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/addressing/util/DefaultReplyTo.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/build.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ScheduledListenerUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/schedule/SchedulingUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/aggregator/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration1/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration2/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration3/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/business_rules_service/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/business_service/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/custom_action/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/deadletter/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/dynamic_router/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/exceptions_faults/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/fun_cbr/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/groovy_gateway/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_action/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_db_registration/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_file_action/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_file_notifier/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_ftp_action/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_sql_action/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/jms_secured/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/load_generator/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/messagefilter/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/messagestore/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/native_client/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/recipient_list/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/scheduled_services/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/scripting_groovy/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/simple_cbr/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_aop/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_helloworld/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_jpetstore/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/static_router/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_CSV2XML/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2POJO/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2POJO2/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2XML_date_manipulation/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2XML_simple/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/two_servers/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/webservice_consumer1/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/webservice_consumer2/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/wiretap/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/trailblazer/esb/conf/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/base-project-build.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/jbossesb/src/test/java/org/jboss/soa/esb/persistence/tests/ScheduledRedeliveryUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/jbossesb/src/test/resources/jbossesb-unittest-properties.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soap/base-project-build.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/SOAPClientUnitTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soapui-client/build.xml
Log:
InVM transport: http://jira.jboss.com/jira/browse/JBESB-421
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/validation/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/validation/build.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/validation/build.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -113,6 +113,7 @@
<sysproperty key="log4j.configuration" value="log4j.xml"/>
<sysproperty key="xml.base.dir" value="${basedir}/resources"/>
<sysproperty key="xsd.base.dir" value="${basedir}/../schemas/xml"/>
+ <sysproperty key="jboss.esb.invm.scope.default" value="NONE"/>
</junit>
<junitreport>
<fileset dir="${org.jboss.esb.etc.validation.junit.dir}">
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/xml/jbossesb-1.0.1.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-04-17 15:31:52 UTC (rev 19607)
@@ -254,7 +254,9 @@
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
- <xsd:element maxOccurs="1" minOccurs="1"
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ <xsd:element maxOccurs="1" minOccurs="0"
ref="jesb:listeners" />
<xsd:element maxOccurs="1" minOccurs="0"
ref="jesb:actions" />
@@ -287,10 +289,33 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attribute name="invmScope" type="jesb:invmScope" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ All services are locally invokable over an "in VM" transport. Invokability
+ can be scoped using this attribute. An "invmScope" value of "NONE" means that
+ the Service should not be locally invokable over the "in VM" transport.
+ More fine grained scoping will be added in the future.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
</xsd:complexType>
</xsd:element>
- <xsd:simpleType name="mepType">
+ <xsd:simpleType name="invmScope">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <!-- Not invokable over InVM -->
+ <xsd:enumeration value="NONE" />
+
+ <!-- Invokable over InVM only from within the same/local deployment. -->
+ <!-- xsd:enumeration value="LOCAL" / -->
+
+ <!-- (DEFAULT) Invokable over InVM from within the same classloader scope. -->
+ <xsd:enumeration value="GLOBAL" />
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="mepType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="RequestResponse" />
<xsd:enumeration value="OneWay" />
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/test/resources/jbossesb-unittest-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/test/resources/jbossesb-unittest-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/etc/test/resources/jbossesb-unittest-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -35,6 +35,7 @@
<property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
<property name="org.jboss.soa.esb.jndi.server.pkg.prefix" value=""/>
<property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/install/conf/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/install/conf/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/install/conf/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -35,6 +35,7 @@
<property name="org.jboss.soa.esb.jndi.server.url" value="${jboss.bind.address}:1099"/>
<property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
<property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/install/tomcat/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/install/tomcat/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/install/tomcat/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -35,6 +35,7 @@
<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
<property name="org.jboss.soa.esb.jndi.server.pkg.prefix" value="org.apache.naming"/>
<property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java (from rev 19593, labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,59 @@
+/* JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ */
+
+package org.jboss.internal.soa.esb.addressing.eprs;
+
+import org.jboss.internal.soa.esb.couriers.InVMCourier;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
+import org.jboss.soa.esb.couriers.CourierFactory;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+public class DefaultInVMReplyToEpr extends InVMEpr {
+
+ private static ThreadLocal<InVMEpr> invmReplyToEPRTL = new ThreadLocal<InVMEpr>();
+
+ public DefaultInVMReplyToEpr(InVMEpr epr) {
+ super(getThreadEPR());
+ }
+
+ private static EPR getThreadEPR() {
+ // We assign an InVMEpr/Courier to each thread
+
+ InVMEpr threadEPR = invmReplyToEPRTL.get();
+
+ if(threadEPR == null) {
+ try {
+ threadEPR = new InVMEpr(URI.create("invm://thread-" + Thread.currentThread().getId()));
+ invmReplyToEPRTL.set(threadEPR);
+ } catch (URISyntaxException e) {
+ throw new RuntimeException("Unexpected Exception creating replyTo InVMEpr.", e);
+ }
+ }
+
+ // Rest the courier in case there are stale messages there
+ // waiting to be picked up...
+ InVMCourier threadCourier = CourierFactory.getInstance().getInVMCourier(threadEPR);
+ threadCourier.reset();
+
+ return threadEPR;
+ }
+}
\ No newline at end of file
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -157,7 +157,9 @@
* Do not re-order.
*/
- if (epr instanceof EmailEpr)
+ if (epr instanceof InVMEpr)
+ eprType = InVMEpr.type().toString();
+ else if (epr instanceof EmailEpr)
eprType = EmailEpr.type().toString();
else if (epr instanceof SFTPEpr)
eprType = SFTPEpr.type().toString();
@@ -195,7 +197,9 @@
* Do not re-order.
*/
- if (eprType.equals(EmailEpr.type().toString()))
+ if (eprType.equals(InVMEpr.type().toString()))
+ return new InVMEpr(epr);
+ else if (eprType.equals(EmailEpr.type().toString()))
return new EmailEpr(epr);
else if (eprType.equals(SFTPEpr.type().toString()))
return new SFTPEpr(epr);
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,171 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.message.Message;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+/*
+ * These need to be treated differently to other couriers or we'll end up with
+ * garbage collection issues. We need to enforce a rule that a sender cannot
+ * send (gets an error) if the server isn't listening. That's straightforward to
+ * do here, but we need to check the impact on the rest of the codebase, since the
+ * other couriers can be used asynchronously of the service lifecycle. The courier
+ * instance should be purges when the service is finished with it.
+ *
+ * An alternative would be to use a WeakHashMap for maintaining the InVMCouriers in
+ * the InternalCourierFactory. But I'd prefer to have explicit control over the courier
+ * lifecycle rather than leaving to the vagueries of the gc. Plus, it could introduce
+ * some interesting race conditions.
+ */
+
+public class InVMCourier implements PickUpOnlyCourier, DeliverOnlyCourier {
+
+ protected InVMEpr epr;
+
+ protected static Logger logger = Logger.getLogger(InVMCourier.class);
+
+ private Queue<Message> messageQueue = new ConcurrentLinkedQueue<Message>();
+
+ private long deliveryTimeout = 0;
+
+ private boolean isActive = true;
+
+ /**
+ * Objects of this class should only be instantiated by internal
+ * implementations
+ *
+ * @param epr
+ */
+
+ public InVMCourier(InVMEpr epr) {
+ this.epr = epr;
+
+ /*
+ * Normally we keep the link between sender and receiver threads. This
+ * makes the model simpler and allows services to be transplanted
+ * between transports. Plus, this is based on the experiences from CORBA
+ * 2.0 to 2.3, where POA was introduced: by default all local
+ * invocations then looked like remote invocations and weren't
+ * necessarily handled by the same thread. But all good ORBs had a
+ * workaround to go back to the old style, where the same thread did all
+ * of the work in "lock step" (it was the same thread).
+ */
+
+ if (epr.getLockstep()) {
+ deliveryTimeout = epr.getLockstepWaitTime();
+ } else {
+ deliveryTimeout = 0;
+ }
+ }
+
+ /**
+ * package the ESB message into the queue
+ *
+ * @param message Message - the message to deliverAsync
+ * @return boolean - the result of the delivery
+ * @throws CourierException -
+ * if problems were encountered
+ */
+ public boolean deliver(Message message) {
+ if (!isCourierActive()) {
+ return false;
+ }
+
+ if (message == null) {
+ return false;
+ }
+
+ synchronized (messageQueue) {
+ messageQueue.add(message);
+
+ // Notify 1 waiting pickup thread of the delivery...
+ messageQueue.notify();
+
+ if (deliveryTimeout > 0) {
+ try {
+ // Wait on notification from the pickup thread...
+ messageQueue.wait(deliveryTimeout);
+ } catch (InterruptedException e) {
+ logger.warn("Timeout expired while waiting on message pickup on InVM queue '" + epr.getAddr().getAddress() + "'.", e);
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public Message pickup(long millis) {
+ if (!isCourierActive()) {
+ return null;
+ }
+
+ Message message = null;
+
+ millis = Math.max(millis, 100);
+ synchronized (messageQueue) {
+ if (messageQueue.isEmpty()) {
+ try {
+ messageQueue.wait(millis);
+ } catch (InterruptedException e) {
+ logger.debug("Pickup thread '" + Thread.currentThread().getName() + "' interrupted while waiting on delivery notification or timeout.", e);
+ }
+ }
+ if (!messageQueue.isEmpty()) {
+ message = messageQueue.remove();
+ }
+
+ // Notify 1 waiting delivery thread of the pickup...
+ messageQueue.notify();
+ }
+
+ return message;
+ }
+
+ public void cleanup() {
+ }
+
+ private boolean isCourierActive() {
+ if (!isActive) {
+ logger.debug("InVMCourier for EPR '" + epr.getAddr().getAddress() + "' is not active. Cannot pickup/deliver on this courier.", new Exception());
+ return false;
+ }
+ return true;
+ }
+
+ public void setActive(boolean active) {
+ isActive = active;
+ }
+
+ public void clean() {
+ }
+
+ public void reset() {
+ messageQueue.clear();
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -22,24 +22,21 @@
package org.jboss.internal.soa.esb.couriers;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.UUID;
-
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.MalformedEPRException;
import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
+import org.jboss.soa.esb.couriers.*;
import org.jboss.soa.esb.filter.FilterManager;
import org.jboss.soa.esb.message.Message;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.UUID;
+
/**
* A two-way-courier can perform message deliveries and pickups.
*
@@ -54,7 +51,12 @@
private PickUpOnlyCourier _pickupCourier;
- /**
+ public TwoWayCourierImpl(DeliverOnlyCourier deliverCourier, PickUpOnlyCourier pickupCourier) {
+ _deliverCourier = deliverCourier;
+ _pickupCourier = pickupCourier;
+ }
+
+ /**
* Constructor.
*
* @param toEpr -
@@ -105,7 +107,15 @@
}
}
- private DeliverOnlyCourier getDeliverCourier(EPR toEPR)
+ public PickUpOnlyCourier getPickupCourier() {
+ return _pickupCourier;
+ }
+
+ public DeliverOnlyCourier getDeliverCourier() {
+ return _deliverCourier;
+ }
+
+ private DeliverOnlyCourier getDeliverCourier(EPR toEPR)
throws CourierException, MalformedEPRException
{
return (null == toEPR) ? null : (DeliverOnlyCourier) courierFromEpr(
@@ -124,6 +134,8 @@
{
if (null == epr)
return null;
+ if (epr instanceof InVMEpr)
+ return CourierFactory.getInstance().getInVMCourier((InVMEpr) epr);
if (epr instanceof JMSEpr)
return new JmsCourier((JMSEpr) epr, pickUpOnly);
if (epr instanceof FileEpr)
@@ -143,6 +155,8 @@
String addr = null;
addr = epr.getAddr().getAddress();
+ if (addr.startsWith(InVMEpr.INVM_PROTOCOL))
+ return CourierFactory.getInstance().getInVMCourier(new InVMEpr(epr));
if (addr.startsWith(JMSEpr.JMS_PROTOCOL))
return new JmsCourier(new JMSEpr(epr), pickUpOnly);
if (addr.startsWith(JDBCEpr.JDBC_PROTOCOL))
@@ -162,40 +176,35 @@
public boolean deliver(Message message) throws CourierException,
MalformedEPRException
{
- if (null == _deliverCourier)
- throw new CourierException("No deliverAsync courier");
- final Call call = message.getHeader().getCall() ;
- call.setTo(_toEPR) ;
-
- final boolean setMessageID = call.getMessageID() == null;
- if (setMessageID)
- {
- final String messageID = UUID.randomUUID().toString() ;
- try
- {
- call.setMessageID(new URI(messageID)) ;
- }
- catch (final URISyntaxException urise)
- {
- throw new MalformedEPRException("Failed to set message ID to " + messageID) ;
- }
- }
+ if (null == _deliverCourier)
+ throw new CourierException("No deliverAsync courier");
+
+ final Call call = message.getHeader().getCall();
+ call.setTo(_toEPR);
- try
- {
- message = FilterManager.getInstance().doOutputWork(message, null);
-
- return _deliverCourier.deliver(message);
- }
- finally
- {
- if (setMessageID)
- {
- call.setMessageID(null) ;
- }
- }
- }
+ final boolean setMessageID = call.getMessageID() == null;
+ if (setMessageID) {
+ final String messageID = UUID.randomUUID().toString();
+ try {
+ call.setMessageID(new URI(messageID));
+ }
+ catch (final URISyntaxException urise) {
+ throw new MalformedEPRException("Failed to set message ID to " + messageID);
+ }
+ }
+ try {
+ message = FilterManager.getInstance().doOutputWork(message, null);
+
+ return _deliverCourier.deliver(message);
+ }
+ finally {
+ if (setMessageID) {
+ call.setMessageID(null);
+ }
+ }
+ }
+
/**
* @see org.jboss.soa.esb.couriers.TwoWayCourier#pickup(long waitTime).
*/
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/InVMRegistry.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/InVMRegistry.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/InVMRegistry.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,158 @@
+/*
+ * 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.internal.soa.esb.services.registry;
+
+import org.jboss.internal.soa.esb.couriers.InVMCourier;
+import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
+
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * In VM registry.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class InVMRegistry implements Registry {
+
+ private Map<Service, List<RegsitryEntry>> regEntries = new ConcurrentHashMap<Service, List<RegsitryEntry>>();
+
+ public void registerEPR(String serviceCategoryName, String serviceName, String serviceDescription, EPR epr, String eprDescription) throws RegistryException {
+ if(serviceCategoryName == null) {
+ serviceCategoryName = "";
+ }
+ Service service = new Service(serviceCategoryName, serviceName);
+ RegsitryEntry regEntry = new RegsitryEntry(service, serviceDescription, epr, eprDescription);
+ List<RegsitryEntry> serviceEntries = getServiceEntries(service);
+
+ serviceEntries.add(regEntry);
+ }
+
+ public void unRegisterService(String category, String serviceName) throws RegistryException, ServiceNotFoundException {
+ unRegisterInVMService(category, serviceName);
+ }
+
+ protected boolean unRegisterInVMService(String category, String serviceName) throws RegistryException, ServiceNotFoundException {
+ if(category == null) {
+ category = "";
+ }
+ _unRegisterEPR(category, serviceName, null);
+ return (regEntries.remove(new Service(category, serviceName)) != null);
+ }
+
+ public void unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) throws RegistryException, ServiceNotFoundException {
+ _unRegisterEPR(serviceCategoryName, serviceName, epr);
+ }
+
+ private void _unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) {
+ if(serviceCategoryName == null) {
+ serviceCategoryName = "";
+ }
+ Service service = new Service(serviceCategoryName, serviceName);
+ List<RegsitryEntry> serviceEntries = getServiceEntries(service);
+ Iterator<RegsitryEntry> iterator = serviceEntries.iterator();
+
+ while (iterator.hasNext()) {
+ RegsitryEntry regsitryEntry = iterator.next();
+
+ if(epr == null || regsitryEntry.getEpr().getAddr().getAddress().equals(epr.getAddr().getAddress())) {
+ if(regsitryEntry.getEpr() instanceof InVMEpr) {
+ InVMCourier courier = CourierFactory.getInstance().getInVMCourier((InVMEpr)regsitryEntry.getEpr());
+ if(courier != null) {
+ courier.setActive(false);
+ }
+ }
+
+ iterator.remove();
+ }
+ }
+ }
+
+ public List<String> findAllServices() throws RegistryException {
+ return findServices(null);
+ }
+
+ public List<String> findServices(String serviceCategoryName) throws RegistryException {
+ Iterator<Service> iterator = regEntries.keySet().iterator();
+ List<String> services = new ArrayList<String>();
+
+ while (iterator.hasNext()) {
+ Service service = iterator.next();
+ if(serviceCategoryName == null || service.getCategory().equals(serviceCategoryName)) {
+ services.add(service.getName());
+ }
+ }
+
+ return services;
+ }
+
+ public List<EPR> findEPRs(String serviceCategoryName, String serviceName) throws RegistryException, ServiceNotFoundException {
+ if(serviceCategoryName == null) {
+ serviceCategoryName = "";
+ }
+ List<EPR> eprs = new ArrayList<EPR>();
+ Service service = new Service(serviceCategoryName, serviceName);
+ List<RegsitryEntry> serviceEntries = getServiceEntries(service);
+
+ for (RegsitryEntry serviceEntry : serviceEntries) {
+ eprs.add(serviceEntry.getEpr());
+ }
+
+ return eprs;
+ }
+
+ public EPR findEPR(String serviceCategoryName, String serviceName) throws RegistryException, ServiceNotFoundException {
+ if(serviceCategoryName == null) {
+ serviceCategoryName = "";
+ }
+ List<EPR> eprs = findEPRs(serviceCategoryName, serviceName);
+
+ if(!eprs.isEmpty()) {
+ return eprs.get(0);
+ } else {
+ return null;
+ }
+ }
+
+ private synchronized List<RegsitryEntry> getServiceEntries(Service service) {
+ List<RegsitryEntry> serviceEntries = null; // = regEntries.get(service);
+ Set<Map.Entry<Service, List<RegsitryEntry>>> entries = regEntries.entrySet();
+
+ for (Map.Entry<Service, List<RegsitryEntry>> entry : entries) {
+ if(entry.getKey().equals(service)) {
+ serviceEntries = entry.getValue();
+ break;
+ }
+ }
+
+ if(serviceEntries == null) {
+ serviceEntries = new ArrayList<RegsitryEntry>();
+ regEntries.put(service, serviceEntries);
+ }
+
+ return serviceEntries;
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/InVMRegistry.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRConnectionFactory.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRConnectionFactory.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRConnectionFactory.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -22,6 +22,8 @@
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.ConfigurationException;
import javax.xml.registry.Connection;
import javax.xml.registry.ConnectionFactory;
@@ -45,11 +47,21 @@
private Set<PasswordAuthentication> creds = new HashSet<PasswordAuthentication>();
private Properties props = new Properties();
- public JAXRConnectionFactory() {
+ public JAXRConnectionFactory() throws ConfigurationException {
props = new Properties();
+ if (Configuration.getRegistryQueryManageURI() == null) {
+ throw new ConfigurationException("ESB property '" + Environment.REGISTRY_QUERY_MANAGER_URI + "' not set. ESB properties load may have failed.");
+ }
+ if (Configuration.getRegistryLifecycleManagerURI() == null) {
+ throw new ConfigurationException("ESB property '" + Environment.REGISTRY_LIFECYCLE_MANAGER_URI + "' not set. ESB properties load may have failed.");
+ }
+ if (Configuration.getRegistryFactoryClass() == null) {
+ throw new ConfigurationException("ESB property '" + Environment.REGISTRY_FACTORY_CLASS + "' not set. ESB properties load may have failed.");
+ }
props.setProperty("javax.xml.registry.queryManagerURL", Configuration.getRegistryQueryManageURI());
props.setProperty("javax.xml.registry.lifeCycleManagerURL", Configuration.getRegistryLifecycleManagerURI());
props.setProperty("javax.xml.registry.factoryClass", Configuration.getRegistryFactoryClass());
+
if (Configuration.getRegistrySemanticEquivalences()!=null) {
props.setProperty("javax.xml.registry.semanticEquivalences", Configuration.getRegistrySemanticEquivalences());
}
@@ -67,8 +79,13 @@
}
String user = Configuration.getRegistryUser();
String password = Configuration.getRegistryPassword();
- PasswordAuthentication passwdAuth = new PasswordAuthentication(user, password.toCharArray());
- creds.add(passwdAuth);
+
+ if(user != null && password != null) {
+ PasswordAuthentication passwdAuth = new PasswordAuthentication(user, password.toCharArray());
+ creds.add(passwdAuth);
+ } else {
+ throw new ConfigurationException("ESB property '" + Environment.REGISTRY_USER + "' or '" + Environment.REGISTRY_PASSWORD + "' not set. ESB properties load may have failed.");
+ }
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -54,8 +54,9 @@
import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
import org.jboss.soa.esb.MarshalException;
import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
import org.jboss.soa.esb.services.registry.RegistryException;
import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
/**
@@ -65,13 +66,17 @@
*
* @author Kurt Stam
*/
-public class JAXRRegistryImpl implements Registry
+public class JAXRRegistryImpl extends InVMRegistry
{
private static Logger logger = Logger.getLogger(JAXRRegistryImpl.class);
- private JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
+ private JAXRConnectionFactory jaxrConnectionFactory;
private static Organization jbossESBOrganization;
- /**
+ public JAXRRegistryImpl() throws ConfigurationException {
+ jaxrConnectionFactory = new JAXRConnectionFactory();
+ }
+
+ /**
* Publish an EPR to the Registry
*/
protected Service registerService(String category, String serviceName, String serviceDescription) throws JAXRException
@@ -104,14 +109,25 @@
*/
@SuppressWarnings("unchecked")
public void unRegisterService(String category, String serviceName) throws RegistryException, ServiceNotFoundException{
-// first find the ServiceBindings for this service
+ // Make sure it's unregistered from the InVMRegistry...
+ boolean unregisteredFromInVMReg = false;
+
+ if(!isEmptyServiceName(category, serviceName)) {
+ unregisteredFromInVMReg = unRegisterInVMService(category, serviceName);
+ }
+
+ // first find the ServiceBindings for this service
Connection connection = jaxrConnectionFactory.getConnection();
Service service = null;
try {
service = findService(category, serviceName);
if (service==null) {
- throw new ServiceNotFoundException("No such EPR found for service with name = "
- + serviceName);
+ if(unregisteredFromInVMReg) {
+ // It's OK... it was unregistered from the InVMRegistry
+ return;
+ } else {
+ throw new ServiceNotFoundException("No such EPR found for service with name = " + serviceName);
+ }
}
RegistryService rs = connection.getRegistryService();
BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
@@ -130,92 +146,101 @@
public void registerEPR(String category, String serviceName, String serviceDescription, EPR epr, String eprDescription)
throws RegistryException
{
- Connection connection = jaxrConnectionFactory.getConnection();
- try {
- //Find the service
- Service service = findService(category,serviceName);
- if (service==null) {
- logger.log(Level.DEBUG, "Service " + serviceName + " does not yet exist, creating now..");
- service = registerService(category, serviceName, serviceDescription);
- }
+ if(epr instanceof InVMEpr) {
+ // Only register these EPRs in memory...
+ super.registerEPR(category, serviceName, serviceDescription, epr, eprDescription);
+ } else {
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ //Find the service
+ Service service = findService(category,serviceName);
+ if (service==null) {
+ logger.log(Level.DEBUG, "Service " + serviceName + " does not yet exist, creating now..");
+ service = registerService(category, serviceName, serviceDescription);
+ }
- RegistryService rs = connection.getRegistryService();
- BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
- BusinessQueryManager bqm = rs.getBusinessQueryManager();
- ServiceBinding serviceBinding = blm.createServiceBinding();
- serviceBinding.setDescription(blm.createInternationalString(eprDescription));
- String xml = EPRHelper.toXMLString(epr);
- serviceBinding.setAccessURI(xml);
-
- ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
- serviceBindings.add(serviceBinding);
- service.addServiceBindings(serviceBindings);
- Collection<String> findQualifiers = new ArrayList<String>();
- findQualifiers.add(FindQualifier.AND_ALL_KEYS);
- findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
- Classification classification = blm.createClassification(cScheme, "category", category);
- service.addClassification(classification);
-
- saveRegistryObject(serviceBinding, jaxrConnectionFactory);
- } catch (JAXRException je) {
- throw new RegistryException(je.getLocalizedMessage(), je);
- } catch (MarshalException me) {
- throw new RegistryException(me.getLocalizedMessage(), me);
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- }
+ RegistryService rs = connection.getRegistryService();
+ BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+ BusinessQueryManager bqm = rs.getBusinessQueryManager();
+ ServiceBinding serviceBinding = blm.createServiceBinding();
+ serviceBinding.setDescription(blm.createInternationalString(eprDescription));
+ String xml = EPRHelper.toXMLString(epr);
+ serviceBinding.setAccessURI(xml);
+
+ ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
+ serviceBindings.add(serviceBinding);
+ service.addServiceBindings(serviceBindings);
+ Collection<String> findQualifiers = new ArrayList<String>();
+ findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+ findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
+ ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
+ Classification classification = blm.createClassification(cScheme, "category", category);
+ service.addClassification(classification);
+
+ saveRegistryObject(serviceBinding, jaxrConnectionFactory);
+ } catch (JAXRException je) {
+ throw new RegistryException(je.getLocalizedMessage(), je);
+ } catch (MarshalException me) {
+ throw new RegistryException(me.getLocalizedMessage(), me);
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
+ }
/**
* Remove an EPR from the Registry
*/
public void unRegisterEPR(String category, String serviceName, EPR toBeDeletedEPR) throws RegistryException, ServiceNotFoundException{
- //first find the ServiceBindings for this service
- Connection connection = jaxrConnectionFactory.getConnection();
- Service service = null;
- try {
- service = findService(category, serviceName);
- if (service==null) {
- throw new ServiceNotFoundException("No such Service found for service with category= "
- + category + " and name = " + serviceName);
- }
- Collection serviceBindings = findServiceBindings(service);
- service.addServiceBindings(serviceBindings);
- for (Iterator i=serviceBindings.iterator();i.hasNext();){
- ServiceBinding serviceBinding = (ServiceBinding) i.next();
- String eprXML = serviceBinding.getAccessURI().trim();
- // for backwards compatibility still have the decoder if
- // unmarchalling fails
- try {
- EPR epr = EPRHelper.fromXMLString(eprXML);
- } catch (UnmarshalException unme) {
+ if(toBeDeletedEPR instanceof InVMEpr) {
+ super.unRegisterEPR(category, serviceName, toBeDeletedEPR);
+ } else {
+ //first find the ServiceBindings for this service
+ Connection connection = jaxrConnectionFactory.getConnection();
+ Service service = null;
+ try {
+ service = findService(category, serviceName);
+ if (service==null) {
+ throw new ServiceNotFoundException("No such Service found for service with category= "
+ + category + " and name = " + serviceName);
+ }
+ Collection serviceBindings = findServiceBindings(service);
+ service.addServiceBindings(serviceBindings);
+ for (Iterator i=serviceBindings.iterator();i.hasNext();){
+ ServiceBinding serviceBinding = (ServiceBinding) i.next();
+ String eprXML = serviceBinding.getAccessURI().trim();
+ // for backwards compatibility still have the decoder if
+ // unmarchalling fails
try {
- eprXML = URLDecoder.decode(eprXML, "UTF-8").trim();
- } catch (UnsupportedEncodingException ue) {
- logger.error(unme.getMessage(), unme);
- logger.error(ue.getMessage(), ue);
+ EPR epr = EPRHelper.fromXMLString(eprXML);
+ } catch (UnmarshalException unme) {
+ try {
+ eprXML = URLDecoder.decode(eprXML, "UTF-8").trim();
+ } catch (UnsupportedEncodingException ue) {
+ logger.error(unme.getMessage(), unme);
+ logger.error(ue.getMessage(), ue);
+ }
}
+ String toBeDeletedEPRXml = EPRHelper.toXMLString(toBeDeletedEPR).trim();
+ if (eprXML.equals(toBeDeletedEPRXml)) {
+ RegistryService rs = connection.getRegistryService();
+ BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+ Collection<Key> serviceBindingKeys = new ArrayList<Key>();
+ serviceBindingKeys.add(serviceBinding.getKey());
+ blm.deleteServiceBindings(serviceBindingKeys);
+ return;
+ }
}
- String toBeDeletedEPRXml = EPRHelper.toXMLString(toBeDeletedEPR).trim();
- if (eprXML.equals(toBeDeletedEPRXml)) {
- RegistryService rs = connection.getRegistryService();
- BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
- Collection<Key> serviceBindingKeys = new ArrayList<Key>();
- serviceBindingKeys.add(serviceBinding.getKey());
- blm.deleteServiceBindings(serviceBindingKeys);
- return;
- }
- }
- throw new RegistryException("No such EPR found for service with name = "
- + serviceName + " and EPR=" + toBeDeletedEPR);
- } catch (JAXRException je) {
- throw new RegistryException(je.getLocalizedMessage(), je);
- } catch (MarshalException me) {
- throw new RegistryException(me.getLocalizedMessage(), me);
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
+ throw new RegistryException("No such EPR found for service with name = "
+ + serviceName + " and EPR=" + toBeDeletedEPR);
+ } catch (JAXRException je) {
+ throw new RegistryException(je.getLocalizedMessage(), je);
+ } catch (MarshalException me) {
+ throw new RegistryException(me.getLocalizedMessage(), me);
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
}
- }
+ }
/**
* {@inheritDoc}
@@ -224,6 +249,10 @@
public List<String> findAllServices() throws RegistryException
{
List<String> serviceNames = new ArrayList<String>();
+
+ // Add the invm Services at the front of the list...
+ serviceNames.addAll(super.findAllServices());
+
try {
Collection services = getJBossESBOrganization().getServices();
for (Iterator i=services.iterator();i.hasNext();) {
@@ -243,7 +272,13 @@
public List<String> findServices(String category) throws RegistryException
{
List<String>serviceNames = new ArrayList<String>();
- try {
+
+ if(category != null && !category.trim().equals("")) {
+ // Add the invm Services at the front of the list...
+ serviceNames.addAll(super.findServices(category));
+ }
+
+ try {
Collection<Service>services = findServicesForCategory(category);
for (Iterator<Service> i=services.iterator();i.hasNext();) {
String serviceName = i.next().getName().getValue();
@@ -261,11 +296,21 @@
public List<EPR> findEPRs(String category, String serviceName) throws RegistryException, ServiceNotFoundException
{
List<EPR> eprs = new ArrayList<EPR>();
- Connection connection = jaxrConnectionFactory.getConnection();
+
+ if(!isEmptyServiceName(category, serviceName)) {
+ // Add the invm EPRs at the front of the list...
+ eprs.addAll(super.findEPRs(category, serviceName));
+ }
+
+ Connection connection = jaxrConnectionFactory.getConnection();
try {
Service service = findService(category, serviceName);
if (service==null){
- throw new ServiceNotFoundException("Could not find service with category=" + category + " and serviceName=" + serviceName);
+ if(eprs.isEmpty()) {
+ throw new ServiceNotFoundException("Could not find service with category=" + category + " and serviceName=" + serviceName);
+ } else {
+ return eprs;
+ }
}
// Get registry service and business query manager
Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
@@ -306,40 +351,48 @@
*/
public EPR findEPR(String category, String serviceName) throws RegistryException, ServiceNotFoundException
{
- EPR epr = null;
- Connection connection = jaxrConnectionFactory.getConnection();
- try {
- Service service = findService(category, serviceName);
- if (service==null){
- throw new ServiceNotFoundException("Could not find service with category=" + category + " and serviceName=" + serviceName);
- }
- // Get registry service and business query manager
- Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
- if (serviceBindings.iterator().hasNext()) {
- ServiceBinding serviceBinding = (ServiceBinding) serviceBindings.iterator().next();
- String eprXML = serviceBinding.getAccessURI();
- // for backwards compatibility still have the decoder if
- // unmarchalling fails
- try {
- epr = EPRHelper.fromXMLString(eprXML);
- } catch (UnmarshalException unme) {
+ EPR epr = null;
+
+ if(!isEmptyServiceName(category, serviceName)) {
+ epr = super.findEPR(category, serviceName);
+ }
+
+ if(epr == null) {
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ Service service = findService(category, serviceName);
+ if (service==null){
+ throw new ServiceNotFoundException("Could not find service with category=" + category + " and serviceName=" + serviceName);
+ }
+ // Get registry service and business query manager
+ Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
+ if (serviceBindings.iterator().hasNext()) {
+ ServiceBinding serviceBinding = (ServiceBinding) serviceBindings.iterator().next();
+ String eprXML = serviceBinding.getAccessURI();
+ // for backwards compatibility still have the decoder if
+ // unmarchalling fails
try {
- eprXML = URLDecoder.decode(eprXML, "UTF-8");
epr = EPRHelper.fromXMLString(eprXML);
- } catch (UnsupportedEncodingException ue) {
- logger.error(ue.getMessage(), ue);
- throw new UnmarshalException(ue.getMessage(), ue);
+ } catch (UnmarshalException unme) {
+ try {
+ eprXML = URLDecoder.decode(eprXML, "UTF-8");
+ epr = EPRHelper.fromXMLString(eprXML);
+ } catch (UnsupportedEncodingException ue) {
+ logger.error(ue.getMessage(), ue);
+ throw new UnmarshalException(ue.getMessage(), ue);
+ }
}
}
- }
- } catch (JAXRException je) {
- throw new RegistryException(je.getLocalizedMessage(), je);
- } catch (UnmarshalException me) {
- throw new RegistryException(me.getLocalizedMessage(), me);
- } finally {
- jaxrConnectionFactory.closeConnection(connection);
- }
- return epr;
+ } catch (JAXRException je) {
+ throw new RegistryException(je.getLocalizedMessage(), je);
+ } catch (UnmarshalException me) {
+ throw new RegistryException(me.getLocalizedMessage(), me);
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
+
+ return epr;
}
/**
@@ -667,6 +720,11 @@
jaxrConnectionFactory.closeConnection(connection);
}
}
+
+ private boolean isEmptyServiceName(String category, String serviceName) {
+ // This registry impl allows Service names (name and/or category) to be empty (which seems a bit risky!!)
+ return (category == null || serviceName == null || category.trim().equals("") || serviceName.trim().equals(""));
+ }
}
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/RegsitryEntry.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/RegsitryEntry.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/RegsitryEntry.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.services.registry;
+
+import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.addressing.EPR;
+
+/**
+ * Registry Entry.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class RegsitryEntry {
+
+ private Service service;
+ private String serviceDescription;
+ private EPR epr;
+ private String eprDescription;
+
+ public RegsitryEntry(Service service, String serviceDescription, EPR epr, String eprDescription) {
+ this.service = service;
+ this.serviceDescription = serviceDescription;
+ this.epr = epr;
+ this.eprDescription = eprDescription;
+ }
+
+ public Service getService() {
+ return service;
+ }
+
+ public String getServiceDescription() {
+ return serviceDescription;
+ }
+
+ public EPR getEpr() {
+ return epr;
+ }
+
+ public String getEprDescription() {
+ return eprDescription;
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/RegsitryEntry.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/InVMEpr.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/InVMEpr.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/InVMEpr.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,277 @@
+package org.jboss.soa.esb.addressing.eprs;
+
+/*
+ * 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
+ */
+
+/**
+ * This class represents the endpoint reference for services.
+ */
+
+import org.apache.commons.codec.binary.Hex;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * A helper class for using in-VM communication.
+ *
+ * EPR: invm://servicename[?lockstep[#waittime]]
+ *
+ * where lockstep can be either true or false and waittime is the lockstep wait
+ * time in milliseconds. If lockstep is false then any value specified for
+ * waittime will be ignored.
+ *
+ * e.g.,
+ *
+ * invm://myservice?true#20000 invm://myservice invm://myservice?false (same as
+ * invm://myservice)
+ *
+ * You can have a lockstep service, where the sender thread is tied to the one
+ * that does the execution (equivalent to the sender thread doing the work
+ * within the receiver), or non-lockstep, whereby the sender thread is decoupled
+ * from the receiver and works as fast as it needs to in order to deliver
+ * messages. This is roughly equivalent to CORBA POA threading policies. (Maybe
+ * we'll implement it that way at some point in the future?)
+ *
+ * @author marklittle
+ *
+ */
+
+public class InVMEpr extends EPR
+{
+ public static final long DEFAULT_LOCKSTEP_WAIT_TIME = 10000; // in
+
+ // millis,
+ // 10
+ // seconds
+
+ public static final String INVM_PROTOCOL = "invm";
+
+ public static final String LOCKSTEP_ENDPOINT_TAG = "lockstep";
+
+ public static final String LOCKSTEP_WAIT_TIME_TAG = "lockstepWait";
+
+ private boolean _lockstep = false;
+
+ private boolean _lockstepTime = false;
+
+ public InVMEpr(EPR epr)
+ {
+ setAddr(epr.getAddr());
+ }
+
+ public InVMEpr(EPR epr, Element header)
+ {
+ this(epr);
+
+ NodeList nl = header.getChildNodes();
+
+ for (int i = 0; i < nl.getLength(); i++)
+ {
+ try
+ {
+ String prefix = nl.item(i).getPrefix();
+ String tag = nl.item(i).getLocalName();
+
+ if ((prefix != null)
+ && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
+ {
+ if (tag != null)
+ {
+ if (tag.equals(LOCKSTEP_ENDPOINT_TAG))
+ {
+ getAddr().addExtension(LOCKSTEP_ENDPOINT_TAG, nl.item(i).getTextContent());
+ _lockstep = true;
+ }
+ if (tag.equals(LOCKSTEP_WAIT_TIME_TAG))
+ {
+ getAddr().addExtension(LOCKSTEP_WAIT_TIME_TAG, nl.item(i).getTextContent());
+ _lockstepTime = true;
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ }
+
+ public InVMEpr(URI uri) throws URISyntaxException
+ {
+ super(uri);
+
+ String serviceId = uri.getHost();
+ String lockstep = uri.getQuery();
+ String lockstepTime = uri.getFragment();
+
+ if (serviceId == null)
+ throw new URISyntaxException(uri.toString(),
+ "No serviceId specified!");
+
+ if ("true".equalsIgnoreCase(lockstep))
+ {
+ setLockstep(true);
+
+ if (lockstepTime != null)
+ {
+ try
+ {
+ setLockstepWaitTime(Long.parseLong(lockstepTime));
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ }
+ }
+
+ public String getServiceId()
+ {
+ try
+ {
+ return new URI(getAddr().getAddress()).getHost();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+
+ return null;
+ }
+ }
+
+ public void setServiceId(String serviceId)
+ {
+ if (serviceId == null)
+ throw new IllegalArgumentException();
+
+ getAddr().setAddress(INVM_PROTOCOL + "://" + serviceId);
+ }
+
+ public boolean getLockstep()
+ {
+ String lockstep = getAddr().getExtensionValue(LOCKSTEP_ENDPOINT_TAG);
+
+ if ("true".equalsIgnoreCase(lockstep))
+ return true;
+ else
+ return false;
+ }
+
+ public void setLockstep(boolean lockstep)
+ {
+ if (_lockstep)
+ throw new IllegalStateException("Lockstep already set!");
+
+ if (lockstep)
+ getAddr().addExtension(LOCKSTEP_ENDPOINT_TAG, "true");
+ else
+ getAddr().addExtension(LOCKSTEP_ENDPOINT_TAG, "false");
+
+ _lockstep = true;
+ }
+
+ public long getLockstepWaitTime()
+ {
+ String waitTime = getAddr().getExtensionValue(LOCKSTEP_WAIT_TIME_TAG);
+
+ if (waitTime != null)
+ {
+ try
+ {
+ return Long.parseLong(waitTime);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+ return DEFAULT_LOCKSTEP_WAIT_TIME;
+ }
+
+ public void setLockstepWaitTime(long waitTime)
+ {
+ if (_lockstepTime)
+ throw new IllegalStateException("Lockstep wait time already set!");
+
+ getAddr().addExtension(LOCKSTEP_WAIT_TIME_TAG, "" + waitTime);
+
+ _lockstepTime = true;
+ }
+
+ public String toString()
+ {
+ return "InVMEpr [ " + super.getAddr().extendedToString() + " ]";
+ }
+
+ /**
+ * Create an encoded service ID from the supplied Service Cat and Name.
+ * <p/>
+ * The result is a simple hex encoding of the concatenated strings and is
+ * usable in the InVMEpr URI i.e. is uneffected by slashes etc in the
+ * Cat and Service name strings.
+ *
+ * @param catagory The Service Category.
+ * @param name The Service name.
+ * @return Hex encoded string.
+ */
+ public static String createEncodedServiceId(String catagory, String name) {
+ AssertArgument.isNotNullAndNotEmpty(catagory, "catagory");
+ AssertArgument.isNotNullAndNotEmpty(name, "name");
+
+ byte[] bytes = (catagory.trim() + name.trim()).getBytes();
+
+ return new String(Hex.encodeHex(bytes));
+ }
+
+ public EPR copy() {
+ return new InVMEpr(this);
+ }
+
+ private static URI _type;
+
+ public static URI type()
+ {
+ return _type;
+ }
+
+ static
+ {
+ try
+ {
+ _type = new URI("urn:jboss/esb/epr/type/invm");
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+
+ throw new ExceptionInInitializerError(ex.toString());
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/InVMEpr.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/addressing/util/DefaultReplyTo.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/addressing/util/DefaultReplyTo.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/addressing/util/DefaultReplyTo.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -1,26 +1,16 @@
package org.jboss.soa.esb.addressing.util;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-
-import org.jboss.internal.soa.esb.addressing.eprs.DefaultFileReplyToEpr;
-import org.jboss.internal.soa.esb.addressing.eprs.DefaultFtpReplyToEpr;
-import org.jboss.internal.soa.esb.addressing.eprs.DefaultHibernateReplyToEpr;
-import org.jboss.internal.soa.esb.addressing.eprs.DefaultJdbcReplyToEpr;
-import org.jboss.internal.soa.esb.addressing.eprs.DefaultJmsReplyToEpr;
-import org.jboss.internal.soa.esb.addressing.eprs.DefaultSftpReplyToEpr;
+import org.jboss.internal.soa.esb.addressing.eprs.*;
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+import org.jboss.soa.esb.addressing.eprs.*;
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.message.Message;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+
/*
* JBoss, Home of Professional Open Source
* Copyright 2006, JBoss Inc., and others contributors as indicated
@@ -67,6 +57,8 @@
{
if (null == toEpr)
throw new IllegalArgumentException("toEpr must not be null");
+ if (toEpr instanceof InVMEpr)
+ return new DefaultInVMReplyToEpr((InVMEpr) toEpr);
if (toEpr instanceof JMSEpr)
return new DefaultJmsReplyToEpr((JMSEpr) toEpr);
// Check for SFTPEpr first, as it extends FTPEpr
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/common/Environment.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/common/Environment.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,8 +34,10 @@
/*
* Transport specific properties.
*/
-
- public static final String SMTP_HOST = "org.jboss.soa.esb.mail.smtp.host";
+
+ public static final String DEFAULT_INVM_SCOPE = "jboss.esb.invm.scope.default";
+
+ public static final String SMTP_HOST = "org.jboss.soa.esb.mail.smtp.host";
public static final String SMTP_USERNAME = "org.jboss.soa.esb.mail.smtp.user";
public static final String SMTP_PASSWORD = "org.jboss.soa.esb.mail.smtp.password";
public static final String SMTP_PORT = "org.jboss.soa.esb.mail.smtp.port";
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -31,16 +31,25 @@
package org.jboss.soa.esb.common;
-import java.util.Hashtable;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.FatalError;
-
+import com.arjuna.common.internal.util.propertyservice.PropertyManagerImpl;
import com.arjuna.common.internal.util.propertyservice.plugins.io.XMLFilePlugin;
import com.arjuna.common.util.exceptions.LoadPropertiesException;
import com.arjuna.common.util.propertyservice.PropertyManager;
import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.FatalError;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Hashtable;
+
/**
* The ESB configuration file is split into modules, each concerned with a
* specific capability. Each module may also depend upon another module. We use
@@ -178,7 +187,45 @@
}
}
- private static Hashtable<String, PropertyManager> managers = new Hashtable<String, PropertyManager>();
+ public static void configure(InputStream esbConfig) throws IOException, SAXException {
+ AssertArgument.isNotNull(esbConfig, "esbConfig");
+
+ // Clear all existing PropertyManager instances...
+ managers.clear();
+
+ // Add the new PropertyManager instances...
+ Document configDoc = YADOMUtil.parseStream(esbConfig, false, false);
+ NodeList propertiesList = configDoc.getElementsByTagName("properties");
+ for(int i = 0; i < propertiesList.getLength(); i++) {
+ Element properties = (Element) propertiesList.item(i);
+ String name = properties.getAttribute("name");
+ PropertyManager propertyManager = new PropertyManagerImpl(name);
+ NodeList propertyList = properties.getElementsByTagName("property");
+
+ addProperties(propertyList, propertyManager);
+ managers.put(name, propertyManager);
+ }
+ }
+
+ private static void addProperties(NodeList propertyList, PropertyManager propertyManager) {
+ for(int i = 0; i < propertyList.getLength(); i++) {
+ Element property = (Element) propertyList.item(i);
+ String name = property.getAttribute("name");
+ String value = property.getAttribute("value");
+
+ propertyManager.setProperty(name, value);
+ }
+ }
+
+ public static Hashtable<String, PropertyManager> getManagers() {
+ return managers;
+ }
+
+ public static void setManagers(Hashtable<String, PropertyManager> managers) {
+ ModulePropertyManager.managers = managers;
+ }
+
+ private static Hashtable<String, PropertyManager> managers = new Hashtable<String, PropertyManager>();
private static Logger _logger = Logger.getLogger(ModulePropertyManager.class);
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -29,12 +29,15 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.Map.Entry;
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl;
+import org.jboss.internal.soa.esb.couriers.InVMCourier;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
import org.jboss.soa.esb.lifecycle.LifecyclePriorities;
import org.jboss.soa.esb.lifecycle.LifecycleResource;
import org.jboss.soa.esb.lifecycle.LifecycleResourceException;
@@ -59,6 +62,13 @@
LifecyclePriorities.COURIER_PRIORITY) ;
/**
+ * InVM Couiers.
+ * <p/>
+ * We handle this
+ */
+ private final Map<String, InVMCourier> inVMCouriers = new ConcurrentHashMap<String, InVMCourier>();
+
+ /**
* Factory singleton instance.
*/
private static CourierFactory instance = new CourierFactory();
@@ -105,8 +115,14 @@
*/
public static Courier getCourier(EPR toEPR) throws CourierException, MalformedEPRException
{
- return getCourier(toEPR, null);
- }
+ if(toEPR instanceof InVMEpr) {
+ TwoWayCourierImpl courier = new TwoWayCourierImpl(CourierFactory.getInstance().getInVMCourier((InVMEpr) toEPR), null);
+ courier.setToEpr(toEPR);
+ return courier;
+ } else {
+ return getCourier(toEPR, null);
+ }
+ }
/**
* Obtain a courier which can perform pickups only and prime it with the "to address" (toEPR)
* and the "replyTo address" (replyToEPR).
@@ -117,9 +133,30 @@
*/
public static TwoWayCourier getPickupCourier(EPR replyToEPR) throws CourierException, MalformedEPRException
{
- return getCourier(null, replyToEPR);
- }
- /**
+ if(replyToEPR instanceof InVMEpr) {
+ TwoWayCourierImpl courier = new TwoWayCourierImpl(null, CourierFactory.getInstance().getInVMCourier((InVMEpr) replyToEPR));
+ courier.setReplyToEpr(replyToEPR);
+ return courier;
+ } else {
+ return getCourier(null, replyToEPR);
+ }
+ }
+
+ public synchronized InVMCourier getInVMCourier(InVMEpr epr) {
+ String address = epr.getAddr().getAddress();
+ InVMCourier courier = inVMCouriers.get(address);
+
+ if (courier == null) {
+ courier = new InVMCourier(epr);
+ inVMCouriers.put(address, courier);
+ }
+
+ courier.setActive(true);
+
+ return courier;
+ }
+
+ /**
* Obtain a courier which can perform both deliveries and pickups and prime it with
* the "to address" (toEPR) and the "replyTo address" (replyToEPR).
*
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -159,6 +159,14 @@
}
}
+ public static String getAttribute(Element element, String name, String defaultVal) {
+ if(element.hasAttribute(name)) {
+ return element.getAttribute(name);
+ } else {
+ return defaultVal;
+ }
+ }
+
/**
* Add an Element node to the supplied parent name.
* @param parent The parent to to which the new Element node is to be added.
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -26,6 +26,7 @@
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
+import java.net.URI;
import java.util.Properties;
import java.util.Set;
@@ -37,10 +38,7 @@
import org.jboss.soa.esb.client.ServiceInvoker;
import org.jboss.soa.esb.common.Configuration;
import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.addressing.eprs.*;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
import org.jboss.soa.esb.message.Message;
@@ -84,6 +82,8 @@
try
{
+ if (InVMEpr.INVM_PROTOCOL.equals(protocol))
+ return inVMEprFromElement(tree);
if ("jms".equals(protocol))
return jmsEprFromElement(tree);
if ("file".equals(protocol))
@@ -105,6 +105,31 @@
} // ________________________________
+ public static InVMEpr inVMEprFromElement (ConfigTree tree) throws ConfigurationException
+ {
+ try
+ {
+ String uriString = tree.getRequiredAttribute(ListenerTagNames.URL_TAG);
+ URI uri = new URI(uriString);
+ String protocol = uri.getScheme();
+
+ if (protocol.equals(InVMEpr.INVM_PROTOCOL))
+ {
+ return new InVMEpr(uri);
+ }
+ else
+ throw new ConfigurationException("Not an InVMEpr");
+ }
+ catch (URISyntaxException ex)
+ {
+ throw new ConfigurationException(ex);
+ }
+ catch (ConfigurationException ex)
+ {
+ throw ex;
+ }
+ }
+
public static JMSEpr jmsEprFromElement(ConfigTree tree)
throws ConfigurationException
{
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -25,6 +25,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
import org.jboss.soa.esb.dom.YADOMUtil;
import org.jboss.soa.esb.listeners.config.xbeanmodel.FsListenerDocument.FsListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel.FtpListenerDocument.FtpListener;
@@ -33,11 +34,10 @@
import org.jboss.soa.esb.listeners.config.xbeanmodel.ServiceDocument.Service;
import org.jboss.soa.esb.listeners.config.xbeanmodel.SqlListenerDocument.SqlListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel.ScheduledListenerDocument.ScheduledListener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.Listener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.JbrListenerDocument;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.GroovyListenerDocument;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.AbstractScheduledListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.*;
import org.jboss.soa.esb.listeners.config.mappers.*;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.message.MessageAwareListener;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -78,6 +78,15 @@
doc.appendChild(doc.createComment("\n\tNOTE: DO NOT MODIFY\n\tThis file was auto-generated.\n"));
root = YADOMUtil.addElement(doc, "jbossesb-listeners");
root.setAttribute("parameterReloadSecs", model.getParameterReloadSecs());
+
+ // Add an InVM listener for each service...
+ List<Service> services = model.getServices();
+ for (int i = 0; i < services.size(); i++) {
+ Service service = services.get(i);
+ if(Generator.exposesInVMListener(service)) {
+ addInVMListener(root, service, i);
+ }
+ }
// Iterate over all the ESB Aware listner configs and map them to the listener configuration...
List<Listener> listeners = model.getESBAwareListeners();
@@ -88,7 +97,29 @@
return doc;
}
- /**
+ private void addInVMListener(Element root, Service service, int serviceIndex) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "InVM-" + serviceIndex);
+ Element properties = listenerNode.getOwnerDocument().createElement("properties");
+
+ MapperUtil.mapListenerServiceAttributes(listenerNode, service, false);
+ listenerNode.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, MessageAwareListener.class.getName());
+ listenerNode.setAttribute(ListenerTagNames.MAX_THREADS_TAG, String.valueOf(1));
+
+ Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+ eprNode.setAttribute(ListenerTagNames.PROTOCOL_TAG, InVMEpr.INVM_PROTOCOL);
+
+ MapperUtil.mapProperties(service.getPropertyList(), properties);
+ eprNode.setAttribute(ListenerTagNames.URL_TAG, InVMEpr.INVM_PROTOCOL + "://"
+ + InVMEpr.createEncodedServiceId(service.getCategory(), service.getName())
+ + "?" + YADOMUtil.getAttribute(properties, "inVMLockStep", "false")
+ + "#" + YADOMUtil.getAttribute(properties, "inVMLockStepTimeout", "10000"));
+
+ YADOMUtil.removeEmptyAttributes(eprNode);
+
+ ActionMapper.map(listenerNode, service, model);
+ }
+
+ /**
* Add a single ESB Aware Listener configuration node to configuration root.
* @param root Configuration root node.
* @param listener The ESB Aware Listener configuration to be added.
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -21,6 +21,19 @@
package org.jboss.soa.esb.listeners.config;
+import org.apache.log4j.Logger;
+import org.apache.xmlbeans.XmlException;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.*;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.JbossesbDocument.Jbossesb;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.ScheduleProviderDocument.ScheduleProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.ServicesDocument.Services;
+import org.w3c.dom.Document;
+
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -30,17 +43,6 @@
import java.util.List;
import java.util.Properties;
-import org.apache.log4j.Logger;
-import org.apache.xmlbeans.XmlException;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.JbossesbDocument.Jbossesb;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.ServiceDocument.Service;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.ServicesDocument.Services;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.ScheduleProviderDocument.ScheduleProvider;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.*;
-import org.w3c.dom.Document;
-
/**
* ESB Configuration Generator.
* <p/>
@@ -72,7 +74,6 @@
private OutputStream listenerOutputStream;
-
public Generator(InputStream config, OutputStream listenerOutputStream, OutputStream gatewayOutputStream) throws ConfigurationException, IOException
{
this(config);
@@ -211,6 +212,17 @@
public XMLBeansModel getModel() {
return model;
}
+
+ public static boolean exposesInVMListener(Service service) {
+ if(service.xgetInvmScope() != null && service.xgetInvmScope().getStringValue() != null) {
+ return (service.xgetInvmScope().getStringValue().equals("GLOBAL"));
+ }
+
+ String systemDefaultScope = System.getProperty(Environment.DEFAULT_INVM_SCOPE, "GLOBAL");
+ String defaultScope = ModulePropertyManager.getPropertyManager("core").getProperty(Environment.DEFAULT_INVM_SCOPE, systemDefaultScope);
+
+ return defaultScope.equals("GLOBAL");
+ }
/**
* XMLBeans based model implementation.
@@ -363,17 +375,20 @@
for(Service service : services) {
boolean listenerAdded = false;
+ ListenersDocument.Listeners listeners = service.getListeners();
- for(Listener listener : service.getListeners().getListenerList()) {
- if(isGateway(listener) == isGateway) {
- gateways.add(listener);
- listenerAdded = true;
+ if(listeners != null) {
+ for(Listener listener : listeners.getListenerList()) {
+ if(isGateway(listener) == isGateway) {
+ gateways.add(listener);
+ listenerAdded = true;
+ }
}
- }
+ }
// Make sure each Service config has a message aware listener...
// http://jira.jboss.com/jira/browse/JBESB-648
- if(!isGateway && !listenerAdded) {
+ if(!exposesInVMListener(service) && !isGateway && !listenerAdded) {
throw new ConfigurationException("Service configuration for Service '" + service.getCategory() + ":" + service.getName() + "' doesn't define a Message-Aware Listener (i.e. is-gateway='false').");
}
}
@@ -381,7 +396,8 @@
return gateways;
}
- /**
+
+ /**
* Gets the setting for the number of seconds between reloads.
*
* @return The param reload seconds config value.
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -43,31 +43,43 @@
* Mapper utility methods.
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
*/
-abstract class MapperUtil {
+public abstract class MapperUtil {
/**
* Map all default listener attributes onto the target listener ConfigTree.
* @param listener The listener configuration instance.
- * @param target The target DOM ConfigTree listener element.
+ * @param listenerNode The target DOM ConfigTree listener element.
* @param model The model.
*/
- protected static void mapDefaultAttributes(Listener listener, Element target, XMLBeansModel model) {
- Service service = model.getService(listener);
-
- // Map maxThreads - appears to be a JMS only attrib...
- target.setAttribute(ListenerTagNames.MAX_THREADS_TAG, String.valueOf(listener.getMaxThreads()));
- target.setAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG, service.getDescription());
- if(listener.getIsGateway()) {
- target.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, service.getCategory());
- target.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service.getName());
- } else {
- target.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, service.getCategory());
- target.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, service.getName());
- if(!target.hasAttribute(ListenerTagNames.LISTENER_CLASS_TAG)) {
- target.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, MessageAwareListener.class.getName());
- }
+ protected static void mapDefaultAttributes(Listener listener, Element listenerNode, XMLBeansModel model) {
+ Service service = model.getService(listener);
+ boolean isGateway = listener.getIsGateway();
+
+ // Map maxThreads - appears to be a JMS only attrib...
+ listenerNode.setAttribute(ListenerTagNames.MAX_THREADS_TAG, String.valueOf(listener.getMaxThreads()));
+
+ mapListenerServiceAttributes(listenerNode, service, isGateway);
+ if (!isGateway && !listenerNode.hasAttribute(ListenerTagNames.LISTENER_CLASS_TAG)) {
+ listenerNode.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, MessageAwareListener.class.getName());
}
- }
+ }
+
+ /**
+ * Map the Service specific attributes onto the listener configuration.
+ * @param listenerNode The listener config node.
+ * @param service The Service details (from the model).
+ * @param isGateway True if the listener is a gateway, otherwise false.
+ */
+ public static void mapListenerServiceAttributes(Element listenerNode, Service service, boolean isGateway) {
+ listenerNode.setAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG, service.getDescription());
+ if (isGateway) {
+ listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, service.getCategory());
+ listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service.getName());
+ } else {
+ listenerNode.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, service.getCategory());
+ listenerNode.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, service.getName());
+ }
+ }
/**
* Map all the properties targeted at the supplied listener onto the target element.
@@ -93,7 +105,7 @@
* @param target The target DOM element.
* @param properties The properties to be mapped.
*/
- protected static void mapProperties(List<Property> properties, Element target) {
+ public static void mapProperties(List<Property> properties, Element target) {
// Map the property elements to actions attributes...
for(Property property : properties) {
Element propertyElement = target.getOwnerDocument().createElement("property");
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -43,6 +43,9 @@
singleton = registry;
}
+ public static Registry getRegistrySingleton() {
+ return singleton;
+ }
public static Registry getRegistry() throws RegistryException {
// no synchronized block as there should be a service that initializes this
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/build.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/build.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -137,8 +137,9 @@
<sysproperty key="org.jboss.esb.test.ftp.user" value="${org.jboss.esb.test.ftp.user}"/>
<sysproperty key="org.jboss.esb.test.ftp.pwd" value="${org.jboss.esb.test.ftp.pwd}"/>
<sysproperty key="org.jboss.esb.test.ftp.dir" value="${org.jboss.esb.test.ftp.dir}"/>
- <sysproperty key="org.jboss.esb.test.persistdb.dir" value="${org.jboss.esb.test.persistdb.dir}"/>
+ <sysproperty key="org.jboss.esb.test.persistdb.dir" value="${org.jboss.esb.test.persistdb.dir}"/>
<sysproperty key="log4j.configuration" value="log4j.xml"/>
+ <sysproperty key="jboss.esb.invm.scope.default" value="NONE"/>
</junit>
<junitreport>
<fileset dir="${org.jboss.esb.tests.report.dir}">
@@ -223,6 +224,7 @@
<sysproperty key="org.jboss.esb.test.ftp.dir" value="${org.jboss.esb.test.ftp.dir}"/>
<sysproperty key="org.jboss.esb.test.persistdb.dir" value="${org.jboss.esb.test.persistdb.dir}"/>
<sysproperty key="log4j.configuration" value="log4j.xml"/>
+ <sysproperty key="jboss.esb.invm.scope.default" value="NONE"/>
</junit>
<junitreport>
<fileset dir="${org.jboss.esb.tests.report.dir}">
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/InVMCourierUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/InVMCourierUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/InVMCourierUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,355 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers.tests;
+
+import junit.framework.Assert;
+import junit.framework.JUnit4TestAdapter;
+import org.jboss.internal.soa.esb.couriers.InVMCourier;
+import org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.Test;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+public class InVMCourierUnitTest {
+ public static junit.framework.Test suite() {
+ return new JUnit4TestAdapter(InVMCourierUnitTest.class);
+ }
+
+ @Test
+ public void testUnthreadedDeliver() throws Exception {
+ InVMEpr epr = new InVMEpr(new URI("invm://serviceid1"));
+ InVMCourier courier = new InVMCourier(epr);
+ Producer producer = new Producer(courier);
+ Consumer consumer = new Consumer(courier);
+
+ producer.run();
+ consumer.run();
+
+ Assert.assertEquals(true, consumer.valid());
+ }
+
+ @Test
+ public void testThreadedDeliver() throws Exception {
+ InVMEpr epr = new InVMEpr(new URI("invm://serviceid2"));
+ InVMCourier courier = new InVMCourier(epr);
+ Producer producer = new Producer(courier);
+ Consumer consumer = new Consumer(courier);
+
+ producer.start();
+ consumer.start();
+
+ try {
+ synchronized (consumer.condition()) {
+ consumer.condition().wait();
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ Assert.assertEquals(consumer.valid(), true);
+ }
+
+ @Test
+ public void testDelayedThreadedDeliver() throws Exception {
+ InVMEpr epr = new InVMEpr(new URI("invm://serviceid3"));
+ InVMCourier courier = new InVMCourier(epr);
+ Producer producer = new Producer(courier);
+ Consumer consumer = new Consumer(courier);
+
+ consumer.start();
+
+ try {
+ Thread.currentThread().sleep(500);
+ }
+ catch (Exception ex) {
+ }
+
+ producer.start();
+
+ try {
+ synchronized (consumer.condition()) {
+ consumer.condition().wait();
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ Assert.assertEquals(consumer.valid(), true);
+ }
+
+ @Test
+ public void testThreadedNullDeliver() throws Exception {
+ InVMEpr epr = new InVMEpr(new URI("invm://serviceid4"));
+ InVMCourier courier = new InVMCourier(epr);
+ Consumer consumer = new Consumer(courier);
+
+ consumer.start();
+
+ try {
+ Thread.currentThread().sleep(500);
+ }
+ catch (Exception ex) {
+ }
+
+ try {
+ synchronized (consumer.condition()) {
+ consumer.condition().wait();
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ Assert.assertEquals(consumer.valid(), false);
+ }
+
+ @Test
+ public void testLockstepDeliver() throws Exception {
+ InVMEpr epr = new InVMEpr(new URI("invm://serviceid5?true#2000"));
+ InVMCourier courier = new InVMCourier(epr);
+ Producer producer = new Producer(courier);
+ Consumer consumer = new Consumer(courier);
+
+ consumer.start();
+ producer.start();
+
+ try {
+ synchronized (consumer.condition()) {
+ consumer.condition().wait();
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ Assert.assertEquals(consumer.valid(), true);
+ }
+
+ @Test
+ public void test_single_Courier_Creation() throws URISyntaxException,
+ MalformedEPRException, CourierException {
+ InVMEpr epr = new InVMEpr(new URI("invm://serviceid5?true#2000"));
+ TwoWayCourierImpl courier1 = (TwoWayCourierImpl) CourierFactory
+ .getInstance().getCourier(epr);
+ TwoWayCourierImpl courier2 = (TwoWayCourierImpl) CourierFactory
+ .getInstance().getCourier(epr);
+
+ Assert.assertTrue(courier1.getDeliverCourier() == courier2
+ .getDeliverCourier());
+ Assert.assertTrue(courier1.getPickupCourier() == courier2
+ .getPickupCourier());
+ }
+
+ @Test
+ public void testLockstepMultiProducerPerformance() throws Exception {
+ InVMEpr epr = new InVMEpr(new URI("invm://serviceid5?true#2000"));
+ int iters = 1000;
+ int numberOfProducers = 50;
+ Producer[] producer = new Producer[numberOfProducers];
+ InVMCourier courier = new InVMCourier(epr);
+ Consumer consumer = new Consumer(courier, iters * numberOfProducers,
+ false);
+ long stime = System.currentTimeMillis();
+
+ for (int i = 0; i < numberOfProducers; i++)
+ producer[i] = new Producer(courier, iters, false);
+
+ consumer.start();
+
+ for (int j = 0; j < numberOfProducers; j++)
+ producer[j].start();
+
+ try {
+ synchronized (consumer.condition()) {
+ consumer.condition().wait();
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ long ftime = System.currentTimeMillis();
+ double factor = 1000.00 / (ftime - stime);
+ double msgsPerSecond = iters * factor * numberOfProducers;
+
+ if (!consumer.valid())
+ System.err.println("Completed " + consumer.itersCompleted());
+
+ Assert.assertEquals(consumer.valid(), true);
+
+ System.err.println("Time for " + iters * numberOfProducers
+ + " messages is " + (ftime - stime) + " milliseconds.");
+ System.err.println("Messages per second: " + msgsPerSecond);
+ }
+
+ /*
+ * test that WeakHashMap could be used to gc invmcouriers.
+ *
+ @Test
+ public void testFactory () throws Exception
+ {
+ int numberOfProducersConsumers = 100;
+
+ for (int i = 0; i < numberOfProducersConsumers; i++)
+ {
+ InVMEpr epr = new InVMEpr(new URI("invm://serviceid" + i
+ + "test"));
+
+ TwoWayCourierImpl courier = (TwoWayCourierImpl) InternalCourierFactory.getInstance().getCourier(epr);
+
+ Assert.assertNotNull(courier.getDeliverCourier());
+ Assert.assertNull(courier.getPickupCourier());
+ }
+
+ for (int j = 0; j < 10; j++)
+ System.gc(); // not guaranteed to work first time.
+
+ //Assert.assertEquals(CourierFactoryHelper.getInVMCourierInstanceCount(InternalCourierFactory.getInstance()), 0);
+ }*/
+
+ public static final int ITERATIONS = 10;
+}
+
+class Producer extends Thread {
+ public Producer(InVMCourier courier, int iters, boolean debug) {
+ this.courier = courier;
+ _iters = iters;
+ _debug = debug;
+ }
+
+ public Producer(InVMCourier courier) {
+ this(courier, InVMCourierUnitTest.ITERATIONS, true);
+ }
+
+ public void run() {
+ try {
+ int number = 0;
+ int iterations = _iters;
+
+ while (number < iterations) {
+ Message msg = MessageFactory.getInstance().getMessage();
+
+ msg.getBody().add(new String("Message: " + number++));
+
+ courier.deliver(msg);
+
+ if (_debug)
+ System.err.println("Delivered " + msg);
+
+ Thread.yield();
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ courier = null;
+ }
+
+ private InVMCourier courier;
+
+ private int _iters;
+
+ private boolean _debug;
+}
+
+class Consumer extends Thread {
+ public Consumer(InVMCourier courier) {
+ this(courier, InVMCourierUnitTest.ITERATIONS, true);
+ }
+
+ public Consumer(InVMCourier courier, int iters, boolean debug) {
+ this.courier = courier;
+ _iters = iters;
+ _debug = debug;
+ }
+
+ public Object condition() {
+ return _condition;
+ }
+
+ public void run() {
+ try {
+ int i;
+
+ if (_debug)
+ System.out.println("Consumer Iters: " + _iters);
+
+ for (i = 0; i < _iters; i++) {
+ Message msg = courier.pickup(2000);
+
+ if (_debug)
+ System.err.println("Received: " + msg);
+
+ if (msg == null)
+ return;
+ else
+ Thread.yield();
+ }
+
+ if (i == _iters)
+ _valid = true;
+
+ _itersCompleted = i;
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ finally {
+ synchronized (condition()) {
+ condition().notify();
+ }
+ }
+
+ courier = null;
+ }
+
+ public int itersCompleted() {
+ return _itersCompleted;
+ }
+
+ public boolean valid() {
+ return _valid;
+ }
+
+ private InVMCourier courier;
+
+ private boolean _valid = false;
+
+ private int _iters;
+
+ private boolean _debug;
+
+ private int _itersCompleted = 0;
+
+ private Object _condition = new Object();
+}
\ No newline at end of file
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/InVMCourierUnitTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.services.registry;
+
+import junit.framework.TestCase;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
+
+import java.net.URI;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class InVMRegistryUnitTest extends TestCase {
+
+ public void test() throws ServiceNotFoundException, RegistryException {
+ InVMRegistry reg = new InVMRegistry();
+
+ assertNull(reg.findEPR("x", "y"));
+
+ reg.registerEPR("x", "y", "blah", new EPR(URI.create("x://123")), "blah");
+ assertEquals(1, reg.findEPRs("x", "y").size());
+ assertEquals("x://123", reg.findEPR("x", "y").getAddr().getAddress());
+
+ reg.registerEPR("x", "y", "blah", new EPR(URI.create("x://1234")), "blah");
+ assertEquals(2, reg.findEPRs("x", "y").size());
+
+ reg.registerEPR("a", "z", "blah", new EPR(URI.create("x://12345")), "blah");
+ assertEquals(2, reg.findEPRs("x", "y").size());
+ assertEquals(1, reg.findEPRs("a", "z").size());
+
+ assertEquals(2, reg.findAllServices().size());
+ assertEquals(1, reg.findServices("x").size());
+
+ // unreg using a valid service, but unregistred EPR... make sure nothing changes...
+ reg.unRegisterEPR("a", "z", new EPR(URI.create("x://1")));
+ assertEquals(1, reg.findEPRs("a", "z").size());
+ // unreg using a valid service + registred EPR... make sure EPR is removed...
+ reg.unRegisterEPR("a", "z", new EPR(URI.create("x://12345")));
+ assertEquals(0, reg.findEPRs("a", "z").size());
+
+ // unreg all for the service
+ assertEquals(2, reg.findEPRs("x", "y").size());
+ reg.unRegisterService("x", "y");
+ assertEquals(0, reg.findEPRs("x", "y").size());
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryUnitTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -26,6 +26,7 @@
import java.io.File;
import java.io.InputStream;
+import java.io.IOException;
import java.sql.DriverManager;
import java.sql.Statement;
import java.util.ArrayList;
@@ -56,6 +57,7 @@
import org.jboss.soa.esb.testutils.FileUtil;
import org.jboss.soa.esb.testutils.HsqldbUtil;
import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.jboss.soa.esb.ConfigurationException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -78,8 +80,7 @@
* Tests the successful creation of the RED HAT/JBossESB Organization.
*/
@Test
- public void publishOrganization()
- {
+ public void publishOrganization() throws ConfigurationException {
JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
try {
Organization org = JAXRRegistryImpl.createJBossESBOrganization(jaxrConnectionFactory);
@@ -91,8 +92,7 @@
}
}
@Test
- public void findOrganization()
- {
+ public void findOrganization() throws ConfigurationException {
JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
try {
Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
@@ -116,8 +116,7 @@
*
*/
@Test
- public void publishService()
- {
+ public void publishService() throws ConfigurationException {
try {
JAXRRegistryImpl registry = new JAXRRegistryImpl();
registry.registerService("registry", "Registry Test ServiceName", "Registry Test Service Description");
@@ -127,8 +126,7 @@
}
}
@Test
- public void publishServiceBinding()
- {
+ public void publishServiceBinding() throws ConfigurationException {
try {
EPR epr = new EPR();
JAXRRegistryImpl registry = new JAXRRegistryImpl();
@@ -151,8 +149,7 @@
* @throws Exception
*/
@Test
- public void findServicesForAnOrganization()
- {
+ public void findServicesForAnOrganization() throws ConfigurationException {
JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
try {
Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
@@ -188,8 +185,7 @@
* We're ignoring this test until I come up with a patch.
*
*/
- public void findServicesByClassification()
- {
+ public void findServicesByClassification() throws ConfigurationException {
JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
Connection connection = jaxrConnectionFactory.getConnection();
try {
@@ -226,14 +222,9 @@
public static void runBeforeAllTests() throws Exception {
try {
TestEnvironmentUtil.setESBPropertiesFileToUse();
- //Set the juddi properties file in System so juddi will pick it up later and use the test values.
- String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-unittest.properties";
- System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
- //Read this properties file to get the db connection string
- Properties props = new Properties();
- InputStream inStream = Class.class.getResourceAsStream(juddiPropertiesFile);
- props.load(inStream);
- mDbDriver = props.getProperty("juddi.jdbcDriver");
+ Properties props = getJuddiProperties();
+
+ mDbDriver = props.getProperty("juddi.jdbcDriver");
mDbUrl = props.getProperty("juddi.jdbcUrl");
mDbUsername = props.getProperty("juddi.jdbcUsername");
mDbPassword = props.getProperty("juddi.jdbcPassword");
@@ -275,7 +266,8 @@
assertTrue(false);
}
}
- /**
+
+ /**
* Shutdown the database
* @throws Exception
*/
@@ -286,8 +278,19 @@
}
}
- public static junit.framework.Test suite() {
+ public static junit.framework.Test suite() {
return new JUnit4TestAdapter(JAXRRegistryUnitTest.class);
}
+ private static Properties getJuddiProperties() throws IOException {
+ //Set the juddi properties file in System so juddi will pick it up later and use the test values.
+ String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-unittest.properties";
+ System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
+ //Read this properties file to get the db connection string
+ Properties props = new Properties();
+ InputStream inStream = Class.class.getResourceAsStream(juddiPropertiesFile);
+ props.load(inStream);
+ return props;
+ }
+
}
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java.bak
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java.bak (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java.bak 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,219 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.services.registry;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.InputStream;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Properties;
+
+import javax.xml.registry.BulkResponse;
+import javax.xml.registry.BusinessLifeCycleManager;
+import javax.xml.registry.BusinessQueryManager;
+import javax.xml.registry.Connection;
+import javax.xml.registry.JAXRException;
+import javax.xml.registry.RegistryService;
+import javax.xml.registry.infomodel.Classification;
+import javax.xml.registry.infomodel.ClassificationScheme;
+import javax.xml.registry.infomodel.Organization;
+import javax.xml.registry.infomodel.Service;
+import javax.xml.registry.infomodel.ServiceBinding;
+import javax.xml.registry.infomodel.User;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.MarshalException;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Testing the registry.
+ *
+ * @author kstam
+ *
+ */
+public class JAXRRegistryUnitTest
+{
+ private static Logger logger = Logger.getLogger(JAXRRegistryUnitTest.class);
+ /**
+ * Tests the successful creation of the RED HAT/JBossESB Organization.
+ */
+ @Test
+ public void publishOrganization() throws ConfigurationException {
+ JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
+ try {
+ Organization org = JAXRRegistryImpl.createJBossESBOrganization(jaxrConnectionFactory);
+ logger.debug("Succesfully created organization: " + org.getName().getValue());
+ assertEquals("Red Hat/JBossESB", org.getName().getValue());
+ } catch (JAXRException je) {
+ logger.debug(je.getLocalizedMessage(), je);
+ assertTrue(false);
+ }
+ }
+ @Test
+ public void findOrganization() throws ConfigurationException {
+ JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
+ try {
+ Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
+ logger.debug("Succesfully created organization: " + org.getName().getValue());
+ assertEquals("Red Hat/JBossESB", org.getName().getValue());
+ } catch (JAXRException je) {
+ logger.debug(je.getLocalizedMessage(), je);
+ assertTrue(false);
+ }
+ try {
+ Organization org = JAXRRegistryImpl.findOrganization("Not Existing Org", jaxrConnectionFactory);
+ logger.debug("Could not find non-existing organization.");
+ assertEquals(null, org);
+ } catch (JAXRException je) {
+ logger.error(je.getLocalizedMessage(), je);
+ assertTrue(false);
+ }
+ }
+ /**
+ * Tests the successful registration of a Service.
+ *
+ */
+ @Test
+ public void publishService() throws JAXRException, ConfigurationException {
+ JAXRRegistryImpl registry = new JAXRRegistryImpl();
+ registry.registerService("registry", "Registry Test ServiceName", "Registry Test Service Description");
+ }
+
+ @Test
+ public void publishServiceBinding() throws ConfigurationException, RegistryException {
+ EPR epr = new EPR();
+ JAXRRegistryImpl registry = new JAXRRegistryImpl();
+ registry.registerEPR("registry", "Registry Test ServiceName", "Registry Test Service Description",
+ epr, "EPR description");
+ registry.registerEPR("registry", "Registry Test ServiceName", "Registry Test Service Description",
+ epr, "EPR description");
+ try {
+ registry.unRegisterEPR("registry", "Registry Test ServiceName", epr);
+ } catch (ServiceNotFoundException snfe) {
+ logger.warn("Failed to find Service for unregistering.", snfe);
+ }
+ }
+
+ /**
+ * Queries the newly added information
+ * @throws Exception
+ */
+ @Test
+ public void findServicesForAnOrganization() throws ConfigurationException, JAXRException, MarshalException {
+ JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
+ Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
+ //Listing out the services and their Bindings
+ logger.debug("-------------------------------------------------");
+ logger.debug("Organization name: " + org.getName().getValue());
+ logger.debug("Description: " + org.getDescription().getValue());
+ logger.debug("Key id: " + org.getKey().getId());
+ User primaryContact = org.getPrimaryContact();
+ logger.debug("Primary Contact: " + primaryContact.getPersonName().getFullName());
+ Collection services = org.getServices();
+ for (Iterator serviceIter = services.iterator();serviceIter.hasNext();) {
+ Service service = (Service) serviceIter.next();
+ logger.debug("- Service Name: " + service.getName().getValue());
+ logger.debug(" Service Key : " + service.getKey().getId());
+ Collection serviceBindings = service.getServiceBindings();
+ for (Iterator serviceBindingIter = serviceBindings.iterator();serviceBindingIter.hasNext();){
+ ServiceBinding serviceBinding = (ServiceBinding) serviceBindingIter.next();
+ logger.debug(" ServiceBinding Description: " + serviceBinding.getDescription().getValue());
+ String xml = serviceBinding.getAccessURI();
+ logger.debug(" ServiceBinding URI: " + xml);
+ assertEquals(EPRHelper.toXMLString(new EPR()).trim(),xml.trim());
+ }
+ }
+ logger.debug("-------------------------------------------------");
+ }
+ /**
+ * This doesn't work because scout drops the classifications on the floor.
+ * We're ignoring this test until I come up with a patch.
+ *
+ */
+ public void findServicesByClassification() throws ConfigurationException, JAXRException {
+ JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ // Get registry service and business query manager
+ RegistryService rs = connection.getRegistryService();
+ BusinessQueryManager bqm = rs.getBusinessQueryManager();
+ BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+ ClassificationScheme classificationScheme = bqm.findClassificationSchemeByName(null, "uddi-org:general_keywords");
+ Classification classification = blm.createClassification(classificationScheme,
+ "Test transformation service", "transformation");
+ Collection<Classification> classifications = new ArrayList<Classification>();
+ classifications.add(classification);
+ //Here I'd like to test filtering by this classification, but scout ignored the classification
+ String name=classificationScheme.getName().getValue();
+ logger.debug("Name=" + name);
+ Collection<String> nameParams = new ArrayList<String>();
+ //The name of the service is wild
+ nameParams.add("%");
+ BulkResponse bs = bqm.findServices(null, null,nameParams,classifications, null);
+ int status = bs.getStatus();
+ logger.debug("status=" + status);
+ }
+ finally{
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
+ /**
+ * Setup the database.
+ * @throws Exception
+ */
+ @BeforeClass
+ public static void runBeforeAllTests() throws Exception {
+ MockRegistry.installJAXR();
+ }
+ /**
+ * Shutdown the database
+ * @throws Exception
+ */
+ @AfterClass
+ public static void runAfterAllTests() throws Exception {
+ MockRegistry.uninstallJAXR();
+ }
+
+ public static junit.framework.Test suite() {
+ return new JUnit4TestAdapter(JAXRRegistryUnitTest.class);
+ }
+
+}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -31,8 +31,10 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.services.registry.RegistryException;
import org.jboss.soa.esb.testutils.ESBConfigUtil;
+import org.xml.sax.SAXException;
import java.util.Map;
+import java.io.IOException;
/**
* Tests for JBESB-1201 re timeout management.
@@ -79,7 +81,7 @@
initaliseServices();
}
- private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
+ private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException, IOException, SAXException {
ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -30,8 +30,10 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.services.registry.RegistryException;
import org.jboss.soa.esb.testutils.ESBConfigUtil;
+import org.xml.sax.SAXException;
import java.util.List;
+import java.io.IOException;
/**
* Tests for JBESB-1204 and JBESB-1331 re aggrgation tag infos.
@@ -75,7 +77,7 @@
initaliseServices();
}
- private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
+ private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException, IOException, SAXException {
ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -95,7 +95,7 @@
initaliseServices();
}
- private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
+ private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException, IOException, SAXException {
ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-02.xml"));
ConfigTree splitter1Config = esbConfig.getActionConfig("null-listener", "splitter1-action");
ConfigTree splitter2Config = esbConfig.getActionConfig("null-listener", "splitter2-action");
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/InVMUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/InVMUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/InVMUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,82 @@
+/*
+ * 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.addressing.helpers.tests;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
+
+/**
+ * Unit tests for the InVM EPR class.
+ *
+ * @author Mark Little
+ */
+
+public class InVMUnitTest extends TestCase
+{
+
+ public void testConstructor ()
+ {
+ try
+ {
+ new InVMEpr(new URI("invm://myservice?true#1234"));
+ }
+ catch (Exception ex)
+ {
+ fail(ex.toString());
+ }
+ }
+
+ public void testSetGet ()
+ {
+ try
+ {
+ InVMEpr em = new InVMEpr(new URI("invm://myservice?true#1234"));
+
+ assertEquals(em.getServiceId(), "myservice");
+ assertEquals(em.getLockstep(), true);
+ assertEquals(em.getLockstepWaitTime(), 1234);
+
+ em = new InVMEpr(new URI("invm://myservice"));
+
+ assertEquals(em.getServiceId(), "myservice");
+ assertEquals(em.getLockstep(), false);
+ assertEquals(em.getLockstepWaitTime(), InVMEpr.DEFAULT_LOCKSTEP_WAIT_TIME);
+ }
+ catch (Exception ex)
+ {
+ fail(ex.toString());
+ }
+ }
+
+ public void test_getEncodedServiceId() throws URISyntaxException {
+ String serviceId = InVMEpr.createEncodedServiceId("Service Cat / &&&", " Service / Name $$");
+ assertEquals("5365727669636520436174202f2026262653657276696365202f204e616d65202424", serviceId);
+
+ InVMEpr epr = new InVMEpr(new URI(InVMEpr.INVM_PROTOCOL + "://" + serviceId));
+ assertEquals("5365727669636520436174202f2026262653657276696365202f204e616d65202424", epr.getServiceId());
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/InVMUnitTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/InVMListenerUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/InVMListenerUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/InVMListenerUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,207 @@
+/*
+ * 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.listeners;
+
+import junit.framework.TestCase;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.couriers.FaultMessageException;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.mock.MockAction;
+import org.jboss.soa.esb.parameters.ParamRepositoryException;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.ESBConfigUtil;
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class InVMListenerUnitTest extends TestCase {
+
+ protected void setUp() throws Exception {
+ System.setProperty(Environment.DEFAULT_INVM_SCOPE, "GLOBAL");
+ }
+
+ protected void tearDown() throws Exception {
+ System.setProperty(Environment.DEFAULT_INVM_SCOPE, "NONE");
+ }
+
+ public void test_async() throws IOException, SAXException, ConfigurationException, ManagedLifecycleException, ParamRepositoryException, MessageDeliverException {
+ ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("in-listener-config-01.xml"));
+
+ esbConfig.setESBProperties(getClass().getResourceAsStream("jbossesb-properties-01.xml"));
+ try {
+ esbConfig.installRegistry();
+ try {
+ esbConfig.startController();
+
+ ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "ServiceName");
+ Message message = MessageFactory.getInstance().getMessage();
+
+ message.getBody().add("Hi there!");
+ invoker.deliverAsync(message);
+
+ sleep(50);
+ assertEquals(message, MockAction.message);
+
+ esbConfig.stopController();
+ } finally {
+ esbConfig.uninstallRegistry();
+ }
+ } finally {
+ esbConfig.resetESBProperties();
+ }
+ }
+
+ public void test_sync() throws IOException, SAXException, ConfigurationException, ManagedLifecycleException, ParamRepositoryException, MessageDeliverException, RegistryException, FaultMessageException {
+ ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("in-listener-config-01.xml"));
+
+ esbConfig.setESBProperties(getClass().getResourceAsStream("jbossesb-properties-01.xml"));
+ try {
+ esbConfig.installRegistry();
+ try {
+ esbConfig.startController();
+
+ ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "ServiceName");
+ Message message = MessageFactory.getInstance().getMessage();
+
+ message.getBody().add("Hi there!");
+ Message response = invoker.deliverSync(message, 2000);
+
+ assertEquals(message, MockAction.message);
+ assertEquals(message, response);
+
+ esbConfig.stopController();
+ } finally {
+ esbConfig.uninstallRegistry();
+ }
+ } finally {
+ esbConfig.resetESBProperties();
+ }
+ }
+
+ public void test_sync_multithreaded() throws IOException, SAXException, ConfigurationException, ManagedLifecycleException, ParamRepositoryException, MessageDeliverException, RegistryException, FaultMessageException {
+ ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("in-listener-config-03.xml"));
+
+ esbConfig.setESBProperties(getClass().getResourceAsStream("jbossesb-properties-01.xml"));
+ try {
+ esbConfig.installRegistry();
+ try {
+ esbConfig.startController();
+
+ ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "ServiceName");
+ ClientInvokerThread[] clients = new ClientInvokerThread[10];
+
+ // Create the clients...
+ for (int i = 0; i < clients.length; i++) {
+ clients[i] = new ClientInvokerThread(invoker);
+ }
+
+ // Start the clients...
+ for (int i = 0; i < clients.length; i++) {
+ clients[i].start();
+ }
+
+ // Wait for the clients to be "done"...
+ boolean allNotDone = true;
+ while(allNotDone) {
+ sleep(100);
+ allNotDone = false;
+ for (int i = 0; i < clients.length; i++) {
+ if(!clients[i].done) {
+ allNotDone = true;
+ break;
+ }
+ }
+ }
+
+ // Check were there any assertion failures...
+ for (int i = 0; i < clients.length; i++) {
+ if(clients[i].thrown != null) {
+ fail("Thread " + i + " was in error: " + clients[i].thrown.getMessage());
+ }
+ }
+
+ esbConfig.stopController();
+ } finally {
+ esbConfig.uninstallRegistry();
+ }
+ } finally {
+ esbConfig.resetESBProperties();
+ }
+ }
+
+ private class ClientInvokerThread extends Thread {
+
+ private ServiceInvoker invoker = null;
+ private boolean done = false;
+ private Throwable thrown;
+
+ private ClientInvokerThread(ServiceInvoker invoker) {
+ this.invoker = invoker;
+ }
+
+ public void run() {
+ try {
+ for(int i = 0; i < 50; i++) {
+ Message message = MessageFactory.getInstance().getMessage();
+ Message response = null;
+
+ try {
+ response = invoker.deliverSync(message, 5000);
+ } catch (Exception e) {
+ fail("Error delivering message: " + e.getMessage());
+ }
+ assertEquals(message, response);
+ assertEquals("Tom Fennelly", response.getBody().get());
+
+ InVMListenerUnitTest.sleep(10);
+ }
+ } catch(Throwable t) {
+ this.thrown = t;
+ } finally {
+ done = true;
+ }
+ }
+ }
+
+ public void test_none_scoped() throws ManagedLifecycleException, SAXException, ParamRepositoryException, MessageDeliverException, IOException {
+ try {
+ new ESBConfigUtil(getClass().getResourceAsStream("in-listener-config-02.xml"));
+ fail("Expected ConfigurationException");
+ } catch (ConfigurationException e) {
+ assertEquals("Service configuration for Service 'ServiceCat:ServiceName' doesn't define a Message-Aware Listener (i.e. is-gateway='false').", e.getMessage());
+ }
+ }
+
+ private static void sleep(long millis) {
+ try {
+ Thread.sleep(millis);
+ } catch (InterruptedException e) {
+ fail("Unexpected InterruptedException exception.");
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/InVMListenerUnitTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.InputStream;
+import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
@@ -135,76 +136,66 @@
}
}
- protected void runBeforeAllTests()
- {
- try
- {
- TestEnvironmentUtil.setESBPropertiesFileToUse("product",
- "../product");
- // Set the juddi properties file in System so juddi will pick it up
- // later and use the test values.
- String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/juddi-unittest.properties";
- System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
- // Read this properties file to get the db connection string
- Properties props = new Properties();
- InputStream inStream = Class.class
- .getResourceAsStream(juddiPropertiesFile);
+ protected void runBeforeAllTests() throws Exception {
+ TestEnvironmentUtil.setESBPropertiesFileToUse("product", "../product");
+ // Set the juddi properties file in System so juddi will pick it up
+ // later and use the test values.
+ String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/juddi-unittest.properties";
+ System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
+ // Read this properties file to get the db connection string
+ Properties props = new Properties();
+ InputStream inStream = Class.class
+ .getResourceAsStream(juddiPropertiesFile);
- props.load(inStream);
- mDbDriver = props.getProperty("juddi.jdbcDriver");
- mDbUrl = props.getProperty("juddi.jdbcUrl");
- mDbUsername = props.getProperty("juddi.jdbcUsername");
- mDbPassword = props.getProperty("juddi.jdbcPassword");
+ props.load(inStream);
+ mDbDriver = props.getProperty("juddi.jdbcDriver");
+ mDbUrl = props.getProperty("juddi.jdbcUrl");
+ mDbUsername = props.getProperty("juddi.jdbcUsername");
+ mDbPassword = props.getProperty("juddi.jdbcPassword");
- String database = "not tested yet";
- if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
- {
- database = "hsqldb";
- // Bring up hsql on default port 9001
- HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
- "product", "../product")
- + "/build/hsqltestdb", "juddi");
- }
- else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
- {
- database = "mysql";
- } // add and test your own database..
+ String database = "not tested yet";
+ if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
+ {
+ database = "hsqldb";
+ // Bring up hsql on default port 9001
+ HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
+ "product", "../product")
+ + "/build/hsqltestdb", "juddi");
+ }
+ else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
+ {
+ database = "mysql";
+ } // add and test your own database..
- // Get the registry-schema create scripts
- String sqlDir = TestEnvironmentUtil.getUserDir("product",
- "../product")
- + "/install/jUDDI-registry/sql/" + database + "/";
- // Drop what is there now, if exists. We want to start fresh.
- String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
- + "drop_database.sql")).replaceAll("\\$\\{prefix}", "");
- String resource = "juddi-sql/" + database + "/create_database.sql";
- InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
- String sqlCreateCmd = FileUtil.readStream(is).trim().replaceAll("\\$\\{prefix}", "");
- String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
- + "import.sql")).trim().replaceAll("\\$\\{prefix}", "");
+ // Get the registry-schema create scripts
+ String sqlDir = TestEnvironmentUtil.getUserDir("product",
+ "../product")
+ + "/install/jUDDI-registry/sql/" + database + "/";
+ // Drop what is there now, if exists. We want to start fresh.
+ String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
+ + "drop_database.sql")).replaceAll("\\$\\{prefix}", "");
+ String resource = "juddi-sql/" + database + "/create_database.sql";
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
+ String sqlCreateCmd = FileUtil.readStream(is).trim().replaceAll("\\$\\{prefix}", "");
+ String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
+ + "import.sql")).trim().replaceAll("\\$\\{prefix}", "");
- try
- {
- Class.forName(mDbDriver);
- }
- catch (Exception e)
- {
- log.error("ERROR: failed to load " + database
- + " JDBC driver.", e);
- return;
- }
- con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
- Statement stmnt = con.createStatement();
- stmnt.execute(sqlDropCmd);
- stmnt.execute(sqlCreateCmd);
- stmnt.execute(sqlInsertPubCmd);
- stmnt.close();
- }
- catch (Throwable e)
- {
- log.error("We should stop testing, since we don't have a db.", e);
- assertTrue(false);
- }
+ try
+ {
+ Class.forName(mDbDriver);
+ }
+ catch (Exception e)
+ {
+ log.error("ERROR: failed to load " + database
+ + " JDBC driver.", e);
+ return;
+ }
+ con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
+ Statement stmnt = con.createStatement();
+ stmnt.execute(sqlDropCmd);
+ stmnt.execute(sqlCreateCmd);
+ stmnt.execute(sqlInsertPubCmd);
+ stmnt.close();
}
protected final void runAfterAllTests()
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -67,8 +67,7 @@
+ " FINISHED ____________________");
}
- public void setUp()
- {
+ public void setUp() throws Exception {
_logger.info("Writing temp files to " + TMP_DIR);
clearMessages() ;
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -47,8 +47,7 @@
_file = "listenerJdbc.xml";
}
- public void setUp()
- {
+ public void setUp() throws Exception {
_logger.info("Writing temp files to " + TMP_DIR);
clearMessages() ;
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -53,8 +53,7 @@
_file = configFile;
}
- public void setUp()
- {
+ public void setUp() throws Exception {
_logger.info("Writing temp files to " + TMP_DIR);
clearMessages() ;
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -33,8 +33,7 @@
@SuppressWarnings("unused")
private Logger log = Logger.getLogger( RegistryUtilUnitTest.class );
- public void setUp()
- {
+ public void setUp() throws Exception {
runBeforeAllTests();
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ScheduledListenerUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ScheduledListenerUnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ScheduledListenerUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -22,6 +22,7 @@
import static org.junit.Assert.assertEquals;
import java.io.UnsupportedEncodingException;
+import java.io.IOException;
import junit.framework.JUnit4TestAdapter;
@@ -42,7 +43,7 @@
public class ScheduledListenerUnitTest {
@Test
- public void test() throws UnsupportedEncodingException {
+ public void test() throws IOException, SAXException, ConfigurationException {
ESBConfigUtil configUtil = new ESBConfigUtil(ScheduledListenerUnitTest.class.getResourceAsStream("scheduled-listener-config.xml"));
String actualListenerConfig = configUtil.getListenerConfig("simple-schedule-listener").toXml();
String expectedListenerConfig = StreamUtils.readStreamString(getClass().getResourceAsStream("scheduled-listener-config-configtree.xml"), "UTF-8");
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/SetPayloadAction.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/SetPayloadAction.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/SetPayloadAction.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,39 @@
+/*
+ Milyn - Copyright (C) 2006
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License (version 2.1) as published by the Free Software
+ Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Lesser General Public License for more details:
+ http://www.gnu.org/licenses/lgpl.txt
+*/
+package org.jboss.soa.esb.listeners;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.ConfigurationException;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class SetPayloadAction extends AbstractActionPipelineProcessor {
+
+ private String payload;
+
+ public SetPayloadAction(ConfigTree config) throws ConfigurationException {
+ payload = config.getRequiredAttribute("payload");
+ }
+
+ public Message process(Message message) throws ActionProcessingException {
+ message.getBody().add(payload);
+ return message;
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/SetPayloadAction.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-01.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-01.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-01.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,12 @@
+<?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">
+
+ <services>
+ <service category="ServiceCat" name="ServiceName" description="Test Service">
+ <actions mep="RequestResponse">
+ <action name="action" class="org.jboss.soa.esb.mock.MockAction" />
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
\ No newline at end of file
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-01.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-02.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-02.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-02.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,12 @@
+<?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">
+
+ <services>
+ <service category="ServiceCat" name="ServiceName" description="Test Service" invmScope="NONE">
+ <actions>
+ <action name="action" class="org.jboss.soa.esb.mock.MockAction" />
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
\ No newline at end of file
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-02.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-03.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-03.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-03.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,14 @@
+<?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">
+
+ <services>
+ <service category="ServiceCat" name="ServiceName" description="Test Service">
+ <actions mep="RequestResponse">
+ <action name="action" class="org.jboss.soa.esb.listeners.SetPayloadAction">
+ <property name="payload" value="Tom Fennelly" />
+ </action>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
\ No newline at end of file
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/in-listener-config-03.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/jbossesb-properties-01.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/jbossesb-properties-01.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/jbossesb-properties-01.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,86 @@
+<?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.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
+ <property name="org.jboss.soa.esb.jndi.server.pkg.prefix" value=""/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.registry.local.PublishService#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.LocalTransport"/>
+ </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">
+ <!-- connection manager type -->
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ <!-- property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/ -->
+
+ <!-- this property is only used if using the j2ee connection manager -->
+ <property name="org.jboss.soa.esb.persistence.db.datasource.name" value="java:/JBossesbDS"/>
+
+ <!-- standalone connection pooling settings -->
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/juddi"/>
+ <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"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/jbossesb-properties-01.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/schedule/SchedulingUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/schedule/SchedulingUnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/schedule/SchedulingUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -51,7 +51,7 @@
MockAction.message = null;
}
- public void test_listener_config() throws UnsupportedEncodingException {
+ public void test_listener_config() throws IOException, SAXException, ConfigurationException {
ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream("config-01.xml"));
String expected = StreamUtils.readStreamString(getClass().getResourceAsStream("expected-config-01-listener.xml"), "UTF-8");
@@ -124,7 +124,12 @@
}
private void runTestConfig(String configName, long upTime) throws ParamRepositoryException, ConfigurationException, ManagedLifecycleException, SAXException, InterruptedException {
- ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream(configName));
+ ESBConfigUtil configUtil = null;
+ try {
+ configUtil = new ESBConfigUtil(getClass().getResourceAsStream(configName));
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
configUtil.startController();
Thread.sleep(upTime);
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -19,30 +19,34 @@
*/
package org.jboss.soa.esb.testutils;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import junit.framework.TestCase;
-
+import com.arjuna.common.util.propertyservice.PropertyManager;
import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+import org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import org.jboss.soa.esb.dom.YADOMUtil;
import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.config.ConfigurationController;
import org.jboss.soa.esb.listeners.config.Generator;
-import org.jboss.soa.esb.listeners.config.ConfigurationController;
import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
import org.jboss.soa.esb.parameters.ParamRepositoryException;
-import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.Registry;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
-import javax.jms.JMSException;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Hashtable;
+import java.sql.SQLException;
/**
* Utility class for working with the ESB configuration.
@@ -55,24 +59,90 @@
private Document listenerConfig;
private Document gatewayConfig;
private ManagedLifecycleController controller;
+ private boolean installMockCourierFactory = true;
+ private boolean installMockRegistry = true;
+ private Hashtable<String, PropertyManager> originalPropertyManagers;
+ private Registry originalRegistry;
- public ESBConfigUtil(InputStream esbXsdConfig) {
+ public ESBConfigUtil(InputStream esbXsdConfig) throws IOException, ConfigurationException, SAXException {
AssertArgument.isNotNull(esbXsdConfig, "esbXsdConfig");
ByteArrayOutputStream listenerConfigStream = new ByteArrayOutputStream();
ByteArrayOutputStream gatewayConfigStream = new ByteArrayOutputStream();
generator = null;
+ generator = new Generator(esbXsdConfig, listenerConfigStream, gatewayConfigStream);
+ generator.generate();
+ listenerConfig = YADOMUtil.parseStream(new ByteArrayInputStream(listenerConfigStream.toByteArray()), false, false);
+ gatewayConfig = YADOMUtil.parseStream(new ByteArrayInputStream(gatewayConfigStream.toByteArray()), false, false);
+ }
+
+ public void setESBProperties(InputStream esbProperties) throws IOException, ConfigurationException, SAXException {
+ originalPropertyManagers = (Hashtable<String, PropertyManager>) ModulePropertyManager.getManagers().clone();
+ ModulePropertyManager.configure(esbProperties);
+ }
+
+ public void resetESBProperties() {
+ if(originalPropertyManagers != null) {
+ // The ModulePropertyManager uses statics, so other tests (to
+ // follow) may be unwittingly dependent on its state. We reset
+ // it back to what it was here...
+ ModulePropertyManager.setManagers(originalPropertyManagers);
+ originalPropertyManagers = null;
+ }
+ }
+
+ public void installRegistry() {
+ originalRegistry = RegistryFactory.getRegistrySingleton();
+ Registry newRegistry = null;
try {
- generator = new Generator(esbXsdConfig, listenerConfigStream, gatewayConfigStream);
- generator.generate();
- listenerConfig = YADOMUtil.parseStream(new ByteArrayInputStream(listenerConfigStream.toByteArray()), false, false);
- gatewayConfig = YADOMUtil.parseStream(new ByteArrayInputStream(gatewayConfigStream.toByteArray()), false, false);
- } catch(Exception e) {
- e.printStackTrace();
- TestCase.fail(e.getMessage());
+ newRegistry = RegistryFactory.createRegistry();
+ RegistryFactory.setRegistry(newRegistry);
+ } catch (RegistryException e) {
+ throw new RuntimeException("Failed to create registry instance.", e);
}
+
+ if(newRegistry instanceof JAXRRegistryImpl) {
+ try {
+ TestEnvironmentUtil.startJAXRDatabase();
+ } catch (SQLException e) {
+ throw new RuntimeException("Failed to start JAXR Database.", e);
+ }
+ installMockCourierFactory = false;
+ installMockRegistry = false;
+ }
}
+ public void uninstallRegistry() {
+ try {
+ Registry currentRegistry = RegistryFactory.getRegistrySingleton();
+ if(currentRegistry instanceof JAXRRegistryImpl) {
+ try {
+ TestEnvironmentUtil.stopJAXRDatabase();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to stop JAXR Database.", e);
+ }
+ }
+ } finally {
+ RegistryFactory.setRegistry(originalRegistry);
+ }
+ }
+
+ public boolean isInstallMockCourierFactory() {
+ return installMockCourierFactory;
+ }
+
+ public void setInstallMockCourierFactory(boolean installMockCourierFactory) {
+ this.installMockCourierFactory = installMockCourierFactory;
+ }
+
+ public boolean isInstallMockRegistry() {
+ return installMockRegistry;
+ }
+
+ public void setInstallMockRegistry(boolean installMockRegistry) {
+ this.installMockRegistry = installMockRegistry;
+ }
+
public ConfigTree getListenerConfig(String listenerName) {
AssertArgument.isNotNull(listenerName, "listenerName");
return ConfigTree.fromElement(getListenerConfig(listenerName, listenerConfig));
@@ -124,11 +194,19 @@
}
public void startController() throws ParamRepositoryException, ConfigurationException, ManagedLifecycleException, SAXException {
+ if(controller != null) {
+ throw new RuntimeException("Sorry, this ESBConfigUtil instance has already been started/used. You cannot restart!");
+ }
+
ConfigTree listenerConfigTree = ConfigTree.fromElement(listenerConfig.getDocumentElement());
ConfigTree gatewayConfigTree = ConfigTree.fromElement(gatewayConfig.getDocumentElement());
- MockCourierFactory.install();
- MockRegistry.install();
+ if(installMockCourierFactory) {
+ MockCourierFactory.install();
+ }
+ if(installMockRegistry) {
+ MockRegistry.install();
+ }
controller = ConfigurationController.startController(generator.getModel(), listenerConfigTree, gatewayConfigTree);
}
@@ -138,9 +216,17 @@
ConfigurationController.stopController(controller);
} finally {
try {
- MockRegistry.uninstall();
+ try {
+ if(installMockRegistry) {
+ MockRegistry.uninstall();
+ }
+ } finally {
+ if(installMockCourierFactory) {
+ MockCourierFactory.uninstall();
+ }
+ }
} finally {
- MockCourierFactory.uninstall();
+ resetESBProperties();
}
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -1,12 +1,14 @@
package org.jboss.soa.esb.testutils;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-
+import junit.framework.TestCase;
import org.apache.log4j.Logger;
+import java.io.*;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.util.Properties;
+
public class TestEnvironmentUtil
{
private static Logger log = Logger.getLogger(TestEnvironmentUtil.class);
@@ -83,7 +85,7 @@
String jbossesbPropertiesFile = getUserDir(eclipseDir, antDir) + "/etc/test/resources/jbossesb-unittest-properties.xml";
System.setProperty("org.jboss.soa.esb.propertyFile", jbossesbPropertiesFile);
}
-
+
public static String readTextFile(File file) throws IOException
{
StringBuffer sb = new StringBuffer(1024);
@@ -112,5 +114,94 @@
}
return null;
}
-
+
+ public static void startJAXRDatabase() throws SQLException {
+ Properties props = getJuddiProperties();
+
+ String mDbDriver = props.getProperty("juddi.jdbcDriver");
+ String mDbUrl = props.getProperty("juddi.jdbcUrl");
+ String mDbUsername = props.getProperty("juddi.jdbcUsername");
+ String mDbPassword = props.getProperty("juddi.jdbcPassword");
+
+ String database="not tested yet";
+ if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
+ database = "hsqldb";
+ //Bring up hsql on default port 9001
+ try {
+ HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build/hsqltestdb", "juddi");
+ } catch (Exception e) {
+ TestCase.fail("Failed to start HSQLDB: " + e.getMessage());
+ }
+ } else if ("com.mysql.jdbc.Driver".equals(mDbDriver)) {
+ database = "mysql";
+ } //add and test your own database..
+
+ //Get the registry-schema create scripts
+ String sqlDir = TestEnvironmentUtil.getUserDir() + "install/jUDDI-registry/sql/" + database + "/";
+ //Drop what is there now, if exists. We want to start fresh.
+ String sqlDropCmd = null;
+ try {
+ sqlDropCmd = FileUtil.readTextFile(new File(sqlDir + "drop_database.sql")).replaceAll("\\$\\{prefix}", "");
+ } catch (IOException e) {
+ TestCase.fail("Failed to read drop_database.sql: " + e.getMessage());
+ }
+ String resource = "juddi-sql/" + database + "/create_database.sql";
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
+ String sqlCreateCmd = null;
+ try {
+ sqlCreateCmd = FileUtil.readStream(is).trim().replaceAll("\\$\\{prefix}", "");
+ } catch (IOException e) {
+ TestCase.fail("Failed to read create_database.sql: " + e.getMessage());
+ }
+ String sqlInsertPubCmd = null;
+ try {
+ sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir + "import.sql")).trim().replaceAll("\\$\\{prefix}", "");
+ } catch (IOException e) {
+ TestCase.fail("Failed to read import.sql: " + e.getMessage());
+ }
+
+ try {
+ Class.forName(mDbDriver);
+ } catch (Exception e) {
+ TestCase.fail("ERROR: failed to load " + database + " JDBC driver: " + e.getMessage());
+ return;
+ }
+ java.sql.Connection con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
+ Statement stmnt = con.createStatement();
+ System.out.println("Dropping the schema if exist");
+ stmnt.execute(sqlDropCmd);
+ System.out.println("Creating the juddi-schema");
+ stmnt.execute(sqlCreateCmd);
+ System.out.println("Adding the jbossesb publisher");
+ stmnt.execute(sqlInsertPubCmd);
+
+ }
+
+ public static void stopJAXRDatabase() throws Exception {
+ Properties props = getJuddiProperties();
+
+ String mDbDriver = props.getProperty("juddi.jdbcDriver");
+ String mDbUrl = props.getProperty("juddi.jdbcUrl");
+ String mDbUsername = props.getProperty("juddi.jdbcUsername");
+ String mDbPassword = props.getProperty("juddi.jdbcPassword");
+
+ if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
+ HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
+ }
+ }
+
+ private static Properties getJuddiProperties() {
+ //Set the juddi properties file in System so juddi will pick it up later and use the test values.
+ String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-unittest.properties";
+ System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
+ //Read this properties file to get the db connection string
+ Properties props = new Properties();
+ InputStream inStream = Class.class.getResourceAsStream(juddiPropertiesFile);
+ try {
+ props.load(inStream);
+ } catch (IOException e) {
+ TestCase.fail("Failed to load juddi properties.");
+ }
+ return props;
+ }
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -4,13 +4,16 @@
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.testutils.ESBConfigUtil;
+import org.xml.sax.SAXException;
+import java.io.IOException;
+
/**
* @author
*/
public class ESBConfigUtilUnitTest extends TestCase {
- public void test() throws ConfigurationException {
+ public void test() throws ConfigurationException, IOException, SAXException {
ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream("jboss-esb.xml"));
assertTrue(configUtil.getListenerConfig("JMS-ESBListener").toString().startsWith("<JMS-ESBListener listenerClass=\"org.jboss.soa.esb.listeners.message.MessageAwareListener\" maxThreads=\"1\" service-category=\"ABI_OrderManager\" service-description=\"ABI OrderManager Service\" service-name=\"ABI_OrderManager\">"));
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/aggregator/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/aggregator/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/aggregator/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration1/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration1/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration1/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration2/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration2/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration2/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration3/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration3/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration3/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/bpm_orchestration4/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/business_rules_service/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/business_rules_service/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/business_rules_service/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/business_service/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/business_service/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/business_service/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/custom_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/custom_action/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/custom_action/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/deadletter/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/deadletter/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/deadletter/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/dynamic_router/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/dynamic_router/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/dynamic_router/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/exceptions_faults/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/exceptions_faults/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/exceptions_faults/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/fun_cbr/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/fun_cbr/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/fun_cbr/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/groovy_gateway/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/groovy_gateway/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/groovy_gateway/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_action/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_action/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_db_registration/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_db_registration/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_db_registration/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_file_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_file_action/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_file_action/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_file_notifier/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_file_notifier/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_file_notifier/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_ftp_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_ftp_action/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_ftp_action/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_sql_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_sql_action/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_sql_action/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_topic_notifier/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/build.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/build.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,20 @@
+<project name="Quickstart_INVM_Transport_01" default="runtest" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="runtest" depends="compile"
+ description="sends a JMS message to the ESB">
+ <echo>Runs Test JMS Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.invm.test.SendJMSMessage" failonerror="true">
+ <arg value="Hello InVM Transport!!"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+</project>
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/deployment.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/deployment.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/deployment.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,4 @@
+<jbossesb-deployment>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_invm_action_Request</depends>
+</jbossesb-deployment>
+
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/deployment.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbm-queue-service.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,9 @@
+<?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_invm_action_Request"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbm-queue-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbmq-queue-service.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,9 @@
+<?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_invm_action_Request">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jbmq-queue-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jboss-esb.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jboss-esb.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,48 @@
+<?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">
+
+ <jms-bus busid="quickstartGwChannel">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_invm_action_Request"/>
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+
+ <!-- Set the invmScope attribute to "GLOBAL". Make "GLOBAL" the default in the ESB properties file! -->
+ <service category="HelloWorld" name="Service1" description="Service 1" invmScope="GLOBAL">
+ <listeners>
+ <!-- So we just need to define a Gateway to the service... -->
+ <jms-listener name="JMS-Gateway" busidref="quickstartGwChannel" maxThreads="1" is-gateway="true"/>
+ </listeners>
+ <actions>
+ <action name="println" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value=" - > Service 1"/>
+ </action>
+
+ <!-- Route to the "Service 2" -->
+ <action name="routeAction" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="HelloWorld" service-name="Service2"/>
+ </property>
+ </action>
+ </actions>
+ </service>
+
+ <service category="HelloWorld" name="Service2" description="Service 2" invmScope="GLOBAL">
+ <!-- Don't need to define any listeners for local InVM services... -->
+ <actions>
+ <action name="println" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value=" - - > Service 2"/>
+ </action>
+ </actions>
+ </service>
+
+ </services>
+
+</jbossesb>
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jboss-esb.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jndi.properties
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jndi.properties (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jndi.properties 2008-04-17 15:31:52 UTC (rev 19607)
@@ -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
+
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/jndi.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/juddi.properties
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/juddi.properties (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/juddi.properties 2008-04-17 15:31:52 UTC (rev 19607)
@@ -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
+
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/juddi.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/listener.log
===================================================================
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/log4j.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/log4j.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/log4j.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/log4j.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/readme.txt
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/readme.txt (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/readme.txt 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,27 @@
+Overview:
+=========
+ This Quickstart Demonstrates the InVM Transport.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run standalone mode:
+=======================
+ 1. In a command terminal window in the quickstart folder type
+ 'ant deploy-jms-dests'.
+ 2. In a command terminal window in this folder ("Window1"), type 'ant run'.
+ 3. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 4. Switch back to "Window1" to see the output from the ESB
+ 5. When finished, interrupt the ESB using Ctrl-C and, in this folder
+ ("Window1"), type 'ant undeploy-jms-dests'.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 3. Switch back to Application Server console to see the output from the ESB
+ 4. In this folder ("Window1"), type 'ant undeploy'.
\ No newline at end of file
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/samples/quickstart/invm/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/samples/quickstart/invm/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/samples/quickstart/invm/test/SendJMSMessage.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -0,0 +1,76 @@
+/*
+ * 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.invm.test;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_invm_action_Request");
+ 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();
+
+ }
+
+}
\ No newline at end of file
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/invm_transport1/src/org/jboss/soa/esb/samples/quickstart/invm/test/SendJMSMessage.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/jms_secured/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/jms_secured/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/jms_secured/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/jms_transacted/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/load_generator/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/load_generator/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/load_generator/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/messagefilter/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/messagefilter/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/messagefilter/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/messagestore/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/messagestore/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/messagestore/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/native_client/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/native_client/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/native_client/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/recipient_list/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/recipient_list/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/recipient_list/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/scheduled_services/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/scheduled_services/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/scheduled_services/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/scripting_groovy/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/scripting_groovy/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/scripting_groovy/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/simple_cbr/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/simple_cbr/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/simple_cbr/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_aop/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_aop/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_aop/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_helloworld/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_helloworld/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_helloworld/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_jpetstore/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_jpetstore/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/spring_jpetstore/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/static_router/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/static_router/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/static_router/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -18,8 +18,7 @@
<services>
- <service category="QuickstartTransformCSV" name="SimpleListener"
- description="Hello World">
+ <service category="QuickstartTransformCSV" name="SimpleListener" description="Hello World">
<listeners>
<jms-listener name="CSVJMS-Gateway" busidref="quickstartCSVGwChannel" maxThreads="1" is-gateway="true"/>
<jms-listener name="CSVquickstart" busidref="quickstartCSVEsbChannel" maxThreads="1" />
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_CSV2XML/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_CSV2XML/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_CSV2XML/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2POJO/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2POJO/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2POJO/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2POJO2/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2POJO2/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2POJO2/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2XML_date_manipulation/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2XML_date_manipulation/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2XML_date_manipulation/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2XML_simple/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2XML_simple/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/transform_XML2XML_simple/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/two_servers/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/two_servers/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/two_servers/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/webservice_consumer1/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/webservice_consumer1/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/webservice_consumer1/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/webservice_consumer2/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/webservice_consumer2/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/webservice_consumer2/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/wiretap/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/wiretap/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/quickstarts/wiretap/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/trailblazer/esb/conf/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/trailblazer/esb/conf/jbossesb-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/samples/trailblazer/esb/conf/jbossesb-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/base-project-build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/base-project-build.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/base-project-build.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -123,6 +123,7 @@
<!-- emma jvm args -->
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma" />
<sysproperty key="log4j.configuration" value="log4j.xml"/>
+ <sysproperty key="jboss.esb.invm.scope.default" value="NONE"/>
</junit>
<junitreport>
<fileset dir="build/tests/report">
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/jbossesb/src/test/java/org/jboss/soa/esb/persistence/tests/ScheduledRedeliveryUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/jbossesb/src/test/java/org/jboss/soa/esb/persistence/tests/ScheduledRedeliveryUnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/jbossesb/src/test/java/org/jboss/soa/esb/persistence/tests/ScheduledRedeliveryUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -21,6 +21,7 @@
import java.io.File;
import java.io.UnsupportedEncodingException;
+import java.io.IOException;
import java.net.URI;
import java.sql.Connection;
import java.sql.Statement;
@@ -72,7 +73,7 @@
public class ScheduledRedeliveryUnitTest{
@Test
- public void test_listener_config() throws UnsupportedEncodingException {
+ public void test_listener_config() throws IOException, SAXException, ConfigurationException {
ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream("config-01.xml"));
String config = configUtil.getListenerConfig("simple-schedule-listener").toString();
assertNotNull(config);
@@ -112,7 +113,7 @@
}
}
- private void runTestConfig(String configName, long upTime) throws ParamRepositoryException, ConfigurationException, ManagedLifecycleException, SAXException, InterruptedException {
+ private void runTestConfig(String configName, long upTime) throws ParamRepositoryException, ConfigurationException, ManagedLifecycleException, SAXException, InterruptedException, IOException {
ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream(configName));
configUtil.startController();
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/jbossesb/src/test/resources/jbossesb-unittest-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/jbossesb/src/test/resources/jbossesb-unittest-properties.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/jbossesb/src/test/resources/jbossesb-unittest-properties.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -34,6 +34,7 @@
<property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
<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"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soap/base-project-build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soap/base-project-build.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soap/base-project-build.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -103,6 +103,7 @@
<pathelement location="src/test/java"/>
</classpath>
<sysproperty key="log4j.configuration" value="log4j.xml"/>
+ <sysproperty key="jboss.esb.invm.scope.default" value="NONE"/>
<test name="${testcase}" if="testcase"/>
<batchtest unless="testcase" todir="build/test/report">
<fileset dir="build/test/classes" includes="**/*Test.class"/>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/SOAPClientUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/SOAPClientUnitTest.java 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/SOAPClientUnitTest.java 2008-04-17 15:31:52 UTC (rev 19607)
@@ -1,6 +1,7 @@
package org.jboss.soa.esb.actions.soap;
import java.util.Map;
+import java.io.IOException;
import junit.framework.TestCase;
@@ -12,14 +13,19 @@
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
+import org.xml.sax.SAXException;
/**
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
*/
public class SOAPClientUnitTest extends TestCase {
- private ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream("soapclient-config-01.xml"));
+ private ESBConfigUtil configUtil;
+ public SOAPClientUnitTest() throws IOException, SAXException, ConfigurationException {
+ configUtil = new ESBConfigUtil(getClass().getResourceAsStream("soapclient-config-01.xml"));
+ }
+
public void test_XStream_ResponseProcessing() throws ConfigurationException, ActionProcessingException {
ConfigTree actionConfig = configUtil.getActionConfig("OrderNotificationService", "soapui-client-action-01");
SOAPClient soapClient = new SOAPClient(actionConfig);
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soapui-client/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soapui-client/build.xml 2008-04-17 13:12:00 UTC (rev 19606)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/soapui-client/build.xml 2008-04-17 15:31:52 UTC (rev 19607)
@@ -89,6 +89,7 @@
<target name="test" depends="junit-present, compile-tests" if="junit.present" description="Run the test cases">
<mkdir dir="${maven.test.reports}"/>
<junit printSummary="yes" haltonerror="true" showoutput="true" haltonfailure="true" fork="true" dir=".">
+ <sysproperty key="jboss.esb.invm.scope.default" value="NONE"/>
<sysproperty key="basedir" value="."/>
<sysproperty key="java.awt.headless" value="true"/>
<sysproperty key="log4j.configuration" value="log4j.xml"/>
More information about the jboss-svn-commits
mailing list