44import org .apache .http .impl .conn .PoolingHttpClientConnectionManager ;
55
66import java .util .concurrent .TimeUnit ;
7+
78/**
8- * Class creates daemon thread to monitor and kill the idle/stale/expired
9+ * Creates daemon thread to monitor and kill the idle/stale/expired
910 * connections in the connection pool.
1011 */
11- public class IdleConnectionMonitorThread extends Thread {
12+ public class IdleConnectionMonitorThread extends Thread {
1213
1314 private final HttpClientConnectionManager connMgr ;
1415 private volatile boolean shutdown ;
1516 private long sleepTime ;
1617 private long idleTime ;
1718
1819 /**
19- * Constructor.
20- * @param connMgr - HttpClientConnectionManager
20+ *
21+ * @param connMgr - HttpClientConnectionManager
2122 * @param sleepTime - long
22- * @param idleTime - long
23+ * @param idleTime - long
2324 */
2425 public IdleConnectionMonitorThread (HttpClientConnectionManager connMgr , long sleepTime , long idleTime ) {
2526 super ();
@@ -28,9 +29,6 @@ public IdleConnectionMonitorThread(HttpClientConnectionManager connMgr, long sle
2829 this .idleTime = idleTime ;
2930 }
3031
31- /**
32- * Override run method
33- */
3432 @ Override
3533 public void run () {
3634 try {
@@ -52,15 +50,18 @@ public void run() {
5250 }
5351
5452 /**
55- * get idle time of connection
53+ * Specifies the time duration in milliseconds that a connection can be idle before it is evicted from the pool.
54+ *
5655 * @return long
5756 */
5857 public long getIdleTime () {
5958 return idleTime ;
6059 }
6160
6261 /**
63- * get sleep time of connection
62+ * Specifies time duration in milliseconds between "sweeps" by the "idle connection" evictor thread.
63+ * This thread will check if any idle/expired/stale connections are available in pool and evict it.
64+ *
6465 * @return long
6566 */
6667 public long getSleepTime () {
0 commit comments