renamed ProxyLeakTask as it has nothing to do with 'proxy'

pull/571/head
Nitin 9 years ago
parent a6486c6417
commit 1b1b63fb3e

@ -86,7 +86,7 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
private final ConcurrentBag<PoolEntry> connectionBag;
private final ProxyLeakTask leakTask;
private final LeakTask leakTask;
private final SuspendResumeLock suspendResumeLock;
private MetricsTrackerDelegate metricsTracker;
@ -131,7 +131,7 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
this.houseKeepingExecutorService = config.getScheduledExecutorService();
}
this.leakTask = new ProxyLeakTask(config.getLeakDetectionThreshold(), houseKeepingExecutorService);
this.leakTask = new LeakTask(config.getLeakDetectionThreshold(), houseKeepingExecutorService);
this.houseKeepingExecutorService.scheduleWithFixedDelay(new HouseKeeper(), 0L, HOUSEKEEPING_PERIOD_MS, MILLISECONDS);
}

@ -30,10 +30,10 @@ import org.slf4j.LoggerFactory;
*
* @author Brett Wooldridge
*/
class ProxyLeakTask implements Runnable
class LeakTask implements Runnable
{
private static final Logger LOGGER = LoggerFactory.getLogger(ProxyLeakTask.class);
private static final ProxyLeakTask NO_LEAK;
private static final Logger LOGGER = LoggerFactory.getLogger(LeakTask.class);
private static final LeakTask NO_LEAK;
private ScheduledExecutorService executorService;
private long leakDetectionThreshold;
@ -43,32 +43,32 @@ class ProxyLeakTask implements Runnable
static
{
NO_LEAK = new ProxyLeakTask() {
NO_LEAK = new LeakTask() {
@Override
public void cancel() {}
};
}
ProxyLeakTask(final long leakDetectionThreshold, final ScheduledExecutorService executorService)
LeakTask(final long leakDetectionThreshold, final ScheduledExecutorService executorService)
{
this.executorService = executorService;
this.leakDetectionThreshold = leakDetectionThreshold;
}
private ProxyLeakTask(final ProxyLeakTask parent, final PoolEntry poolEntry)
private LeakTask(final LeakTask parent, final PoolEntry poolEntry)
{
this.exception = new Exception("Apparent connection leak detected");
this.connectionName = poolEntry.connection.toString();
scheduledFuture = parent.executorService.schedule(this, parent.leakDetectionThreshold, MILLISECONDS);
}
private ProxyLeakTask()
private LeakTask()
{
}
ProxyLeakTask start(final PoolEntry bagEntry)
LeakTask start(final PoolEntry bagEntry)
{
return (leakDetectionThreshold == 0) ? NO_LEAK : new ProxyLeakTask(this, bagEntry);
return (leakDetectionThreshold == 0) ? NO_LEAK : new LeakTask(this, bagEntry);
}
void updateLeakDetectionThreshold(final long leakDetectionThreshold)

@ -94,7 +94,7 @@ final class PoolEntry implements IConcurrentBagEntry
this.endOfLife = endOfLife;
}
Connection createProxyConnection(final ProxyLeakTask leakTask, final long now)
Connection createProxyConnection(final LeakTask leakTask, final long now)
{
return ProxyFactory.getProxyConnection(this, connection, openStatements, leakTask, now, isReadOnly, isAutoCommit);
}

@ -56,7 +56,7 @@ public abstract class ProxyConnection implements Connection
protected Connection delegate;
private final PoolEntry poolEntry;
private final ProxyLeakTask leakTask;
private final LeakTask leakTask;
private final FastList<Statement> openStatements;
private int dirtyBits;
@ -83,7 +83,7 @@ public abstract class ProxyConnection implements Connection
SQL_ERRORS.add("JZ0C1"); // Sybase disconnect error
}
protected ProxyConnection(final PoolEntry poolEntry, final Connection connection, final FastList<Statement> openStatements, final ProxyLeakTask leakTask, final long now, final boolean isReadOnly, final boolean isAutoCommit) {
protected ProxyConnection(final PoolEntry poolEntry, final Connection connection, final FastList<Statement> openStatements, final LeakTask leakTask, final long now, final boolean isReadOnly, final boolean isAutoCommit) {
this.poolEntry = poolEntry;
this.delegate = connection;
this.openStatements = openStatements;

@ -48,7 +48,7 @@ public final class ProxyFactory
* @param isAutoCommit
* @return a proxy that wraps the specified {@link Connection}
*/
static ProxyConnection getProxyConnection(final PoolEntry poolEntry, final Connection connection, final FastList<Statement> openStatements, final ProxyLeakTask leakTask, final long now, final boolean isReadOnly, final boolean isAutoCommit)
static ProxyConnection getProxyConnection(final PoolEntry poolEntry, final Connection connection, final FastList<Statement> openStatements, final LeakTask leakTask, final long now, final boolean isReadOnly, final boolean isAutoCommit)
{
// Body is replaced (injected) by JavassistProxyFactory
throw new IllegalStateException("You need to run the CLI build and you need target/classes in your classpath to run.");

@ -90,7 +90,7 @@ public class MiscTest
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos, true);
TestElf.setSlf4jTargetStream(Class.forName("com.zaxxer.hikari.pool.ProxyLeakTask"), ps);
TestElf.setSlf4jTargetStream(Class.forName("com.zaxxer.hikari.pool.LeakTask"), ps);
TestElf.setConfigUnitTest(true);
HikariConfig config = new HikariConfig();

Loading…
Cancel
Save