Truncates the cache to the maximal number of entries.
()
| 209 | * Truncates the cache to the maximal number of entries. |
| 210 | */ |
| 211 | protected void deleteOverflow() { |
| 212 | synchronized (entries_) { |
| 213 | while (entries_.size() > maxSize_) { |
| 214 | final Entry oldestEntry = Collections.min(entries_.values()); |
| 215 | entries_.remove(oldestEntry.key_); |
| 216 | if (oldestEntry.response_ != null) { |
| 217 | oldestEntry.response_.cleanUp(); |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | /** |
| 224 | * Determines if the specified response can be cached. |
no test coverage detected