aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r1080214 - /aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
Date Thu, 10 Mar 2011 13:28:39 GMT
Author: not
Date: Thu Mar 10 13:28:39 2011
New Revision: 1080214

URL: http://svn.apache.org/viewvc?rev=1080214&view=rev
Log:
ARIES-601 Add changes to increase service ranking for wrappered XADataSource.

Modified:
    aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java

Modified: aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java?rev=1080214&r1=1080213&r2=1080214&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
(original)
+++ aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/Activator.java
Thu Mar 10 13:28:39 2011
@@ -21,6 +21,7 @@ package org.apache.aries.transaction.jdb
 import org.apache.aries.util.AriesFrameworkUtil;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
@@ -81,6 +82,16 @@ public class Activator implements Bundle
       map.put(key, ref.getProperty(key));
     }
     map.put("aries.xa.aware", "true");
+    
+    // make the ranking for our new better wrappered data source higher so
+    // it is the default object looked up using osgi.service.jndi.name.
+    Object rankingProp = map.get(Constants.SERVICE_RANKING);
+    
+    int ranking = 1000;
+    
+    if (rankingProp != null) ranking = ((Integer)rankingProp) + 1000;
+    
+    map.put(Constants.SERVICE_RANKING, ranking);
 
     XADatasourceEnlistingWrapper wrapper = new XADatasourceEnlistingWrapper();
     wrapper.setTxManager(tm);



Mime
View raw message