You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2011/02/27 19:37:14 UTC
svn commit: r1075109 [1/3] - in /aries/tags/transaction-0.1-incubating: ./
transaction-blueprint/ transaction-blueprint/src/
transaction-blueprint/src/main/ transaction-blueprint/src/main/java/
transaction-blueprint/src/main/java/org/ transaction-bluep...
Author: zoe
Date: Sun Feb 27 18:37:11 2011
New Revision: 1075109
URL: http://svn.apache.org/viewvc?rev=1075109&view=rev
Log:
Restore transaction 0.1
Added:
aries/tags/transaction-0.1-incubating/
aries/tags/transaction-0.1-incubating/LICENSE
aries/tags/transaction-0.1-incubating/NOTICE
aries/tags/transaction-0.1-incubating/pom.xml
aries/tags/transaction-0.1-incubating/transaction-blueprint/
aries/tags/transaction-0.1-incubating/transaction-blueprint/pom.xml
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionStrategy.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionToken.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelper.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelperImpl.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/exception/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/exception/TransactionRollbackException.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/OSGI-INF/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/apache/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/apache/aries/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/apache/aries/transaction/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/apache/aries/transaction/parsing/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/apache/aries/transaction/parsing/transaction.xsd
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/InterceptorTest.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/NameSpaceHandlerTest.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/TranStrategyTest.java
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/resources/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/resources/org/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/resources/org/apache/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/resources/org/apache/aries/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/resources/org/apache/aries/transaction/
aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/resources/org/apache/aries/transaction/aries.xml
aries/tags/transaction-0.1-incubating/transaction-itests/
aries/tags/transaction-0.1-incubating/transaction-itests/pom.xml
aries/tags/transaction-0.1-incubating/transaction-itests/src/
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/itests/
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/itests/InvalidTranStrategyTest.java
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/itests/MandatoryTranStrategyTest.java
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/itests/NeverTranStrategyTest.java
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/itests/NotSupportedTranStrategyTest.java
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/itests/RequiredTranStrategyTest.java
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/itests/RequiresNewTranStrategyTest.java
aries/tags/transaction-0.1-incubating/transaction-itests/src/test/java/org/apache/aries/transaction/itests/SupportsTranStrategyTest.java
aries/tags/transaction-0.1-incubating/transaction-manager/
aries/tags/transaction-0.1-incubating/transaction-manager/pom.xml
aries/tags/transaction-0.1-incubating/transaction-manager/src/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/appended-resources/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/appended-resources/META-INF/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/appended-resources/META-INF/LICENSE.vm
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/appended-resources/META-INF/NOTICE.vm
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/javax/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/javax/resource/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/javax/resource/spi/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/javax/resource/spi/XATerminator.java
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/org/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/org/apache/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/org/apache/aries/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/org/apache/aries/transaction/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/org/apache/aries/transaction/Activator.java
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/org/apache/aries/transaction/GeronimoPlatformTransactionManager.java
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/org/apache/aries/transaction/TransactionManagerService.java
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/org/apache/aries/transaction/exception/
aries/tags/transaction-0.1-incubating/transaction-manager/src/main/java/org/apache/aries/transaction/parsing/
aries/tags/transaction-0.1-incubating/transaction-testbundle/
aries/tags/transaction-0.1-incubating/transaction-testbundle/pom.xml
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/java/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/java/org/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/java/org/apache/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/java/org/apache/aries/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/java/org/apache/aries/transaction/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/java/org/apache/aries/transaction/test/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/java/org/apache/aries/transaction/test/TestBean.java
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/java/org/apache/aries/transaction/test/impl/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/java/org/apache/aries/transaction/test/impl/TestBeanImpl.java
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/resources/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/resources/OSGI-INF/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/resources/OSGI-INF/blueprint/
aries/tags/transaction-0.1-incubating/transaction-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml
aries/tags/transaction-0.1-incubating/transaction-testds/
aries/tags/transaction-0.1-incubating/transaction-testds/pom.xml
aries/tags/transaction-0.1-incubating/transaction-testds/src/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/java/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/java/org/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/java/org/apache/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/java/org/apache/aries/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/java/org/apache/aries/transaction/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/java/org/apache/aries/transaction/jdbc/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/resources/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/resources/OSGI-INF/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/resources/OSGI-INF/blueprint/
aries/tags/transaction-0.1-incubating/transaction-testds/src/main/resources/OSGI-INF/blueprint/dataSource.xml
aries/tags/transaction-0.1-incubating/transaction-wrappers/
aries/tags/transaction-0.1-incubating/transaction-wrappers/pom.xml
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/java/
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/java/org/
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/java/org/apache/
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/java/org/apache/aries/
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/java/org/apache/aries/transaction/
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/ConnectionWrapper.java
aries/tags/transaction-0.1-incubating/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/XADatasourceEnlistingWrapper.java
Added: aries/tags/transaction-0.1-incubating/LICENSE
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/LICENSE?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/LICENSE (added)
+++ aries/tags/transaction-0.1-incubating/LICENSE Sun Feb 27 18:37:11 2011
@@ -0,0 +1,203 @@
+
+ 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, service 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.
+
Added: aries/tags/transaction-0.1-incubating/NOTICE
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/NOTICE?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/NOTICE (added)
+++ aries/tags/transaction-0.1-incubating/NOTICE Sun Feb 27 18:37:11 2011
@@ -0,0 +1,8 @@
+
+Apache Aries
+Copyright 2009-2010 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
Added: aries/tags/transaction-0.1-incubating/pom.xml
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/pom.xml?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/pom.xml (added)
+++ aries/tags/transaction-0.1-incubating/pom.xml Sun Feb 27 18:37:11 2011
@@ -0,0 +1,131 @@
+<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.apache.aries</groupId>
+ <artifactId>java5-parent</artifactId>
+ <version>0.1-incubating</version>
+ </parent>
+
+ <properties>
+ <geronimo-transaction-version>2.1.3</geronimo-transaction-version>
+ </properties>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>transaction</artifactId>
+ <version>0.1-incubating</version>
+ <packaging>pom</packaging>
+ <name>Apache Aries Transaction</name>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/aries/tags/transaction-0.1-incubating</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/aries/tags/transaction-0.1-incubating</developerConnection>
+ <url>http://svn.apache.org/viewvc/incubator/aries/tags/transaction-0.1-incubating</url>
+ </scm>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- internal dependencies -->
+ <dependency>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>org.apache.aries.transaction.blueprint</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>org.apache.aries.transaction.manager</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>org.apache.aries.transaction.wrappers</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>org.apache.aries.transaction.testds</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>org.apache.aries.transaction.testbundle</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- external dependencies -->
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint</artifactId>
+ <version>0.1-incubating</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.testsupport</groupId>
+ <artifactId>org.apache.aries.testsupport.unit</artifactId>
+ <version>0.1-incubating</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.components</groupId>
+ <artifactId>geronimo-transaction</artifactId>
+ <version>${geronimo-transaction-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.objectweb.howl</groupId>
+ <artifactId>howl</artifactId>
+ <version>1.0.1-1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ <version>2.5.6</version>
+ </dependency>
+ <dependency>
+ <groupId>asm</groupId>
+ <artifactId>asm-all</artifactId>
+ <version>3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.5.3.0_1</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <modules>
+ <module>transaction-manager</module>
+ <module>transaction-blueprint</module>
+ <module>transaction-wrappers</module>
+ <module>transaction-itests</module>
+ <module>transaction-testbundle</module>
+ <module>transaction-testds</module>
+ </modules>
+
+</project>
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/pom.xml
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/pom.xml?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/pom.xml (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/pom.xml Sun Feb 27 18:37:11 2011
@@ -0,0 +1,90 @@
+<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>transaction</artifactId>
+ <version>0.1-incubating</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>org.apache.aries.transaction.blueprint</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Aries Transaction Blueprint</name>
+
+ <properties>
+ <aries.osgi.export.pkg>
+ org.apache.aries.transaction.exception
+ </aries.osgi.export.pkg>
+ <aries.osgi.import>
+ org.osgi.framework;version="1.5",
+ org.osgi.service.cm;version="[1.2.0,2.0.0)",
+ *
+ </aries.osgi.import>
+ <aries.osgi.private.pkg>
+ org.apache.aries.transaction,
+ org.apache.aries.transaction.parsing
+ </aries.osgi.private.pkg>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.testsupport</groupId>
+ <artifactId>org.apache.aries.testsupport.unit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionStrategy.java
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionStrategy.java?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionStrategy.java (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionStrategy.java Sun Feb 27 18:37:11 2011
@@ -0,0 +1,175 @@
+/*
+ * 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.aries.transaction;
+
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+public enum TransactionStrategy {
+ MANDATORY
+ {
+ public TransactionToken begin(TransactionManager man) throws SystemException
+ {
+ if (man.getStatus() == Status.STATUS_NO_TRANSACTION) {
+ throw new IllegalStateException("No transaction on the thread");
+ }
+
+ return new TransactionToken(man.getTransaction(), null, MANDATORY);
+ }
+ },
+ NEVER
+ {
+ public TransactionToken begin(TransactionManager man) throws SystemException
+ {
+ if (man.getStatus() == Status.STATUS_ACTIVE) {
+ throw new IllegalStateException("Transaction on the thread");
+ }
+
+ return new TransactionToken(null, null, NEVER);
+ }
+ },
+ NOTSUPPORTED
+ {
+ public TransactionToken begin(TransactionManager man) throws SystemException
+ {
+ if (man.getStatus() == Status.STATUS_ACTIVE) {
+ return new TransactionToken(null, man.suspend(), this);
+ }
+
+ return new TransactionToken(null, null, NOTSUPPORTED);
+ }
+
+ public void finish(TransactionManager man, TransactionToken tranToken) throws SystemException,
+ InvalidTransactionException, IllegalStateException
+ {
+ Transaction tran = tranToken.getSuspendedTransaction();
+ if (tran != null) {
+ man.resume(tran);
+ }
+ }
+ },
+ REQUIRED
+ {
+ public TransactionToken begin(TransactionManager man) throws SystemException, NotSupportedException
+ {
+ if (man.getStatus() == Status.STATUS_NO_TRANSACTION) {
+ man.begin();
+ return new TransactionToken(man.getTransaction(), null, REQUIRED, true);
+ }
+
+ return new TransactionToken(man.getTransaction(), null, REQUIRED);
+ }
+
+ public void finish(TransactionManager man, TransactionToken tranToken) throws SystemException,
+ InvalidTransactionException, IllegalStateException, SecurityException, RollbackException,
+ HeuristicMixedException, HeuristicRollbackException
+ {
+ if (tranToken.isCompletionAllowed()) {
+ if (man.getStatus() == Status.STATUS_MARKED_ROLLBACK) {
+ man.rollback();
+ } else {
+ man.commit();
+ }
+ }
+ }
+ },
+ REQUIRESNEW
+ {
+ public TransactionToken begin(TransactionManager man) throws SystemException, NotSupportedException,
+ InvalidTransactionException, IllegalStateException
+ {
+ TransactionToken tranToken;
+ if (man.getStatus() == Status.STATUS_ACTIVE) {
+ tranToken = new TransactionToken(null, man.suspend(), REQUIRESNEW);
+ } else {
+ tranToken = new TransactionToken(null, null, REQUIRESNEW);
+ }
+
+ try {
+ man.begin();
+ } catch (SystemException e) {
+ man.resume(tranToken.getSuspendedTransaction());
+ throw e;
+ } catch (NotSupportedException e) {
+ man.resume(tranToken.getSuspendedTransaction());
+ throw e;
+ }
+
+ tranToken.setActiveTransaction(man.getTransaction());
+ tranToken.setCompletionAllowed(true);
+
+ return tranToken;
+ }
+
+ public void finish(TransactionManager man, TransactionToken tranToken) throws SystemException,
+ InvalidTransactionException, IllegalStateException, SecurityException, RollbackException,
+ HeuristicMixedException, HeuristicRollbackException
+ {
+ if (tranToken.isCompletionAllowed()) {
+ if (man.getStatus() == Status.STATUS_MARKED_ROLLBACK) {
+ man.rollback();
+ } else {
+ man.commit();
+ }
+ }
+
+ Transaction tran = tranToken.getSuspendedTransaction();
+ if (tran != null) {
+ man.resume(tran);
+ }
+ }
+ },
+ SUPPORTS
+ {
+ public TransactionToken begin(TransactionManager man) throws SystemException, NotSupportedException,
+ InvalidTransactionException, IllegalStateException
+ {
+ if (man.getStatus() == Status.STATUS_ACTIVE) {
+ return new TransactionToken(man.getTransaction(), null, SUPPORTS);
+ }
+
+ return new TransactionToken(null, null, SUPPORTS);
+ }
+ };
+
+ public static TransactionStrategy fromValue(String value)
+ {
+ return valueOf(value.toUpperCase());
+ }
+
+ public TransactionToken begin(TransactionManager man) throws SystemException, NotSupportedException,
+ InvalidTransactionException, IllegalStateException
+ {
+ return null;
+ }
+
+ public void finish(TransactionManager man, TransactionToken tranToken) throws SystemException,
+ InvalidTransactionException, IllegalStateException, SecurityException, RollbackException,
+ HeuristicMixedException, HeuristicRollbackException
+ {
+
+ }
+}
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionToken.java
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionToken.java?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionToken.java (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TransactionToken.java Sun Feb 27 18:37:11 2011
@@ -0,0 +1,76 @@
+/*
+ * 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.aries.transaction;
+
+import javax.transaction.Transaction;
+
+class TransactionToken
+{
+ private Transaction activeTransaction;
+ private Transaction suspendedTransaction;
+ private TransactionStrategy transactionStrategy;
+ private boolean isCompletionAllowed;
+
+ public TransactionToken(Transaction activeTransaction, Transaction suspendedTransaction,
+ TransactionStrategy transactionStrategy)
+ {
+ this(activeTransaction, suspendedTransaction, transactionStrategy, false);
+ }
+
+ TransactionToken(Transaction activeTransaction, Transaction suspendedTransaction,
+ TransactionStrategy transactionStrategy, boolean isCompletionAllowed)
+ {
+ this.activeTransaction = activeTransaction;
+ this.suspendedTransaction = suspendedTransaction;
+ this.transactionStrategy = transactionStrategy;
+ this.isCompletionAllowed = isCompletionAllowed;
+ }
+
+ public Transaction getActiveTransaction() {
+ return activeTransaction;
+ }
+
+ public void setActiveTransaction(Transaction activeTransaction) {
+ this.activeTransaction = activeTransaction;
+ }
+
+ public Transaction getSuspendedTransaction() {
+ return suspendedTransaction;
+ }
+
+ public void setSuspendedTransaction(Transaction suspendedTransaction) {
+ this.suspendedTransaction = suspendedTransaction;
+ }
+
+ public TransactionStrategy getTransactionStrategy() {
+ return transactionStrategy;
+ }
+
+ public void setTransactionStrategy(TransactionStrategy transactionStrategy) {
+ this.transactionStrategy = transactionStrategy;
+ }
+
+ public boolean isCompletionAllowed() {
+ return isCompletionAllowed;
+ }
+
+ public void setCompletionAllowed(boolean isCompletionAllowed) {
+ this.isCompletionAllowed = isCompletionAllowed;
+ }
+}
\ No newline at end of file
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelper.java
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelper.java?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelper.java (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelper.java Sun Feb 27 18:37:11 2011
@@ -0,0 +1,31 @@
+/*
+ * 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.aries.transaction;
+
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+
+public interface TxComponentMetaDataHelper {
+
+ public void setComponentTransactionData(ComponentMetadata component, String value,
+ String method);
+
+ public String getComponentMethodTxStrategy(
+ ComponentMetadata component, String methodName);
+
+}
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelperImpl.java
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelperImpl.java?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelperImpl.java (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxComponentMetaDataHelperImpl.java Sun Feb 27 18:37:11 2011
@@ -0,0 +1,175 @@
+/*
+ * 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.aries.transaction;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+
+public class TxComponentMetaDataHelperImpl implements TxComponentMetaDataHelper {
+
+ private static class TranData
+ {
+ private static final Pattern WILDCARD = Pattern.compile("\\Q.*\\E");
+ private final Map<Pattern, String> map;
+ private final Map<String, String> cache;
+
+ public TranData() {
+ map = new ConcurrentHashMap<Pattern, String>();
+ cache = new ConcurrentHashMap<String, String>();
+ }
+
+ public void add(Pattern pattern, String strategy) {
+ map.put(pattern, strategy);
+ }
+
+ public String getStrategy(String name)
+ {
+ String strategy = cache.get(name);
+
+ if (strategy == null) {
+ List<Pattern> matches = findMatches(name);
+ int size = matches.size();
+
+ if (size == 0) {
+ strategy = "Required";
+ }
+ else if (size == 1) {
+ strategy = map.get(matches.get(0));
+ }
+ else {
+ matches = selectPatternsWithFewestWildcards(matches);
+ size = matches.size();
+
+ if (size == 1) {
+ strategy = map.get(matches.get(0));
+ }
+ else {
+ matches = selectLongestPatterns(matches);
+ size = matches.size();
+
+ if (size == 1) {
+ strategy = map.get(matches.get(0));
+ }
+ else {
+ throw new IllegalStateException("Unable to apply patterns: " + matches);
+ }
+ }
+ }
+
+ cache.put(name, strategy);
+ }
+
+ return strategy;
+ }
+
+ private List<Pattern> findMatches(String name)
+ {
+ List<Pattern> matches = new ArrayList<Pattern>();
+ for (Pattern p : map.keySet()) {
+ if (p.matcher(name).matches()) {
+ matches.add(p);
+ }
+ }
+ return matches;
+ }
+
+ private List<Pattern> selectPatternsWithFewestWildcards(List<Pattern> matches) {
+ List<Pattern> remainingMatches = new ArrayList<Pattern>();
+ int minWildcards = Integer.MAX_VALUE;
+
+ for (Pattern p : matches) {
+ String pattern = p.pattern();
+ Matcher m = WILDCARD.matcher(pattern);
+ int count = 0;
+
+ while (m.find()) {
+ count++;
+ }
+
+ if (count < minWildcards) {
+ remainingMatches.clear();
+ remainingMatches.add(p);
+ minWildcards = count;
+ }
+ else if (count == minWildcards) {
+ remainingMatches.add(p);
+ }
+ }
+
+ return remainingMatches;
+ }
+
+ private List<Pattern> selectLongestPatterns(List<Pattern> matches) {
+ List<Pattern> remainingMatches = new ArrayList<Pattern>();
+ int longestLength = 0;
+
+ for (Pattern p : matches) {
+ String pattern = p.pattern();
+ int length = pattern.length();
+
+ if (length > longestLength) {
+ remainingMatches.clear();
+ remainingMatches.add(p);
+ longestLength = length;
+ }
+ else if (length == longestLength) {
+ remainingMatches.add(p);
+ }
+ }
+
+ return remainingMatches;
+ }
+ }
+
+ private final Map<ComponentMetadata, TranData> data = new ConcurrentHashMap<ComponentMetadata, TranData>();
+
+ public synchronized void setComponentTransactionData(ComponentMetadata component, String value, String method)
+ {
+ TranData td = data.get(component);
+
+ if (td == null) {
+ td = new TranData();
+ data.put(component, td);
+ }
+
+ String[] names = method.split("[, \t]");
+
+ for (int i = 0; i < names.length; i++) {
+ Pattern pattern = Pattern.compile(names[i].replaceAll("\\*", ".*"));
+ td.add(pattern, value);
+ }
+ }
+
+ public String getComponentMethodTxStrategy(ComponentMetadata component, String methodName)
+ {
+ TranData td = data.get(component);
+ String result = null;
+
+ if (td != null)
+ result = td.getStrategy(methodName);
+
+ return result;
+ }
+}
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java Sun Feb 27 18:37:11 2011
@@ -0,0 +1,115 @@
+/*
+ * 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.aries.transaction;
+
+import java.lang.reflect.Method;
+
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+import org.apache.aries.blueprint.Interceptor;
+import org.apache.aries.transaction.exception.TransactionRollbackException;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TxInterceptorImpl implements Interceptor {
+ private static final Logger LOGGER =
+ LoggerFactory.getLogger(TxInterceptorImpl.class);
+
+ private TransactionManager tm;
+ private TxComponentMetaDataHelper metaDataHelper;
+
+ public int getRank()
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public void postCallWithException(ComponentMetadata cm, Method m,
+ Throwable ex, Object preCallToken)
+ {
+ if (preCallToken instanceof TransactionToken)
+ {
+ final TransactionToken token = (TransactionToken)preCallToken;
+ try {
+ Transaction tran = token.getActiveTransaction();
+ if (tran != null) {
+ if (ex instanceof RuntimeException || ex instanceof Error) {
+ tran.setRollbackOnly();
+ } else {
+ //declared exception, we don't set rollback
+ }
+ }
+
+ token.getTransactionStrategy().finish(tm, token);
+ }
+ catch (Exception e)
+ {
+ // we do not throw the exception since there already is one, but we need to log it
+ LOGGER.error("An exception has occured.", e);
+ }
+ } else {
+ // TODO: what now?
+ }
+ }
+
+ public void postCallWithReturn(ComponentMetadata cm, Method m,
+ Object returnType, Object preCallToken) throws Exception
+ {
+ if (preCallToken instanceof TransactionToken)
+ {
+ final TransactionToken token = (TransactionToken)preCallToken;
+ try {
+ token.getTransactionStrategy().finish(tm, token);
+ }
+ catch (Exception e)
+ {
+ LOGGER.error("An exception has occured.", e);
+ throw new TransactionRollbackException(e);
+ }
+ }
+ else {
+ // TODO: what now?
+ }
+ }
+
+ public Object preCall(ComponentMetadata cm, Method m,
+ Object... parameters) throws Throwable {
+ final String methodName = m.getName();
+ final String strategy = metaDataHelper.getComponentMethodTxStrategy(cm, methodName);
+
+ TransactionStrategy txStrategy = TransactionStrategy.fromValue(strategy);
+
+ if (LOGGER.isDebugEnabled())
+ LOGGER.debug("Method: " + m + ", has transaction strategy: " + txStrategy);
+
+ return txStrategy.begin(tm);
+ }
+
+ public final void setTransactionManager(TransactionManager manager)
+ {
+ tm = manager;
+ }
+
+ public final void setTxMetaDataHelper(TxComponentMetaDataHelper transactionEnhancer)
+ {
+ this.metaDataHelper = transactionEnhancer;
+ }
+}
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/exception/TransactionRollbackException.java
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/exception/TransactionRollbackException.java?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/exception/TransactionRollbackException.java (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/exception/TransactionRollbackException.java Sun Feb 27 18:37:11 2011
@@ -0,0 +1,27 @@
+/*
+ * 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.aries.transaction.exception;
+
+public class TransactionRollbackException extends RuntimeException {
+ private static final long serialVersionUID = 6156165262745617113L;
+
+ public TransactionRollbackException(Throwable cause) {
+ super(cause);
+ }
+}
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java Sun Feb 27 18:37:11 2011
@@ -0,0 +1,106 @@
+/*
+ * 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.aries.transaction.parsing;
+
+import java.net.URL;
+import java.util.Set;
+
+import org.apache.aries.blueprint.ComponentDefinitionRegistry;
+import org.apache.aries.blueprint.Interceptor;
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.transaction.TxComponentMetaDataHelper;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class TxElementHandler implements NamespaceHandler {
+ private static final Logger LOGGER =
+ LoggerFactory.getLogger(TxElementHandler.class);
+
+ private TxComponentMetaDataHelper metaDataHelper;
+ private Interceptor interceptor = null;
+
+ private void parseElement(Element elt, ComponentMetadata cm, ParserContext pc)
+ {
+ if (LOGGER.isDebugEnabled())
+ LOGGER.debug("parser asked to parse .. " + elt);
+
+ if ("transaction".equals(elt.getLocalName())) {
+ if (LOGGER.isDebugEnabled())
+ LOGGER.debug("parser adding interceptor for " + elt);
+
+ ComponentDefinitionRegistry cdr = pc.getComponentDefinitionRegistry();
+ cdr.registerInterceptorWithComponent(cm, interceptor);
+ if (LOGGER.isDebugEnabled())
+ LOGGER.debug("parser setting comp trans data for " + elt.getAttribute("value") + " "
+ + elt.getAttribute("method"));
+
+ metaDataHelper.setComponentTransactionData(cm, elt.getAttribute("value"), elt
+ .getAttribute("method"));
+ }
+
+ if (LOGGER.isDebugEnabled())
+ LOGGER.debug("parser done with " + elt);
+ }
+
+ public ComponentMetadata decorate(Node node, ComponentMetadata cm, ParserContext pc)
+ {
+ if (node instanceof Element) {
+ Element elt = (Element) node;
+ parseElement(elt, cm, pc);
+ }
+ return cm;
+ }
+
+ public Metadata parse(Element elt, ParserContext pc)
+ {
+ //really not sure here if using enclosing component is valid...
+ //TODO: confirm if null may be better.
+ parseElement(elt, pc.getEnclosingComponent(), pc);
+ return null;
+ }
+
+ public URL getSchemaLocation(String arg0)
+ {
+ return this.getClass().getResource("transaction.xsd");
+ }
+
+ public final void setTxMetaDataHelper(TxComponentMetaDataHelper transactionEnhancer)
+ {
+ this.metaDataHelper = transactionEnhancer;
+ }
+
+ public final void setTransactionInterceptor(Interceptor itx)
+ {
+ if (LOGGER.isDebugEnabled())
+ LOGGER.debug("parser having interceptor set " + itx);
+
+ this.interceptor = itx;
+ }
+
+ public Set<Class> getManagedClasses()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml Sun Feb 27 18:37:11 2011
@@ -0,0 +1,50 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ default-activation="lazy">
+
+ <service interface="org.apache.aries.blueprint.NamespaceHandler">
+ <service-properties>
+ <entry key="osgi.service.blueprint.namespace" value="http://aries.apache.org/xmlns/transactions/v1.0.0"/>
+ </service-properties>
+ <bean class="org.apache.aries.transaction.parsing.TxElementHandler">
+ <property ref="txenhancer" name="txMetaDataHelper"/>
+ <property ref="txinterceptor" name="transactionInterceptor"/>
+ </bean>
+ </service>
+
+ <bean id="txenhancer" class="org.apache.aries.transaction.TxComponentMetaDataHelperImpl"/>
+
+ <bean id="txinterceptor" class="org.apache.aries.transaction.TxInterceptorImpl">
+ <property name="transactionManager" ref="tm"/>
+ <property ref="txenhancer" name="txMetaDataHelper"/>
+ </bean>
+
+ <reference id="tm" interface="javax.transaction.TransactionManager"/>
+
+ <service ref="txinterceptor" interface="org.apache.aries.blueprint.Interceptor">
+ <service-properties>
+ <entry key="namespace" value="http://aries.apache.org/xmlns/transactions/v1.0.0"/>
+ </service-properties>
+ </service>
+
+</blueprint>
\ No newline at end of file
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/apache/aries/transaction/parsing/transaction.xsd
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/apache/aries/transaction/parsing/transaction.xsd?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/apache/aries/transaction/parsing/transaction.xsd (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/main/resources/org/apache/aries/transaction/parsing/transaction.xsd Sun Feb 27 18:37:11 2011
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ 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.
+
+-->
+<xsd:schema xmlns="http://aries.apache.org/xmlns/transactions/v1.0.0"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://aries.apache.org/xmlns/transactions/v1.0.0"
+ elementFormDefault="qualified" attributeFormDefault="unqualified"
+ version="1.0.0">
+
+<xsd:simpleType name="TtransactionStrategy">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="Required"/>
+ <xsd:enumeration value="Mandatory"/>
+ <xsd:enumeration value="RequiresNew"/>
+ <xsd:enumeration value="Supports"/>
+ <xsd:enumeration value="NotSupported"/>
+ <xsd:enumeration value="Never"/>
+ </xsd:restriction>
+</xsd:simpleType>
+
+<xsd:complexType name="Ttransaction">
+ <xsd:attribute name="method" type="xsd:string"/>
+ <xsd:attribute name="value" type="TtransactionStrategy"/>
+</xsd:complexType>
+
+<xsd:element name="transaction" type="Ttransaction">
+</xsd:element>
+
+
+</xsd:schema>
\ No newline at end of file
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/InterceptorTest.java
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/InterceptorTest.java?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/InterceptorTest.java (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/InterceptorTest.java Sun Feb 27 18:37:11 2011
@@ -0,0 +1,64 @@
+/*
+ * 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.aries.transaction;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+import org.junit.Test;
+
+import org.apache.aries.unittest.mocks.MethodCall;
+import org.apache.aries.unittest.mocks.Skeleton;
+
+public class InterceptorTest {
+ private Transaction t;
+
+ @Test
+ public void testRollbackOnException() {
+ TxInterceptorImpl sut = new TxInterceptorImpl();
+ sut.setTransactionManager(Skeleton.newMock(TransactionManager.class));
+
+ sut.postCallWithException(null, null, new IllegalStateException(), newTranToken());
+ assertRolledBack();
+ sut.postCallWithException(null, null, new Error(), newTranToken());
+ assertRolledBack();
+
+ sut.postCallWithException(null, null, new Exception(), newTranToken());
+ assertNotRolledBack();
+ sut.postCallWithException(null, null, new IOException(), newTranToken());
+ assertNotRolledBack();
+ }
+
+ private void assertNotRolledBack() {
+ Skeleton.getSkeleton(t).assertNotCalled(new MethodCall(Transaction.class, "setRollbackOnly"));
+ }
+
+ private void assertRolledBack() {
+ Skeleton.getSkeleton(t).assertCalled(new MethodCall(Transaction.class, "setRollbackOnly"));
+ }
+
+ private TransactionToken newTranToken() {
+ t = Skeleton.newMock(Transaction.class);
+ return new TransactionToken(t, null, TransactionStrategy.REQUIRED);
+ }
+}
Added: aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/NameSpaceHandlerTest.java
URL: http://svn.apache.org/viewvc/aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/NameSpaceHandlerTest.java?rev=1075109&view=auto
==============================================================================
--- aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/NameSpaceHandlerTest.java (added)
+++ aries/tags/transaction-0.1-incubating/transaction-blueprint/src/test/java/org/apache/aries/transaction/NameSpaceHandlerTest.java Sun Feb 27 18:37:11 2011
@@ -0,0 +1,100 @@
+/*
+ * 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.aries.transaction;
+
+import static org.junit.Assert.assertEquals;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.transaction.TransactionManager;
+
+import org.apache.aries.mocks.BundleMock;
+
+import org.apache.aries.blueprint.ComponentDefinitionRegistry;
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.container.NamespaceHandlerRegistry;
+import org.apache.aries.blueprint.container.Parser;
+import org.apache.aries.blueprint.container.NamespaceHandlerRegistry.NamespaceHandlerSet;
+import org.apache.aries.blueprint.namespace.ComponentDefinitionRegistryImpl;
+import org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+
+import org.apache.aries.transaction.TxComponentMetaDataHelperImpl;
+import org.apache.aries.transaction.TxInterceptorImpl;
+import org.apache.aries.transaction.parsing.TxElementHandler;
+import org.apache.aries.unittest.mocks.Skeleton;
+
+public class NameSpaceHandlerTest {
+
+
+ @Test
+ public void testMultipleElements() throws Exception
+ {
+ Bundle b = Skeleton.newMock(new BundleMock("org.apache.aries.tx", new Properties()), Bundle.class);
+ BundleContext ctx = b.getBundleContext();
+ NamespaceHandlerRegistry nhri = new NamespaceHandlerRegistryImpl(ctx);
+
+ TransactionManager tm = Skeleton.newMock(TransactionManager.class);
+
+ TxComponentMetaDataHelperImpl txenhancer = new TxComponentMetaDataHelperImpl();
+
+ TxInterceptorImpl txinterceptor = new TxInterceptorImpl();
+ txinterceptor.setTransactionManager(tm);
+ txinterceptor.setTxMetaDataHelper(txenhancer);
+
+ TxElementHandler namespaceHandler = new TxElementHandler();
+ namespaceHandler.setTransactionInterceptor(txinterceptor);
+ namespaceHandler.setTxMetaDataHelper(txenhancer);
+
+ Properties props = new Properties();
+ props.put("osgi.service.blueprint.namespace", "http://aries.apache.org/xmlns/transactions/v1.0.0");
+ ctx.registerService(NamespaceHandler.class.getName(), namespaceHandler, props);
+ Parser p = new Parser();
+
+ URL bpxml = this.getClass().getResource("aries.xml");
+ List<URL> bpxmlList = new LinkedList<URL>();
+ bpxmlList.add(bpxml);
+
+ p.parse(bpxmlList);
+ Set<URI> nsuris = p.getNamespaces();
+ NamespaceHandlerSet nshandlers = nhri.getNamespaceHandlers(nsuris, b);
+ p.validate(nshandlers.getSchema());
+
+ ComponentDefinitionRegistry cdr = new ComponentDefinitionRegistryImpl();
+ p.populate(nshandlers, cdr);
+
+ BeanMetadata comp = (BeanMetadata) cdr.getComponentDefinition("top");
+
+ BeanMetadata anon = (BeanMetadata) ((BeanProperty) comp.getProperties().get(0)).getValue();
+ BeanMetadata anonToo = (BeanMetadata) ((BeanProperty) comp.getProperties().get(1)).getValue();
+
+ assertEquals("Required", txenhancer.getComponentMethodTxStrategy(anon, "doSomething"));
+ assertEquals("Never", txenhancer.getComponentMethodTxStrategy(anonToo, "doSomething"));
+
+ }
+}