private void refreshEntry ( final Entry < K , V > e ) { synchronized ( e ) { e . waitForProcessing ( ) ; if ( e . isGone ( ) ) { return ; } e . startProcessing ( Entry . ProcessingState . REFRESH ) ; } boolean _finished = false ; try { load ( e ) ; _finished = true ; } catch ( CacheClosedException ignore ) { } catch ( Throwable ex ) { logAndCountInternalException ( "Refresh exception" , ex ) ; try { synchronized ( e ) { expireEntry ( e ) ; } } catch ( CacheClosedException ignore ) { } } finally { e . ensureAbort ( _finished ) ; } }
Executed in loader thread . Load the entry again . After the load we copy the entry to the refresh hash and expire it in the main hash . The entry needs to stay in the main hash during the load to block out concurrent reads .