Code example for ReferenceQueue

0
            } 
        } finally { 
            poolLock.unlock();
        } 
 
        refQueue  = new ReferenceQueue<Object>();
        refWorker = new RefQueueWorker(refQueue, this);
        Thread t = new Thread(refWorker); //@@@ use a thread factory
        t.setDaemon(true);
        t.setName("RefQueueWorker@" + this);
        t.start();
    } 
 
 
    /** 
     * Obtains a pool entry with a connection within the given timeout. 
     * 
     * @param route     the route for which to get the connection 
     * @param timeout   the timeout, 0 or negative for no timeout 
     * @param tunit     the unit for the <code>timeout</code>, 
     *                  may be <code>null</code> only if there is no timeout