56
56
57
57
class DefaultConnectionPool implements ConnectionPool {
58
58
private static final Logger LOGGER = Loggers .getLogger ("connection" );
59
- private static final DaemonThreadFactory THREAD_FACTORY = new DaemonThreadFactory ();
60
59
61
60
private final ConcurrentPool <UsageTrackingInternalConnection > pool ;
62
61
private final ConnectionPoolSettings settings ;
@@ -77,7 +76,7 @@ class DefaultConnectionPool implements ConnectionPool {
77
76
= new UsageTrackingInternalConnectionItemFactory (internalConnectionFactory );
78
77
pool = new ConcurrentPool <UsageTrackingInternalConnection >(settings .getMaxSize (), connectionItemFactory );
79
78
maintenanceTask = createMaintenanceTask ();
80
- sizeMaintenanceTimer = createTimer ();
79
+ sizeMaintenanceTimer = createMaintenanceTimer ();
81
80
this .connectionPoolListener = notNull ("connectionPoolListener" , connectionPoolListener );
82
81
connectionPoolListener .connectionPoolOpened (new ConnectionPoolOpenedEvent (serverId , settings ));
83
82
}
@@ -214,7 +213,7 @@ public void onResult(final Void result, final Throwable t) {
214
213
215
214
private synchronized ExecutorService getAsyncGetter () {
216
215
if (asyncGetter == null ) {
217
- asyncGetter = Executors .newSingleThreadExecutor (THREAD_FACTORY );
216
+ asyncGetter = Executors .newSingleThreadExecutor (new DaemonThreadFactory ( "AsyncGetter" ) );
218
217
}
219
218
return asyncGetter ;
220
219
}
@@ -311,11 +310,11 @@ public synchronized void run() {
311
310
return newMaintenanceTask ;
312
311
}
313
312
314
- private ExecutorService createTimer () {
313
+ private ExecutorService createMaintenanceTimer () {
315
314
if (maintenanceTask == null ) {
316
315
return null ;
317
316
} else {
318
- ScheduledExecutorService newTimer = Executors .newSingleThreadScheduledExecutor (THREAD_FACTORY );
317
+ ScheduledExecutorService newTimer = Executors .newSingleThreadScheduledExecutor (new DaemonThreadFactory ( "MaintenanceTimer" ) );
319
318
newTimer .scheduleAtFixedRate (maintenanceTask , settings .getMaintenanceInitialDelay (MILLISECONDS ),
320
319
settings .getMaintenanceFrequency (MILLISECONDS ), MILLISECONDS );
321
320
return newTimer ;
0 commit comments