incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r923407 - in /incubator/aries/trunk/samples/ariestrader-sample: assemblies/equinox-test-harness/ assemblies/equinox-test-harness/src/main/filtered-resources/configuration/ modules/ariestrader-core/src/main/java/org/apache/aries/samples/arie...
Date Mon, 15 Mar 2010 19:42:56 GMT
Author: jbohn
Date: Mon Mar 15 19:42:55 2010
New Revision: 923407

URL: http://svn.apache.org/viewvc?rev=923407&view=rev
Log:
ARIES-241 leverage the transaction.wrappers bundle to enlist datasource in xa transaction
for AriesTrader

Added:
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/blueprint/
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  (with props)
Removed:
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/java/
Modified:
    incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/pom.xml
    incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/src/main/filtered-resources/configuration/config.ini
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeDBManagerImpl.java
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/pom.xml
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-entities/src/main/resources/META-INF/persistence.xml
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java
    incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java

Modified: incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/pom.xml?rev=923407&r1=923406&r2=923407&view=diff
==============================================================================
--- incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/pom.xml
(original)
+++ incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/pom.xml
Mon Mar 15 19:42:55 2010
@@ -84,6 +84,14 @@
             <artifactId>geronimo-jta_1.1_spec</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.geronimo.components</groupId>
+            <artifactId>geronimo-transaction</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.openjpa</groupId>
             <artifactId>openjpa</artifactId>
         </dependency>
@@ -103,10 +111,17 @@
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.serp</artifactId>
         </dependency>
+<!--
         <dependency>
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
         </dependency>
+-->
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <version>3.2</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.fileinstall</artifactId>
@@ -153,6 +168,10 @@
             <artifactId>org.apache.aries.transaction.manager</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.aries.transaction</groupId>
+            <artifactId>org.apache.aries.transaction.wrappers</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.aries.application</groupId>
             <artifactId>org.apache.aries.application.install</artifactId>
         </dependency>

Modified: incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/src/main/filtered-resources/configuration/config.ini
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/src/main/filtered-resources/configuration/config.ini?rev=923407&r1=923406&r2=923407&view=diff
==============================================================================
--- incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/src/main/filtered-resources/configuration/config.ini
(original)
+++ incubator/aries/trunk/samples/ariestrader-sample/assemblies/equinox-test-harness/src/main/filtered-resources/configuration/config.ini
Mon Mar 15 19:42:55 2010
@@ -1,6 +1,7 @@
 osgi.bundles=\
 cm-3.2.0-v20070116.jar@start,\
 services-3.1.200-v20070605.jar@start,\
+asm-all-3.2.jar@start,\
 pax-logging-api-1.4.jar@start,\
 pax-logging-service-1.4.jar@start,\
 derby-10.5.3.0_1.jar@start,\
@@ -8,10 +9,11 @@ commons-collections-3.2.1.jar@start,\
 commons-lang-2.5.jar@start,\
 commons-pool-1.5.4.jar@start,\
 org.apache.servicemix.bundles.serp-1.13.1_2.jar@start,\
-org.apache.servicemix.bundles.cglib-2.1_3_4.jar@start,\
 openjpa-2.0.0-beta2.jar@start,\
+geronimo-j2ee-connector_1.5_spec-2.0.0.jar@start,\
 geronimo-jpa_2.0_spec-1.0.jar@start,\
 geronimo-jta_1.1_spec-1.1.1.jar@start,\
+geronimo-transaction-2.1.3.jar@start,\
 pax-web-jetty-bundle-0.7.2.jar@start,\
 pax-web-extender-war-0.7.2.jar@start,\
 pax-web-jsp-0.7.2.jar@start,\
@@ -30,6 +32,7 @@ org.apache.aries.util-${ariesUtilVersion
 org.apache.aries.blueprint-${ariesBlueprintVersion}.jar@start,\
 org.apache.aries.transaction.blueprint-${ariesTransactionVersion}.jar@start,\
 org.apache.aries.transaction.manager-${ariesTransactionVersion}.jar@start,\
+org.apache.aries.transaction.wrappers-${ariesTransactionVersion}.jar@start,\
 org.apache.aries.samples.ariestrader.derby.ds-${version}.jar@start
 eclipse.ignoreApp=true
 org.ops4j.pax.logging.DefaultServiceLog.level=DEBUG
\ No newline at end of file

Modified: incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeDBManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeDBManagerImpl.java?rev=923407&r1=923406&r2=923407&view=diff
==============================================================================
--- incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeDBManagerImpl.java
(original)
+++ incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeDBManagerImpl.java
Mon Mar 15 19:42:55 2010
@@ -46,8 +46,6 @@ import java.sql.Statement;
 
 public class TradeDBManagerImpl implements TradeDBManager {
 
-    private static String dsName = TradeConfig.DS_NAME;
-
     private DataSource dataSource = null;
 
     private static InitialContext context;
@@ -386,7 +384,6 @@ public class TradeDBManagerImpl implemen
      */
     private void lookupDataSource() throws Exception {
         if (dataSource == null) {
-//            dataSource = (DataSource) ServiceUtilities.getOSGIService(DataSource.class.getName(),"(osgi.jndi.serviceName=jdbc/TradeDataSource)");
             dataSource = (DataSource) ServiceUtilities.getOSGIService(DataSource.class.getName(),TradeConfig.OSGI_DS_NAME_FILTER);
         }
     }

Modified: incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/pom.xml?rev=923407&r1=923406&r2=923407&view=diff
==============================================================================
--- incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/pom.xml
(original)
+++ incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/pom.xml
Mon Mar 15 19:42:55 2010
@@ -32,15 +32,18 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.eclipse</groupId>
-            <artifactId>osgi</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derby</artifactId>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.aries.transaction</groupId>
+            <artifactId>org.apache.aries.transaction.blueprint</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.components</groupId>
+            <artifactId>geronimo-transaction</artifactId>
+        </dependency>
     </dependencies>
 
     <build>
@@ -52,19 +55,6 @@
                     <instructions>
                         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                         <Bundle-Version>${pom.version}</Bundle-Version>
-                        <Bundle-Activator>org.apache.aries.samples.ariestrader.datasource.derby.DerbyActivator</Bundle-Activator>
-                        <Export-Service>javax.sql.DataSource</Export-Service>
-                        <Export-Package>
-                            <!--org.apache.aries.samples.ariestrader.datasource.derby;version="${pom.version}"-->
-                        </Export-Package>
-                        <Import-Package>
-                            org.osgi.framework,
-                            javax.sql,
-                            org.apache.derby.jdbc
-                        </Import-Package>
-                        <Private-Package>
-                            org.apache.aries.samples.ariestrader.datasource.derby
-                        </Private-Package>
                     </instructions>
                 </configuration>
             </plugin>

Added: incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=923407&view=auto
==============================================================================
--- incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/blueprint/blueprint.xml
(added)
+++ incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Mon Mar 15 19:42:55 2010
@@ -0,0 +1,45 @@
+<?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="eager">
+  
+    <bean id="derbyXADataSource" class="org.apache.derby.jdbc.EmbeddedXADataSource">
+        <property name="databaseName" value="tradedb"/>
+    </bean>
+  
+    <service id="TradeDataSource" ref="derbyXADataSource" interface="javax.sql.XADataSource">
+        <service-properties>
+            <entry key="osgi.jndi.service.name" value="jdbc/TradeDataSource"/>
+        </service-properties>
+    </service>
+
+  
+    <bean id="derbyDataSource" class="org.apache.derby.jdbc.EmbeddedDataSource">
+        <property name="databaseName" value="tradedb"/>
+    </bean>
+  
+    <service id="NoTxTradeDataSource" ref="derbyDataSource" interface="javax.sql.DataSource">
+        <service-properties>
+            <entry key="xa.aware" value="false"/>
+            <entry key="osgi.jndi.service.name" value="jdbc/NoTxTradeDataSource"/>
+        </service-properties>
+    </service>
+  
+</blueprint>

Propchange: incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/blueprint/blueprint.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/blueprint/blueprint.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-derby-ds/src/main/resources/OSGI-INF/blueprint/blueprint.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-entities/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-entities/src/main/resources/META-INF/persistence.xml?rev=923407&r1=923406&r2=923407&view=diff
==============================================================================
--- incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-entities/src/main/resources/META-INF/persistence.xml
(original)
+++ incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-entities/src/main/resources/META-INF/persistence.xml
Mon Mar 15 19:42:55 2010
@@ -19,8 +19,8 @@
 
     <persistence-unit transaction-type="RESOURCE_LOCAL" name="ariestrader-am">
         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
-        <jta-data-source>aries:services/javax.sql.DataSource/(osgi.jndi.serviceName=jdbc/TradeDataSource)</jta-data-source>
-        <non-jta-data-source>aries:services/javax.sql.DataSource/(osgi.jndi.serviceName=jdbc/NoTxTradeDataSource)</non-jta-data-source>
+        <jta-data-source>aries:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/TradeDataSource)</jta-data-source>
+        <non-jta-data-source>aries:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/NoTxTradeDataSource)</non-jta-data-source>
          
         <class>org.apache.aries.samples.ariestrader.entities.AccountDataBeanImpl</class>
         <class>org.apache.aries.samples.ariestrader.entities.AccountProfileDataBeanImpl</class>
@@ -38,8 +38,10 @@
         
     <persistence-unit transaction-type="JTA" name="ariestrader-cm">
         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
-        <jta-data-source>aries:services/javax.sql.DataSource/(osgi.jndi.serviceName=jdbc/TradeDataSource)</jta-data-source>
-        <non-jta-data-source>aries:services/javax.sql.DataSource/(osgi.jndi.serviceName=jdbc/NoTxTradeDataSource)</non-jta-data-source>
+        <!--<jta-data-source>aries:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/TradeDataSource)</jta-data-source>-->
+        <!--<non-jta-data-source>aries:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/NoTxTradeDataSource)</non-jta-data-source>-->
+        <jta-data-source>aries:services/javax.sql.DataSource/(xa.aware=true)</jta-data-source>
+        <non-jta-data-source>aries:services/javax.sql.DataSource/(xa.aware=false)</non-jta-data-source>
          
         <class>org.apache.aries.samples.ariestrader.entities.AccountDataBeanImpl</class>
         <class>org.apache.aries.samples.ariestrader.entities.AccountProfileDataBeanImpl</class>

Modified: incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java?rev=923407&r1=923406&r2=923407&view=diff
==============================================================================
--- incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java
(original)
+++ incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java
Mon Mar 15 19:42:55 2010
@@ -69,8 +69,6 @@ import java.sql.Timestamp;
 
 public class TradeJdbc implements TradeServices {
 
-    private static String dsName = TradeConfig.DS_NAME;
-
     private DataSource dataSource= null;
 
     private static BigDecimal ZERO = new BigDecimal(0.0);
@@ -1482,7 +1480,6 @@ public class TradeJdbc implements TradeS
      */
     private void lookupDataSource() throws Exception {
         if (dataSource == null) {
-//            dataSource = (DataSource) ServiceUtilities.getOSGIService(DataSource.class.getName(),"(osgi.jndi.serviceName=jdbc/TradeDataSource)");
             dataSource = (DataSource) ServiceUtilities.getOSGIService(DataSource.class.getName(),TradeConfig.OSGI_DS_NAME_FILTER);
         }
     }

Modified: incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java?rev=923407&r1=923406&r2=923407&view=diff
==============================================================================
--- incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java
(original)
+++ incubator/aries/trunk/samples/ariestrader-sample/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java
Mon Mar 15 19:42:55 2010
@@ -89,11 +89,10 @@ public class TradeConfig {
 	/* Trade Database specific paramters */
 	public static String JDBC_UID = null;
 	public static String JDBC_PWD = null;
-	public static String DS_NAME = "java:comp/env/jdbc/TradeDataSource";
 
         /* OSGi specific parameters */
 	public static String OSGI_SERVICE_PREFIX = "aries:services/";
-	public static String OSGI_DS_NAME_FILTER = "(osgi.jndi.serviceName=jdbc/TradeDataSource)";
+        public static String OSGI_DS_NAME_FILTER = "(osgi.jndi.service.name=jdbc/NoTxTradeDataSource)";
 
 	/*Trade SOAP specific parameters */
 	private static String SoapURL =



Mime
View raw message