svn commit: r1619982 - in /ofbiz/branches/framework-api-cleanup/framework: entity/src/org/ofbiz/entity/jdbc/ entity/src/org/ofbiz/entity/transaction/ geronimo/src/org/ofbiz/geronimo/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1619982 - in /ofbiz/branches/framework-api-cleanup/framework: entity/src/org/ofbiz/entity/jdbc/ entity/src/org/ofbiz/entity/transaction/ geronimo/src/org/ofbiz/geronimo/

jacopoc
Author: jacopoc
Date: Sat Aug 23 08:06:22 2014
New Revision: 1619982

URL: http://svn.apache.org/r1619982
Log:
Removed all the wrappers methods around ConnectionFactoryInterface methods: they are not required now that the client code can use the interface methods.

Modified:
    ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java
    ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java
    ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java
    ofbiz/branches/framework-api-cleanup/framework/geronimo/src/org/ofbiz/geronimo/GeronimoTransactionFactory.java

Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java?rev=1619982&r1=1619981&r2=1619982&view=diff
==============================================================================
--- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java (original)
+++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java Sat Aug 23 08:06:22 2014
@@ -23,16 +23,11 @@ import java.sql.Driver;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.util.Properties;
-import java.util.concurrent.atomic.AtomicReference;
 
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.config.model.EntityConfig;
-import org.ofbiz.entity.config.model.JdbcElement;
 import org.ofbiz.entity.connection.ConnectionFactoryInterface;
-import org.ofbiz.entity.datasource.GenericHelperInfo;
-import org.ofbiz.entity.transaction.TransactionFactoryLoader;
 
 /**
  * ConnectionFactory - central source for JDBC connections
@@ -95,14 +90,6 @@ public class ConnectionFactory {
         return getConnection(null, connectionUrl, props, null, null);
     }
 
-    public static Connection getManagedConnection(GenericHelperInfo helperInfo, JdbcElement jdbcElement) throws SQLException, GenericEntityException {
-        return getInstance().getConnection(helperInfo, jdbcElement);
-    }
-
-    public static void closeAllManagedConnections() {
-        getInstance().closeAll();
-    }
-
     public static void loadDriver(String driverName) throws SQLException {
         if (DriverManager.getDriver(driverName) == null) {
             try {

Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java?rev=1619982&r1=1619981&r2=1619982&view=diff
==============================================================================
--- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java (original)
+++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java Sat Aug 23 08:06:22 2014
@@ -111,7 +111,7 @@ public class DumbFactory implements Tran
         Datasource datasourceInfo = EntityConfig.getDatasource(helperInfo.getHelperBaseName());
 
         if (datasourceInfo.getInlineJdbc() != null) {
-            Connection otherCon = ConnectionFactory.getManagedConnection(helperInfo, datasourceInfo.getInlineJdbc());
+            Connection otherCon = ConnectionFactory.getInstance().getConnection(helperInfo, datasourceInfo.getInlineJdbc());
             return TransactionUtil.getCursorConnection(helperInfo, otherCon);
         } else {
             Debug.logError("Dumb/Empty is the configured transaction manager but no inline-jdbc element was specified in the " + helperInfo.getHelperBaseName() + " datasource. Please check your configuration", module);

Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java?rev=1619982&r1=1619981&r2=1619982&view=diff
==============================================================================
--- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java (original)
+++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java Sat Aug 23 08:06:22 2014
@@ -145,7 +145,7 @@ public class JNDIFactory implements Tran
         }
 
         if (datasourceInfo.getInlineJdbc() != null) {
-            Connection otherCon = ConnectionFactory.getManagedConnection(helperInfo, datasourceInfo.getInlineJdbc());
+            Connection otherCon = ConnectionFactory.getInstance().getConnection(helperInfo, datasourceInfo.getInlineJdbc());
             return TransactionUtil.getCursorConnection(helperInfo, otherCon);
         } else {
             //no real need to print an error here

Modified: ofbiz/branches/framework-api-cleanup/framework/geronimo/src/org/ofbiz/geronimo/GeronimoTransactionFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/geronimo/src/org/ofbiz/geronimo/GeronimoTransactionFactory.java?rev=1619982&r1=1619981&r2=1619982&view=diff
==============================================================================
--- ofbiz/branches/framework-api-cleanup/framework/geronimo/src/org/ofbiz/geronimo/GeronimoTransactionFactory.java (original)
+++ ofbiz/branches/framework-api-cleanup/framework/geronimo/src/org/ofbiz/geronimo/GeronimoTransactionFactory.java Sat Aug 23 08:06:22 2014
@@ -80,7 +80,7 @@ public class GeronimoTransactionFactory
         Datasource datasourceInfo = EntityConfig.getDatasource(helperInfo.getHelperBaseName());
 
         if (datasourceInfo != null && datasourceInfo.getInlineJdbc() != null) {
-            return ConnectionFactory.getManagedConnection(helperInfo, datasourceInfo.getInlineJdbc());
+            return ConnectionFactory.getInstance().getConnection(helperInfo, datasourceInfo.getInlineJdbc());
         } else {
             Debug.logError("Geronimo is the configured transaction manager but no inline-jdbc element was specified in the " + helperInfo.getHelperBaseName() + " datasource. Please check your configuration", module);
             return null;
@@ -88,7 +88,7 @@ public class GeronimoTransactionFactory
     }
 
     public void shutdown() {
-        ConnectionFactory.closeAllManagedConnections();
+        ConnectionFactory.getInstance().closeAll();
         /*
         if (transactionContextManager != null) {
             // TODO: need to do anything for this?