private boolean mainLoop ( ) throws InterruptedException { long now = System . currentTimeMillis ( ) ; Iterator list = m_hardStore . values ( ) . iterator ( ) ; while ( list . hasNext ( ) ) { Entry entry = ( Entry ) list . next ( ) ; if ( entry . m_collectTime < now ) { m_weakStore . put ( entry . m_connection , DUMMY ) ; list . remove ( ) ; } } if ( m_hardStore . size ( ) == 0 ) { m_thread = null ; // mark to start a new thread next time. return true ; } wait ( 10000 ) ; return false ; }
The main loop of the cache which checks for expirations .