db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1499257 - /db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java
Date Wed, 03 Jul 2013 08:33:13 GMT
Author: kahatlen
Date: Wed Jul  3 08:33:12 2013
New Revision: 1499257

URL: http://svn.apache.org/r1499257
Log:
DERBY-6285: Use factory method to create thread pool for timed login

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java?rev=1499257&r1=1499256&r2=1499257&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java Wed Jul  3 08:33:12
2013
@@ -38,10 +38,10 @@ import java.util.Properties;
 import java.util.StringTokenizer;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
-import java.util.concurrent.SynchronousQueue;
 import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.logging.Logger;
@@ -94,12 +94,8 @@ public class InternalDriver implements M
      */
     private static boolean deregister = true;
 
-    private static final ThreadPoolExecutor _executorPool =
-            new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS,
-                                   new SynchronousQueue<Runnable>());
-    static {
-        _executorPool.setThreadFactory(new DaemonThreadFactory());
-    }
+    private static final ExecutorService _executorPool =
+            Executors.newCachedThreadPool(new DaemonThreadFactory());
 
 	public static final InternalDriver activeDriver()
 	{



Mime
View raw message