- final Map<String,FilterChain> cache=(Map<String, FilterChain>)_chainCache[dispatch];
- final Queue<String> lru=(Queue<String>)_chainLRU[dispatch];
-
- // Do we have too many cached chains?
- while (_maxFilterChainsCacheSize>0 && cache.size()>=_maxFilterChainsCacheSize)
- {
- // The LRU list is not atomic with the cache map, so be prepared to invalidate if
- // a key is not found to delete.
- // Delete by LRU (where U==created)
- String k=lru.poll();
- if (k==null)
- {
- cache.clear();
- break;
- }
- cache.remove(k);
- }
-
- cache.put(key,chain);
- lru.add(key);
+ final Map<String,FilterChain> cache=_chainCache[dispatch];
+ final Queue<String> lru=_chainLRU[dispatch];
+
+ // Do we have too many cached chains?
+ while (_maxFilterChainsCacheSize>0 && cache.size()>=_maxFilterChainsCacheSize)
+ {
+ // The LRU list is not atomic with the cache map, so be prepared to invalidate if
+ // a key is not found to delete.
+ // Delete by LRU (where U==created)
+ String k=lru.poll();
+ if (k==null)
+ {
+ cache.clear();
+ break;
+ }
+ cache.remove(k);
+ }
+
+ cache.put(key,chain);
+ lru.add(key);