commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1100136 - in /commons/proper/dbcp/trunk: doc/ src/java/org/apache/commons/dbcp2/ src/java/org/apache/commons/jocl2/ src/test/ src/test/org/apache/commons/dbcp2/ src/test/org/apache/commons/jocl2/
Date Fri, 06 May 2011 08:52:17 GMT
Author: markt
Date: Fri May  6 08:52:17 2011
New Revision: 1100136

URL: http://svn.apache.org/viewvc?rev=1100136&view=rev
Log:
Remove JOCL and associated references.
Remove references that differentiate between manual and jocl configuration

Added:
    commons/proper/dbcp/trunk/doc/PoolingDataSourceExample.java
      - copied, changed from r1099876, commons/proper/dbcp/trunk/doc/ManualPoolingDataSourceExample.java
    commons/proper/dbcp/trunk/doc/PoolingDriverExample.java
      - copied, changed from r1099876, commons/proper/dbcp/trunk/doc/ManualPoolingDriverExample.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java
      - copied, changed from r1099879, commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestManual.java
Removed:
    commons/proper/dbcp/trunk/doc/JOCLPoolingDriverExample.java
    commons/proper/dbcp/trunk/doc/ManualPoolingDataSourceExample.java
    commons/proper/dbcp/trunk/doc/ManualPoolingDriverExample.java
    commons/proper/dbcp/trunk/doc/poolingDriverExample.jocl.sample
    commons/proper/dbcp/trunk/doc/test.jocl
    commons/proper/dbcp/trunk/src/java/org/apache/commons/jocl2/
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestJOCLed.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestManual.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/jocl2/
    commons/proper/dbcp/trunk/src/test/testpool.jocl
Modified:
    commons/proper/dbcp/trunk/doc/BasicDataSourceExample.java
    commons/proper/dbcp/trunk/doc/README.txt
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDriver.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/package.html

Modified: commons/proper/dbcp/trunk/doc/BasicDataSourceExample.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/BasicDataSourceExample.java?rev=1100136&r1=1100135&r2=1100136&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/doc/BasicDataSourceExample.java (original)
+++ commons/proper/dbcp/trunk/doc/BasicDataSourceExample.java Fri May  6 08:52:17 2011
@@ -31,8 +31,6 @@ import org.apache.commons.dbcp2.BasicDat
 
 //
 // Here's a simple example of how to use the BasicDataSource.
-// In this example, we'll construct the BasicDataSource manually,
-// but you could also configure it using an external conifguration file.
 //
 
 //
@@ -63,7 +61,7 @@ import org.apache.commons.dbcp2.BasicDat
 // For example:
 //  java -Djdbc.drivers=oracle.jdbc.driver.OracleDriver \
 //       -classpath commons-pool-1.5.6.jar:commons-dbcp-1.4.jar:j2ee.jar:oracle-jdbc.jar:.
\
-//       ManualPoolingDataSourceExample
+//       PoolingDataSourceExample
 //       "jdbc:oracle:thin:scott/tiger@myhost:1521:mysid"
 //       "SELECT * FROM DUAL"
 //

Copied: commons/proper/dbcp/trunk/doc/PoolingDataSourceExample.java (from r1099876, commons/proper/dbcp/trunk/doc/ManualPoolingDataSourceExample.java)
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/PoolingDataSourceExample.java?p2=commons/proper/dbcp/trunk/doc/PoolingDataSourceExample.java&p1=commons/proper/dbcp/trunk/doc/ManualPoolingDataSourceExample.java&r1=1099876&r2=1100136&rev=1100136&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/doc/ManualPoolingDataSourceExample.java (original)
+++ commons/proper/dbcp/trunk/doc/PoolingDataSourceExample.java Fri May  6 08:52:17 2011
@@ -36,10 +36,6 @@ import org.apache.commons.dbcp2.DriverMa
 
 //
 // Here's a simple example of how to use the PoolingDataSource.
-// In this example, we'll construct the PoolingDataSource manually,
-// just to show how the pieces fit together, but you could also
-// configure it using an external configuration file in
-// JOCL format (and eventually Digester).
 //
 
 //
@@ -72,11 +68,11 @@ import org.apache.commons.dbcp2.DriverMa
 // For example:
 //  java -Djdbc.drivers=oracle.jdbc.driver.OracleDriver \
 //       -classpath commons-pool-1.5.6.jar:commons-dbcp-1.4.jar:j2ee.jar:oracle-jdbc.jar:.
\
-//       ManualPoolingDataSourceExample \
+//       PoolingDataSourceExample \
 //       "jdbc:oracle:thin:scott/tiger@myhost:1521:mysid" \
 //       "SELECT * FROM DUAL"
 //
-public class ManualPoolingDataSourceExample {
+public class PoolingDataSourceExample {
 
     public static void main(String[] args) {
         //

Copied: commons/proper/dbcp/trunk/doc/PoolingDriverExample.java (from r1099876, commons/proper/dbcp/trunk/doc/ManualPoolingDriverExample.java)
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/PoolingDriverExample.java?p2=commons/proper/dbcp/trunk/doc/PoolingDriverExample.java&p1=commons/proper/dbcp/trunk/doc/ManualPoolingDriverExample.java&r1=1099876&r2=1100136&rev=1100136&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/doc/ManualPoolingDriverExample.java (original)
+++ commons/proper/dbcp/trunk/doc/PoolingDriverExample.java Fri May  6 08:52:17 2011
@@ -36,10 +36,6 @@ import org.apache.commons.dbcp2.DriverMa
 
 //
 // Here's a simple example of how to use the PoolingDriver.
-// In this example, we'll construct the PoolingDriver manually,
-// just to show how the pieces fit together, but you could also
-// configure it using an external conifguration file in
-// JOCL format (and eventually Digester).
 //
 
 //
@@ -65,11 +61,11 @@ import org.apache.commons.dbcp2.DriverMa
 // For example:
 //  java -Djdbc.drivers=oracle.jdbc.driver.OracleDriver \
 //       -classpath commons-pool-1.5.6.jar:commons-dbcp-1.4.jar:oracle-jdbc.jar:. \
-//       ManualPoolingDriverExample \
+//       PoolingDriverExample \
 //       "jdbc:oracle:thin:scott/tiger@myhost:1521:mysid" \
 //       "SELECT * FROM DUAL"
 //
-public class ManualPoolingDriverExample {
+public class PoolingDriverExample {
 
     public static void main(String[] args) {
         //

Modified: commons/proper/dbcp/trunk/doc/README.txt
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/README.txt?rev=1100136&r1=1100135&r2=1100136&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/doc/README.txt (original)
+++ commons/proper/dbcp/trunk/doc/README.txt Fri May  6 08:52:17 2011
@@ -18,33 +18,22 @@ example, the my.sql.Driver is loaded wit
 
 ===================================================================================
 
-ManualPoolingDriverExample.java
+PoolingDriverExample.java
 
  Provides a simple example of how to use the DBCP package with a
- manually configured PoolingDriver.
+ PoolingDriver.
 
  Look at the comments with that file for instructions on how to
  build and run it.
 
-ManualPoolingDataSource.java
+PoolingDataSource.java
 
  Provides a simple example of how to use the DBCP package with a
- manually configured PoolingDataSource.
+ PoolingDataSource.
 
  Look at the comments with that file for instructions on how to
  build and run it.
 
-JOCLPoolingDriverExample.java
-poolingDriverExample.jocl.sample
-
- Provides an example JOCL configuration and JDBC client that
- shows how to use the DBCP PoolingDriver with an external
- configuration. (JOCL will be replaced by Digester when it
- is available in jakarta-commons.)
-
- Look at the comments with those files for instructions on how to
- build and run it.
-
 See also the JavaDoc documentation (use "ant doc" to generate it),
 especially the package documentation for org.apache.commons.dbcp
 for an overview of how it all works.

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDriver.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDriver.java?rev=1100136&r1=1100135&r2=1100136&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDriver.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDriver.java Fri May
 6 08:52:17 2011
@@ -35,7 +35,6 @@ import java.util.NoSuchElementException;
 import java.util.Properties;
 import java.util.Set;
 
-import org.apache.commons.jocl2.JOCLContentHandler;
 import org.apache.commons.pool2.ObjectPool;
 import org.xml.sax.SAXException;
 
@@ -104,38 +103,8 @@ public class PoolingDriver implements Dr
     
     public synchronized ObjectPool getConnectionPool(String name) throws SQLException {
         ObjectPool pool = (ObjectPool)(_pools.get(name));
-        if(null == pool) {
-            InputStream in = this.getClass().getResourceAsStream(String.valueOf(name) + ".jocl");
-            if (in == null) {
-                in = Thread.currentThread().getContextClassLoader(
-                        ).getResourceAsStream(String.valueOf(name) + ".jocl");
-            }
-            if(null != in) {
-                JOCLContentHandler jocl = null;
-                try {
-                    jocl = JOCLContentHandler.parse(in);
-                }
-                catch (SAXException e) {
-                    throw (SQLException) new SQLException("Could not parse configuration
file").initCause(e);
-                }
-                catch (IOException e) {
-                    throw (SQLException) new SQLException("Could not load configuration file").initCause(e);
-                }
-                if(jocl.getType(0).equals(String.class)) {
-                    pool = getPool((String)(jocl.getValue(0)));
-                    if(null != pool) {
-                        registerPool(name,pool);
-                    }
-                } else {
-                    pool = ((PoolableConnectionFactory)(jocl.getValue(0))).getPool();
-                    if(null != pool) {
-                        registerPool(name,pool);
-                    }
-                }
-            }
-            else {
-                throw new SQLException("Configuration file not found");
-            }
+        if (null == pool) {
+            throw new SQLException("Pool not registered.");
         }
         return pool;
     }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/package.html
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/package.html?rev=1100136&r1=1100135&r2=1100136&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/package.html (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/package.html Fri May  6 08:52:17
2011
@@ -132,69 +132,6 @@ driver.registerPool("example",connection
          like you normally would:
 <pre>Connection conn = DriverManager.getConnection("jdbc:apache:commons:dbcp:example");</pre>
       </p>
-      <p>
-         Q: Sounds complicated, is there an easier way?
-      </p><p>
-         A: If you're using the {@link org.apache.commons.dbcp.PoolingDriver}, you
-         don't need to do this configuration in code.  Instead, you can provide
-         a JOCL document that describes the connection pool,
-         and let the {@link org.apache.commons.dbcp.PoolingDriver} discover it at
-         runtime.
-      </p><p>
-         Specifically, if the {@link org.apache.commons.dbcp.PoolingDriver} is asked for
-         a {@link java.sql.Connection} from a pool that has not yet been registered,
-         it will look for a named resource from which to read the pool's configuration,
-         and create that pool.
-      </p><p>
-         For example, suppose you create a pool named "<tt>/eg</tt>" from a JOCL
-         document.  The "connect string" for this pool will be
-         "<tt>jdbc:apache:commons:dbcp:/eg</tt>".  To do this, you'll need a
create
-         a <i>resource</i> (just a file in your classpath) containing a JOCL
description
-         of the pool.  Specifically, this JOCL document should define a
-         {@link org.apache.commons.dbcp.PoolableConnectionFactory} from which the
-         pool will be obtained.  For example:
-<pre>&lt;object class="org.apache.commons.dbcp.PoolableConnectionFactory" xmlns="http://apache.org/xml/xmlns/jakarta/commons/jocl"&gt;
-   &lt;!-- the first argument is the ConnectionFactory --&gt;
-   &lt;object class="org.apache.commons.dbcp.DriverManagerConnectionFactory"&gt;
-      &lt;string value="jdbc:some:connect:string"/&gt;
-      &lt;object class="java.util.Properties" null="true"/&gt;
-   &lt;/object&gt;
-   &lt;!-- the next argument is the ObjectPool --&gt;
-   &lt;object class="org.apache.commons.pool.impl.GenericObjectPool"&gt;
-      &lt;object class="org.apache.commons.pool.PoolableObjectFactory" null="true"/&gt;
-      &lt;int value="10"/&gt; &lt;!-- max active --&gt;
-      &lt;byte value="1"/&gt; &lt;!-- when exhausted action, 0 = fail, 1 = block,
2 = grow --&gt;
-      &lt;long value="2000"/&gt; &lt;!-- max wait --&gt;
-      &lt;int value="10"/&gt; &lt;!-- max idle --&gt;
-      &lt;boolean value="false"/&gt; &lt;!-- test on borrow --&gt;
-      &lt;boolean value="false"/&gt; &lt;!-- test on return --&gt;
-      &lt;long value="10000"/&gt; &lt;!-- time between eviction runs --&gt;
-      &lt;int value="5"/&gt; &lt;!-- number of connections to test per eviction
run --&gt;
-      &lt;long value="5000"/&gt; &lt;!-- min evictable idle time --&gt;
-      &lt;boolean value="true"/&gt; &lt;!-- test while idle --&gt;
-   &lt;/object&gt;
-   &lt;!-- the next argument is the KeyedObjectPoolFactory --&gt;
-   &lt;object class="org.apache.commons.pool.impl.StackKeyedObjectPoolFactory"&gt;
-      &lt;int value="5"/&gt; &lt;!-- max idle --&gt;
-   &lt;/object&gt;
-   &lt;string value="SELECT COUNT(*) FROM DUAL"/&gt; &lt;!-- validation query
--&gt;
-   &lt;boolean value="false"/&gt; &lt;!-- default read only --&gt;
-   &lt;boolean value="true"/&gt; &lt;!-- default auto commit --&gt;
-&lt;/object&gt;</pre>
-      </p><p>
-         Simply save that file somewhere in your classpath as <tt>eg.jocl</tt>,
-         and the {@link org.apache.commons.dbcp.PoolingDriver} will find it
-         automatically.  You need only register the {@link org.apache.commons.dbcp.PoolingDriver}
-         (for example, using the <tt>jdbc.drivers</tt> property), and use the
-         the {@link java.sql.DriverManager} to create your {@link java.sql.Connection}s,
-         like you normally would:
-<pre>Connection conn = DriverManager.getConnection("jdbc:apache:commons:dbcp:/eg");</pre>
-      </p><p>
-         (Note that without the leading slash, the pool must be located at
-         <tt>org/apache/commons/dbcp/PoolingDriver/eg.jocl</tt> within your classpath.
-         See {@link java.lang.Class#getResource} for details.)
-      </p>
-
    </body>
 </html>
 

Copied: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java
(from r1099879, commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestManual.java)
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java?p2=commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java&p1=commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestManual.java&r1=1099879&r2=1100136&rev=1100136&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestManual.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java Fri
May  6 08:52:17 2011
@@ -33,19 +33,18 @@ import org.apache.commons.pool2.impl.Gen
 import org.apache.commons.pool2.impl.GenericObjectPool;
 
 /**
- * Tests for a "manually configured", {@link GenericObjectPool}
- * based {@link PoolingDriver}.
+ * Tests for a  {@link GenericObjectPool} based {@link PoolingDriver}.
  * @author Rodney Waldhoff
  * @author Sean C. Sullivan
  * @version $Revision$ $Date$
  */
-public class TestManual extends TestConnectionPool {
-    public TestManual(String testName) {
+public class TestPoolingDriver extends TestConnectionPool {
+    public TestPoolingDriver(String testName) {
         super(testName);
     }
 
     public static Test suite() {
-        return new TestSuite(TestManual.class);
+        return new TestSuite(TestPoolingDriver.class);
     }
 
     @Override



Mime
View raw message