Methods Summary |
---|
protected boolean | debug()
return logger.isLoggable( Level.FINER ) ;
|
protected final void | dprint(java.lang.String msg)
logger.finer(thisClassName() + msg);
|
public void | dprintStatistics()
dprint( ".stats:"
+ " idle=" + numberOfIdleConnections()
+ " reclaimable=" + numberOfReclaimableConnections()
+ " busy=" + numberOfBusyConnections()
+ " total=" + numberOfConnections()
+ " ("
+ highWaterMark() + "/"
+ numberToReclaim()
+ ")");
|
public final java.lang.String | getCacheType()
return cacheType ;
|
public final int | highWaterMark()
return highWaterMark ;
|
public final int | numberToReclaim()
return numberToReclaim ;
|
protected boolean | reclaim()Reclaim some idle cached connections. Will never
close a connection that is busy.
if (debug())
dprint( ".reclaim: starting" ) ;
int ctr = 0 ;
while (ctr < numberToReclaim()) {
C candidate = reclaimableConnections.poll() ;
if (candidate == null)
// If we have closed all idle connections, we must stop
// reclaiming.
break ;
if (debug())
dprint( ".reclaim: closing connection " + candidate ) ;
try {
close( candidate ) ;
} catch (RuntimeException exc) {
if (debug())
dprint( ".reclaim: caught exception on close: " + exc ) ;
throw exc ;
}
ctr++ ;
}
if (debug())
dprint( ".reclaim: reclaimed " + ctr + " connection(s)" ) ;
return ctr > 0 ;
|
protected abstract java.lang.String | thisClassName()
|
public java.lang.String | toString()
return thisClassName() + "["
+ getCacheType() + "]";
|