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(); } } } <p>
猜你喜欢
本站原创《复杂软件设计之道:领域驱动设计全面解析与实战》