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
Constructors Modifier Constructor Description protectedDelegatingCacheHelper(IndexReader.CacheHelper delegate)Create a new DelegatingCacheHelper that delegates the cache onClose listener to another CacheHelper, but with its own unique CacheKey.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClosedListener(IndexReader.ClosedListener listener)Add aIndexReader.ClosedListenerwhich will be called when the resource guarded byIndexReader.CacheHelper.getKey()is closed.IndexReader.CacheKeygetKey()Get a key that the resource can be cached on.
-
-
-
Constructor Detail
-
DelegatingCacheHelper
protected DelegatingCacheHelper(IndexReader.CacheHelper delegate)
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 Detail
-
getKey
public IndexReader.CacheKey getKey()
Description copied from interface:IndexReader.CacheHelperGet 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:
getKeyin interfaceIndexReader.CacheHelper
-
addClosedListener
public void addClosedListener(IndexReader.ClosedListener listener)
Description copied from interface:IndexReader.CacheHelperAdd aIndexReader.ClosedListenerwhich will be called when the resource guarded byIndexReader.CacheHelper.getKey()is closed.- Specified by:
addClosedListenerin interfaceIndexReader.CacheHelper
-
-