Package org.apache.lucene.index
Class FilterDirectoryReader.DelegatingCacheHelper
java.lang.Object
org.apache.lucene.index.FilterDirectoryReader.DelegatingCacheHelper
- All Implemented Interfaces:
IndexReader.CacheHelper
- Enclosing class:
- FilterDirectoryReader
protected static class FilterDirectoryReader.DelegatingCacheHelper
extends Object
implements IndexReader.CacheHelper
A DelegatingCacheHelper is a CacheHelper specialization for implementing long-lived caching
behaviour for FilterDirectoryReader subclasses. It uses a unique CacheKey for the purpose of
implementing the onClose listener delegation for the reader.
-
Constructor Summary
ModifierConstructorDescriptionprotected
DelegatingCacheHelper
(IndexReader.CacheHelper delegate) Create a new DelegatingCacheHelper that delegates the cache onClose listener to another CacheHelper, but with its own unique CacheKey. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addClosedListener
(IndexReader.ClosedListener listener) Add aIndexReader.ClosedListener
which will be called when the resource guarded byIndexReader.CacheHelper.getKey()
is closed.getKey()
Get a key that the resource can be cached on.
-
Constructor Details
-
DelegatingCacheHelper
Create a new DelegatingCacheHelper that delegates the cache onClose listener to another CacheHelper, but with its own unique CacheKey.- Parameters:
delegate
- the CacheHelper to delegate the close listener to
-
-
Method Details
-
getKey
Description copied from interface:IndexReader.CacheHelper
Get a key that the resource can be cached on. The given entry can be compared using identity, ie.Object.equals(java.lang.Object)
is implemented as==
andObject.hashCode()
is implemented asSystem.identityHashCode(java.lang.Object)
.- Specified by:
getKey
in interfaceIndexReader.CacheHelper
-
addClosedListener
Description copied from interface:IndexReader.CacheHelper
Add aIndexReader.ClosedListener
which will be called when the resource guarded byIndexReader.CacheHelper.getKey()
is closed.- Specified by:
addClosedListener
in interfaceIndexReader.CacheHelper
-