private synchronized void checkCache ( ) { Object [ ] pTables = m_setTableCacheList . toArray ( ) ; for ( Object objTable : pTables ) { PTable pTable = ( PTable ) objTable ; if ( pTable . addPTableOwner ( null ) == 1 ) { // Not currently being used is a candidate for flushing from the cache. long lTimeLastUsed = pTable . getLastUsed ( ) ; long lTimeCurrent = System . currentTimeMillis ( ) ; if ( ( lTimeCurrent - lTimeLastUsed ) > ( this . getCacheMinutes ( ) * 60 * 1000 ) ) { pTable . removePTableOwner ( this , true ) ; m_setTableCacheList . remove ( pTable ) ; } } } }
Check all the cached tables and flush the old ones .