public class PoolSkimmerThread implements Runnable {
private long timeout; private ObjectPool pool;
public PoolSkimmerThread(int skimmerSecs, ObjectPool pool) { this.timeout = (skimmerSecs * 1000); this.pool = pool; }
public void run() {
for (; ;) { try { Thread.sleep(this.timeout); } catch (InterruptedException e) { } this.pool.cleanUp(); } }
}
|