public long cleanup ( ) { int garbageSize = 0 ; if ( isCachingEnabled ( ) ) { System . out . println ( new LogEntry ( Level . VERBOSE , "Identifying expired objects" ) ) ; ArrayList < K > garbage = getExpiredObjects ( ) ; garbageSize = garbage . size ( ) ; System . out . println ( new LogEntry ( "cache cleanup: expired objects: " + garbageSize ) ) ; for ( K key : garbage ) { clear ( key ) ; } } return garbageSize ; }
Removes all expired objects .