You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2006/11/02 09:44:20 UTC
svn commit: r470277 [1/2] - in
/incubator/tuscany/java/sca/services/bindings/binding.jms: ./ src/
src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/tuscany/ src/main/java/org/apache/tuscany/binding/
src/main...
Author: antelder
Date: Thu Nov 2 00:44:18 2006
New Revision: 470277
URL: http://svn.apache.org/viewvc?view=rev&rev=470277
Log:
TUSCANY-753, add JMS binding from Rajith Attapattu
Added:
incubator/tuscany/java/sca/services/bindings/binding.jms/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/LICENSE.txt (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/NOTICE.txt (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/pom.xml (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationSelector.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBinding.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSReference.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSService.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/OperationSelector.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/default.scdl (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/jms.system.scdl (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingService.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroService.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCase.java (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/sca/ (with props)
incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/resources/META-INF/sca/default.scdl (with props)
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/LICENSE.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/LICENSE.txt?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/LICENSE.txt (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/LICENSE.txt Thu Nov 2 00:44:18 2006
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, serviceDefinition marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/LICENSE.txt
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/NOTICE.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/NOTICE.txt?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/NOTICE.txt (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/NOTICE.txt Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+${pom.name}
+Copyright (c) 2005 - 2006 The Apache Software Foundation
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/NOTICE.txt
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/pom.xml?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/pom.xml (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/pom.xml Thu Nov 2 00:44:18 2006
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.sca.services.bindings</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0-incubator-M2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>binding.jms</artifactId>
+ <name>Apache Tuscany Binding for JMS</name>
+ <description>Implementation of the SCA JMS binding spec.</description>
+
+ <repositories>
+ <repository>
+ <id>apache.m1.snapshots</id>
+ <name>Apache M1 Snapshot Repository</name>
+ <url>http://people.apache.org/repo/m1-snapshot-repository</url>
+ <layout>legacy</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-jms</artifactId>
+ <version>1.1-rc4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>core</artifactId>
+ <version>${sca.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${sca.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.services.databinding</groupId>
+ <artifactId>databinding-sdo</artifactId>
+ <version>${sca.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-kernel</artifactId>
+ <version>SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-api</artifactId>
+ <version>SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-impl</artifactId>
+ <version>SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ws.commons</groupId>
+ <artifactId>XmlSchema</artifactId>
+ <version>SNAPSHOT</version>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ </dependency>
+
+<!--
+ <dependency>
+ <groupId>incubator-activemq</groupId>
+ <artifactId>activemq-core</artifactId>
+ <version>4.0.1</version>
+ <scope>test</scope>
+ </dependency>
+ -->
+
+ <dependency>
+ <groupId>activemq</groupId>
+ <artifactId>activemq-core</artifactId>
+ <version>3.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>backport-util-concurrent</groupId>
+ <artifactId>backport-util-concurrent</artifactId>
+ <version>2.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-j2ee-management</artifactId>
+ <version>1.0-rc4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>test</artifactId>
+ <version>${sca.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/pom.xml
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationSelector.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationSelector.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationSelector.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationSelector.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+
+public class DefaultOperationSelector implements OperationSelector{
+
+ private static final String DEFAULT_PROPERTY_NAME = "scaOperationName";
+ private JMSBinding jmsBinding;
+
+ public DefaultOperationSelector(JMSBinding jmsBinding){
+ this.jmsBinding = jmsBinding;
+ }
+
+ public String getOperationName(Message message) {
+ try {
+ return message.getStringProperty(getPropertyName());
+ } catch (JMSException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public void setOperationName(String operationName,Message message) {
+ try {
+ message.setStringProperty(getPropertyName(),operationName);
+ } catch (JMSException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private String getPropertyName(){
+ String propName = jmsBinding.getOperationSelectorPropertyName();
+ if (propName != null && !propName.trim().equals("")){
+ return propName;
+ }else{
+ return DEFAULT_PROPERTY_NAME;
+ }
+ }
+
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationSelector.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBinding.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBinding.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBinding.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+import javax.jms.DeliveryMode;
+
+import org.apache.tuscany.spi.model.Binding;
+
+/**
+ * Represents a binding to a JMS resource.
+ */
+
+public class JMSBinding extends Binding {
+
+ public final static int DESTINATION_TYPE_QUEUE = 0;
+ public final static int DESTINATION_TYPE_TOPIC = 1;
+
+ private int destinationType = DESTINATION_TYPE_QUEUE;
+
+ private String destinationName;
+
+ // Topic or Query factory name
+ private String connectionFactoryName;
+
+ private String activationSpecName;
+
+ private String initialContextFactoryName; // "org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+
+ private String jNDIProviderURL; // "tcp://hostname:61616"
+
+ // Maps to javax.jms.DeliveryMode
+ private int deliveryMode = DeliveryMode.NON_PERSISTENT;
+
+ private int timeToLive = 1000 ; // in mili seconds
+
+ private int priority;
+
+ private String replyTo;
+
+ private String jmsResourceFactoryName;
+
+ private String operationSelectorName;
+
+ private String operationSelectorPropertyName = "OpName";
+
+ public JMSBinding(int destinationType, String destinationName, String connectionFactoryName, String activationSpecName, String initialContextFactoryName, String providerURL, int deliveryMode, int timeToLive, int priority, String replyTo) {
+ super();
+ this.destinationType = destinationType;
+ this.destinationName = destinationName;
+ this.connectionFactoryName = connectionFactoryName;
+ this.activationSpecName = activationSpecName;
+ this.initialContextFactoryName = initialContextFactoryName;
+ jNDIProviderURL = providerURL;
+ this.deliveryMode = deliveryMode;
+ this.timeToLive = timeToLive;
+ this.priority = priority;
+ this.replyTo = replyTo;
+ }
+
+ public JMSBinding(){
+ super();
+ }
+
+ public String getActivationSpecName() {
+ return activationSpecName;
+ }
+
+ public void setActivationSpecName(String activationSpecName) {
+ this.activationSpecName = activationSpecName;
+ }
+
+ public String getConnectionFactoryName() {
+ return connectionFactoryName;
+ }
+
+ public void setConnectionFactoryName(String connectionFactoryName) {
+ this.connectionFactoryName = connectionFactoryName;
+ }
+
+ public int getDeliveryMode() {
+ return deliveryMode;
+ }
+
+ public void setDeliveryMode(int deliveryMode) {
+ this.deliveryMode = deliveryMode;
+ }
+
+ public String getDestinationName() {
+ return destinationName;
+ }
+
+ public void setDestinationName(String destinationName) {
+ this.destinationName = destinationName;
+ }
+
+ public String getInitialContextFactoryName() {
+ return initialContextFactoryName;
+ }
+
+ public void setInitialContextFactoryName(String initialContextFactoryName) {
+ this.initialContextFactoryName = initialContextFactoryName;
+ }
+
+ public String getJNDIProviderURL() {
+ return jNDIProviderURL;
+ }
+
+ public void setJNDIProviderURL(String providerURL) {
+ jNDIProviderURL = providerURL;
+ }
+
+ public int getPriority() {
+ return priority;
+ }
+
+ public void setPriority(int priority) {
+ this.priority = priority;
+ }
+
+ public String getReplyTo() {
+ return replyTo;
+ }
+
+ public void setReplyTo(String replyTo) {
+ this.replyTo = replyTo;
+ }
+
+ public int getTimeToLive() {
+ return timeToLive;
+ }
+
+ public void setTimeToLive(int timeToLive) {
+ this.timeToLive = timeToLive;
+ }
+
+ public int getDestinationType() {
+ return destinationType;
+ }
+
+ public void setDestinationType(int destinationType) {
+ this.destinationType = destinationType;
+ }
+
+ public String getJmsResourceFactoryName() {
+ return jmsResourceFactoryName;
+ }
+
+ public void setJmsResourceFactoryName(String jmsResourceFactoryName) {
+ this.jmsResourceFactoryName = jmsResourceFactoryName;
+ }
+
+ public String getOperationSelectorName() {
+ return operationSelectorName;
+ }
+
+ public void setOperationSelectorName(String operationSelectorName) {
+ this.operationSelectorName = operationSelectorName;
+ }
+
+ public String getOperationSelectorPropertyName() {
+ return operationSelectorPropertyName;
+ }
+
+ public void setOperationSelectorPropertyName(
+ String operationSelectorPropertyName) {
+ this.operationSelectorPropertyName = operationSelectorPropertyName;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBinding.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,148 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.Reference;
+import org.apache.tuscany.spi.component.Service;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.BindingBuilderExtension;
+import org.apache.tuscany.spi.model.BoundReferenceDefinition;
+import org.apache.tuscany.spi.model.BoundServiceDefinition;
+import org.apache.tuscany.spi.model.ServiceContract;
+
+import commonj.sdo.helper.TypeHelper;
+
+/**
+ * Builds a Service or Reference for JMS binding.
+ *
+ * @version $Rev: 449970 $ $Date: 2006-09-26 06:05:35 -0400 (Tue, 26 Sep 2006) $
+ */
+
+public class JMSBindingBuilder extends BindingBuilderExtension<JMSBinding> {
+
+ private static final String DEFAULT_JMS_RESOURCE_FACTORY = "org.apache.tuscany.binding.jms.SimpleJMSResourceFactory";
+ private static final String DEFAULT_OPERATION_SELECTOR = "org.apache.tuscany.binding.jms.DefaultOperationSelector";
+ private static final String OM_DATA_BINDING = OMElement.class.getName();
+
+ protected Class<JMSBinding> getBindingType() {
+ return JMSBinding.class;
+ }
+
+ @SuppressWarnings({"unchecked"})
+ public Service build(CompositeComponent parent,
+ BoundServiceDefinition<JMSBinding> serviceDefinition,
+ DeploymentContext deploymentContext) {
+
+ JMSBinding jmsBinding = serviceDefinition.getBinding();
+ Class<?> interfaze = serviceDefinition.getServiceContract().getInterfaceClass();
+
+ ServiceContract serviceContract = serviceDefinition.getServiceContract();
+ serviceContract.setDataBinding(OM_DATA_BINDING);
+
+ JMSResourceFactory jmsResourceFactory = getJMSResourceFactory(jmsBinding);
+ OperationSelector opSec = getOperationSelector(jmsBinding);
+
+ Service service = new JMSService(serviceDefinition.getName(),parent, wireService, jmsBinding, jmsResourceFactory,opSec,interfaze);
+ service.setBindingServiceContract(serviceContract);
+
+ return service;
+ }
+
+ @SuppressWarnings({"unchecked"})
+ public Reference build(CompositeComponent parent,
+ BoundReferenceDefinition<JMSBinding> referenceDefinition,
+ DeploymentContext deploymentContext) {
+
+ String name = referenceDefinition.getName();
+ Class<?> interfaze = referenceDefinition.getServiceContract().getInterfaceClass();
+ ServiceContract serviceContract = referenceDefinition.getServiceContract();
+ serviceContract.setDataBinding(OM_DATA_BINDING);
+
+ JMSBinding jmsBinding = referenceDefinition.getBinding();
+ JMSResourceFactory jmsResourceFactory = getJMSResourceFactory(jmsBinding);
+ OperationSelector opSec = getOperationSelector(jmsBinding);
+
+ Reference reference = new JMSReference(name,parent,wireService, jmsBinding, jmsResourceFactory,opSec,interfaze);
+ reference.setBindingServiceContract(serviceContract);
+ return reference;
+
+ }
+
+ private JMSResourceFactory getJMSResourceFactory(JMSBinding jmsBinding) {
+ String className = jmsBinding.getJmsResourceFactoryName();
+ if (className != null && !className.equals("")){
+ try {
+ Class factoryClass = Class.forName(className != null ? className : DEFAULT_JMS_RESOURCE_FACTORY);
+ Constructor constructor = factoryClass.getDeclaredConstructor(new Class[]{JMSBinding.class});
+ return (JMSResourceFactory) constructor.newInstance(jmsBinding);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return new SimpleJMSResourceFactory(jmsBinding);
+ }else{
+ return new SimpleJMSResourceFactory(jmsBinding);
+ }
+
+ }
+
+
+ private OperationSelector getOperationSelector(JMSBinding jmsBinding) {
+ String className = jmsBinding.getOperationSelectorName();
+
+ if (className != null && !className.equals("")){
+ try {
+ Class factoryClass = Class.forName(className != null ? className : DEFAULT_OPERATION_SELECTOR);
+ Constructor constructor = factoryClass.getDeclaredConstructor(new Class[]{JMSBinding.class});
+ return (OperationSelector) constructor.newInstance(jmsBinding);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return new DefaultOperationSelector(jmsBinding);
+ }else{
+ return new DefaultOperationSelector(jmsBinding);
+ }
+ }
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,133 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.osoa.sca.annotations.Scope;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
+import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.LoaderExtension;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.loader.LoaderRegistry;
+import org.apache.tuscany.spi.loader.LoaderUtil;
+import org.apache.tuscany.spi.model.ModelObject;
+
+/**
+ * Loader for handling <binding.jms> elements.
+ *
+ * @version $Rev: 449970 $ $Date: 2006-09-26 06:05:35 -0400 (Tue, 26 Sep 2006) $
+ */
+@Scope("MODULE")
+public class JMSBindingLoader extends LoaderExtension<JMSBinding> {
+ public static final QName BINDING_JMS = new QName(
+ "http://tuscany.apache.org/xmlns/binding/jms/1.0-SNAPSHOT", "binding.jms");
+
+ public JMSBindingLoader(@Autowire LoaderRegistry registry) {
+ super(registry);
+ }
+
+ public QName getXMLType() {
+ return BINDING_JMS;
+ }
+
+
+ /**
+ * FIXME 21.10.2006 rajith
+ * The spec has changed quite a bit since I started the implementation, especially during the last 2 weeks.
+ * I will wait till a draft version is published before I make any changes
+ *
+ */
+ public JMSBinding load(CompositeComponent parent,
+ ModelObject modelObject,
+ XMLStreamReader reader,
+ DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
+
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(), reader);
+ OMElement omElement = builder.getDocumentElement();
+
+ //OMElement connectionOM = omElement.getFirstChildWithName(new QName("connection.jms"));
+ OMElement connectionOM = omElement;
+
+
+ String activationSpecName = connectionOM.getAttributeValue(new QName("activationSpecName"));
+ String destinationName = connectionOM.getAttributeValue(new QName("destinationName"));
+ String connectionFactoryName = connectionOM.getAttributeValue(new QName("connectionFactoryName")) ;
+ String initialContextFactoryName = connectionOM.getAttributeValue(new QName("initialContextFactoryName")) ;
+ String jNDIProviderURL = connectionOM.getAttributeValue(new QName("providerURL")) ;
+ String deliveryMode = connectionOM.getAttributeValue(new QName(null, "deliveryMode")) ;
+ String timeToLive = connectionOM.getAttributeValue(new QName(null, "timeToLive")) ;
+ String priority = connectionOM.getAttributeValue(new QName(null, "priority")) ;
+ String replyTo = connectionOM.getAttributeValue(new QName(null, "replyTo")) ;
+ String jmsResourceFactoryName = connectionOM.getAttributeValue(new QName(null, "jmsResourceFactory")) ;
+
+ LoaderUtil.skipToEndElement(reader);
+
+ //builder = OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(), reader);
+ //OMElement opSecOM = builder.getDocumentElement();
+ //omElement.getFirstChildWithName(new QName("operationSelector"));
+ String operationSelector = ""; //opSecOM.getAttributeValue(new QName("name"));
+ //OMElement opSecPropertyOM = opSecOM.getFirstChildWithName(new QName("property"));
+ String jmsOpSecPropertyName = ""; // = opSecPropertyOM.getText();
+
+
+ JMSBinding binding = new JMSBinding();
+ binding.setActivationSpecName(activationSpecName);
+ binding.setConnectionFactoryName(connectionFactoryName);
+ binding.setDestinationName(destinationName);
+ binding.setInitialContextFactoryName(initialContextFactoryName);
+ binding.setJNDIProviderURL(jNDIProviderURL);
+ binding.setReplyTo(replyTo);
+ binding.setJmsResourceFactoryName(jmsResourceFactoryName);
+ binding.setOperationSelectorName(operationSelector);
+ binding.setOperationSelectorPropertyName(jmsOpSecPropertyName);
+
+ if (deliveryMode != null && deliveryMode.trim().equals("")){
+ try{
+ binding.setDeliveryMode(Integer.parseInt(deliveryMode));
+ }catch (Exception e){
+
+ }
+ }
+
+ if (priority != null && priority.trim().equals("")){
+ try{
+ binding.setPriority(Integer.parseInt(priority));
+ }catch (Exception e){
+
+ }
+ }
+
+ if (timeToLive != null && timeToLive.trim().equals("")){
+ try{
+ binding.setTimeToLive(Integer.parseInt(timeToLive));
+ }catch (Exception e){
+
+ }
+ }
+
+ return binding;
+ }
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+import java.lang.reflect.Method;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.apache.tuscany.spi.model.Operation;
+import org.apache.tuscany.spi.wire.InboundWire;
+import org.apache.tuscany.spi.wire.Interceptor;
+import org.apache.tuscany.spi.wire.InvocationChain;
+import org.apache.tuscany.spi.wire.MessageImpl;
+
+public class JMSProxy implements MessageListener{
+
+ protected Method operationMethod;
+ private JMSBinding jmsBinding;
+ private Context context;
+ private JMSResourceFactory jmsResourceFactory;
+ private OperationSelector operationSelector;
+ private InboundWire inboundWire;;
+
+ public JMSProxy(InboundWire inboundWire,JMSResourceFactory jmsResourceFactory, JMSBinding jmsBinding,OperationSelector operationSelector) throws NamingException{
+
+ this.jmsBinding = jmsBinding;
+ this.jmsResourceFactory = jmsResourceFactory;
+ this.operationSelector = operationSelector;
+ this.inboundWire = inboundWire;
+ }
+
+ public void onMessage(Message msg){
+
+ String operationName = operationSelector.getOperationName(msg);
+ Operation op = (Operation) inboundWire.getServiceContract().getOperations().get(operationName);
+
+ try {
+
+ InvocationChain chain = inboundWire.getInvocationChains().get(op);
+ Interceptor headInterceptor = chain.getHeadInterceptor();
+
+ org.apache.tuscany.spi.wire.Message tuscanyMsg = new MessageImpl();
+ tuscanyMsg.setBody(new Object[]{((TextMessage)msg).getText()});
+ tuscanyMsg.setTargetInvoker(chain.getTargetInvoker());
+ org.apache.tuscany.spi.wire.Message tuscanyResMsg = null;
+
+ // again over here I expect the data binding interecptors to convert the
+ // XML string into objects
+ if (headInterceptor != null){
+ tuscanyResMsg = headInterceptor.invoke(tuscanyMsg);
+ }
+
+ // if result is null then the method can be assumed as oneway
+ if (tuscanyResMsg != null && tuscanyResMsg.getBody() != null){
+ sendReply(msg,operationName, (String)tuscanyResMsg.getBody());
+ }
+ } catch (Exception e) {
+ // need to do proper error handling
+ e.printStackTrace();
+ }
+ }
+
+ private void sendReply(Message reqMsg,String operationName,String payload) throws JMSException, NamingException{
+
+ Session session = jmsResourceFactory.createSession();
+
+ javax.jms.Message message = jmsResourceFactory.createMessage(session);
+
+ ((javax.jms.TextMessage)message).setText((String)payload);
+
+ Destination destination = reqMsg.getJMSReplyTo();
+
+ MessageProducer producer = session.createProducer(destination);
+ producer.send(message);
+ producer.close();
+ session.close();
+ }
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSReference.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSReference.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSReference.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSReference.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+import javax.naming.NamingException;
+
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.extension.ReferenceExtension;
+import org.apache.tuscany.spi.model.Operation;
+import org.apache.tuscany.spi.model.ServiceContract;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.WireService;
+
+/**
+ * @version $Rev: 449970 $ $Date: 2006-09-26 06:05:35 -0400 (Tue, 26 Sep 2006) $
+ */
+public class JMSReference<T> extends ReferenceExtension {
+
+ private JMSBinding jmsBinding;
+ private JMSResourceFactory jmsResourceFactory;
+ private OperationSelector operationSelector;
+
+ public JMSReference(String name,
+ CompositeComponent parent,
+ WireService wireService,
+ JMSBinding jmsBinding,
+ JMSResourceFactory jmsResourceFactory,
+ OperationSelector operationSelector,
+ Class<?> service) {
+
+ super(name, service, parent, wireService);
+
+ this.jmsBinding = jmsBinding;
+ this.jmsResourceFactory = jmsResourceFactory;
+ this.operationSelector = operationSelector;
+ }
+
+ public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) {
+ try {
+ return new JMSTargetInvoker(jmsResourceFactory, jmsBinding, operation.getName(),operationSelector);
+ } catch (NamingException e) {
+ throw new RuntimeException("Unable to create JMS resources for the invocation",e);
+ }
+ }
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSReference.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
+import javax.naming.NamingException;
+
+public interface JMSResourceFactory {
+
+ public abstract Connection getConnection() throws NamingException,
+ JMSException;
+
+ public abstract Session createSession() throws JMSException,
+ NamingException;
+
+ public abstract void startConnection() throws JMSException, NamingException;
+
+ public abstract void closeConnection() throws JMSException, NamingException;
+
+ public abstract Message createMessage(Session session)
+ throws JMSException;
+
+ public abstract Destination lookupDestination(String jndiName) throws NamingException;
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSService.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSService.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSService.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.Session;
+import javax.naming.NamingException;
+
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.extension.ServiceExtension;
+import org.apache.tuscany.spi.wire.WireService;
+
+/**
+ * @version $Rev: 449970 $ $Date: 2006-09-26 06:05:35 -0400 (Tue, 26 Sep 2006) $
+ */
+public class JMSService extends ServiceExtension {
+
+ private JMSBinding jmsBinding;
+ private JMSResourceFactory jmsResourceFactory;
+ private MessageConsumer consumer;
+ private OperationSelector operationSelector;
+
+ public JMSService(String name,
+ CompositeComponent parent,
+ WireService wireService,
+ JMSBinding jmsBinding,
+ JMSResourceFactory jmsResourceFactory,
+ OperationSelector operationSelector,
+ Class<?> service) {
+ super(name, service, parent, wireService);
+
+ this.jmsBinding = jmsBinding;
+ this.jmsResourceFactory = jmsResourceFactory;
+ this.operationSelector = operationSelector;
+ }
+
+ public void start() {
+ super.start();
+ try {
+ registerListerner();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public void stop() {
+
+ try {
+ consumer.close();
+ jmsResourceFactory.closeConnection();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ super.stop();
+ }
+
+ private void registerListerner() throws NamingException, JMSException{
+
+ Session session = jmsResourceFactory.createSession();
+ Destination destination = session.createQueue(jmsBinding.getDestinationName());
+
+ consumer = session.createConsumer(destination);
+ consumer.setMessageListener(new JMSProxy(getInboundWire(),jmsResourceFactory,jmsBinding,operationSelector));
+
+ jmsResourceFactory.startConnection();
+
+ }
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSService.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.naming.NamingException;
+
+import org.apache.tuscany.spi.wire.InvocationRuntimeException;
+import org.apache.tuscany.spi.wire.Message;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+
+/**
+ * Invoke a JMS reference.
+ *
+ * @version $Rev: 449970 $ $Date: 2006-09-26 06:05:35 -0400 (Tue, 26 Sep 2006) $
+ */
+public class JMSTargetInvoker implements TargetInvoker {
+ private JMSBinding jmsBinding;
+ private String operationName;
+ private JMSResourceFactory jmsResourceFactory;
+ private OperationSelector operationSelector;
+
+ public JMSTargetInvoker(JMSResourceFactory jmsResourceFactory,JMSBinding jmsBinding, String operationName, OperationSelector operationSelector) throws NamingException {
+ this.jmsBinding = jmsBinding;
+ this.jmsResourceFactory = jmsResourceFactory;
+ this.operationName = operationName;
+ this.operationSelector = operationSelector;
+ }
+
+ /* By the time I receive the args it should have been converted to
+ * XML by the data binding framework.
+ */
+ public Message invoke(Message msg) throws InvocationRuntimeException {
+ try {
+ Object[] args = (Object[])msg.getBody();
+ Object resp = invokeTarget(args[0]);
+ msg.setBody(resp);
+ } catch (Exception e) {
+ msg.setBody(e.getCause());
+ }
+ return msg;
+ }
+
+ public Object invokeTarget(Object payload)throws InvocationTargetException {
+ try {
+
+ return sendReceiveMessage(payload);
+
+ } catch (Exception e) { // catch JMS specific error
+
+ throw new AssertionError(e);
+ }
+
+ }
+
+ public Object clone() throws CloneNotSupportedException {
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new AssertionError(e);
+ }
+ }
+
+ public boolean isOptimizable() {
+ return false;
+ }
+
+ public boolean isCacheable() {
+ return false;
+ }
+
+ public void setCacheable(boolean cacheable) {
+ }
+
+ private Object sendReceiveMessage(Object payload) throws JMSException, NamingException{
+
+ Session session = jmsResourceFactory.createSession();
+
+ javax.jms.Message message = jmsResourceFactory.createMessage(session);
+ operationSelector.setOperationName(operationName,message);
+
+ ((javax.jms.TextMessage)message).setText((String)payload);
+
+ Destination destination = jmsResourceFactory.lookupDestination(jmsBinding.getDestinationName());
+
+ MessageProducer producer = session.createProducer(destination);
+
+ // create a temporary queue and listen to the response
+ //Destination replyDest = session.createQueue(jmsBinding.getDestinationName()+ "-reply");
+ Destination replyDest = session.createTemporaryQueue();
+ message.setJMSReplyTo(replyDest);
+
+ producer.send(message);
+ producer.close();
+
+ MessageConsumer consumer = session.createConsumer(replyDest);
+ jmsResourceFactory.startConnection();
+ javax.jms.Message reply = consumer.receive(jmsBinding.getTimeToLive());
+
+ System.out.println("Reply " + reply);
+
+ consumer.close();
+
+ session.close();
+
+ return ((javax.jms.TextMessage)reply).getText();
+ }
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/OperationSelector.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/OperationSelector.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/OperationSelector.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/OperationSelector.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+/*
+ * Defined by the SCA Messaging binding spec
+ */
+public interface OperationSelector {
+
+ public String getOperationName(javax.jms.Message message);
+
+ public void setOperationName(String operationName,javax.jms.Message message);
+
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/OperationSelector.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.java?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.java (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.java Thu Nov 2 00:44:18 2006
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.binding.jms;
+
+import java.util.Properties;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SimpleJMSResourceFactory implements JMSResourceFactory {
+
+ private JMSBinding jmsBinding;
+ private Connection con;
+ private Context context;
+ private boolean isConnectionStarted;
+
+ public SimpleJMSResourceFactory(JMSBinding jmsBinding){
+ this.jmsBinding = jmsBinding;
+ }
+
+ /*
+ * This is a simple implementation where a connection is created per binding
+ * Ideally the resource factory should be able to leverage the host environment
+ * to provide connection pooling if it can.
+ *
+ * For ex If Tuscany is running inside an AppServer
+ * Then we could leverage the JMS resources it provides
+ *
+ * @see org.apache.tuscany.binding.jms.JMSResourceFactory#getConnection()
+ */
+ public Connection getConnection() throws NamingException, JMSException{
+ if (con == null){
+ createConnection();
+ }
+ return con;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.tuscany.binding.jms.JMSResourceFactory#createSession()
+ */
+ public Session createSession() throws JMSException, NamingException{
+ return getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.tuscany.binding.jms.JMSResourceFactory#startConnection()
+ */
+ public void startConnection() throws JMSException, NamingException{
+ if(!isConnectionStarted){
+ getConnection().start();
+ isConnectionStarted = true;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.tuscany.binding.jms.JMSResourceFactory#closeConnection()
+ */
+ public void closeConnection() throws JMSException, NamingException{
+ if(con != null){
+ con.close();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.tuscany.binding.jms.JMSResourceFactory#createTextMessage(javax.jms.Session)
+ */
+ public Message createMessage(Session session) throws JMSException{
+ javax.jms.Message message = session.createTextMessage(); // default
+ message.setJMSDeliveryMode(jmsBinding.getDeliveryMode());
+ message.setJMSPriority(jmsBinding.getPriority());
+
+ return message;
+ }
+
+ private void createConnection() throws NamingException, JMSException {
+ if(context == null){
+ createInitialContext();
+ }
+ ConnectionFactory conFac = (ConnectionFactory)context.lookup(jmsBinding.getConnectionFactoryName());
+ con = conFac.createConnection();
+ }
+
+ private void createInitialContext() throws NamingException{
+ Properties props = new Properties();
+ props.setProperty(Context.INITIAL_CONTEXT_FACTORY,jmsBinding.getInitialContextFactoryName().trim());
+ props.setProperty(Context.PROVIDER_URL,jmsBinding.getJNDIProviderURL().trim());
+
+ context = new InitialContext(props);
+ }
+
+ public Destination lookupDestination(String jndiName) throws NamingException {
+ return (Destination)context.lookup(jndiName);
+ }
+
+}
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.java
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/default.scdl Thu Nov 2 00:44:18 2006
@@ -0,0 +1,29 @@
+ <!--
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+ name="org.apache.tuscany.binding.jms.JMSBinding">
+
+ <component name="jms.bindingLoader">
+ <system:implementation.system class="org.apache.tuscany.binding.jms.JMSBindingLoader"/>
+ </component>
+
+ <component name="jms.bindingBuilder">
+ <system:implementation.system class="org.apache.tuscany.binding.jms.JMSBindingBuilder"/>
+ </component>
+
+</composite>
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/default.scdl
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/jms.system.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/jms.system.scdl?view=auto&rev=470277
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/jms.system.scdl (added)
+++ incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/jms.system.scdl Thu Nov 2 00:44:18 2006
@@ -0,0 +1,29 @@
+ <!--
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+ name="org.apache.tuscany.binding.jms.JMSBinding">
+
+ <component name="jms.bindingLoader">
+ <system:implementation.system class="org.apache.tuscany.binding.jms.JMSBindingLoader"/>
+ </component>
+
+ <component name="jms.bindingBuilder">
+ <system:implementation.system class="org.apache.tuscany.binding.jms.JMSBindingBuilder"/>
+ </component>
+
+</composite>
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/main/resources/META-INF/sca/jms.system.scdl
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Propchange: incubator/tuscany/java/sca/services/bindings/binding.jms/src/test/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Thu Nov 2 00:44:18 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org