public Object get ( Object key ) { TimedEntry entry = ( TimedEntry ) entryMap . get ( key ) ; if ( entry == null ) return null ; if ( entry . isCurrent ( now ) == false ) { // Try to refresh the entry if ( entry . refresh ( ) == false ) { // Failed, remove the entry and return null entry . destroy ( ) ; entryMap . remove ( key ) ; return null ; } } Object value = entry . getValue ( ) ; return value ; }
Get the cache value for key if it has not expired . If the TimedEntry is expired its destroy method is called and then removed from the cache .