org.hibernate.search.filter.impl

## Class MRUFilterCachingStrategy

- java.lang.Object
- - org.hibernate.search.filter.impl.MRUFilterCachingStrategy

- All Implemented Interfaces:
    FilterCachingStrategy

      public class MRUFilterCachingStrategy
      extends Object
      implements FilterCachingStrategy

  Keep the most recently used Filters in the cache The cache is at least as big as `hibernate.search.filter.cache_strategy.size` Above this limit, Filters are kept as soft references
  Author:
    Emmanuel Bernard

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MRUFilterCachingStrategy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCachedFilter(FilterKey key, Query filter)` Propose a candidate filter for caching.
    `Query` | `getCachedFilter(FilterKey key)` Retrieve the cached filter for a given key or null if not cached.
    `void` | `initialize(Properties properties)` Initialize the strategy from the properties.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.hibernate.search.filter.FilterCachingStrategy

      `addCachedFilter`

- - ### Constructor Detail

    - #### MRUFilterCachingStrategy

          public MRUFilterCachingStrategy()

  - ### Method Detail

    - #### initialize

          public void initialize(Properties properties)

      Description copied from interface: `FilterCachingStrategy`
      Initialize the strategy from the properties. The Properties must not be changed.
      Specified by:
        `initialize` in interface `FilterCachingStrategy`
      Parameters:
        `properties` - the caching strategy configuration

    - #### getCachedFilter

          public Query getCachedFilter(FilterKey key)

      Description copied from interface: `FilterCachingStrategy`
      Retrieve the cached filter for a given key or null if not cached.
      Specified by:
        `getCachedFilter` in interface `FilterCachingStrategy`
      Parameters:
        `key` - the filter key
      Returns:
        the cached filter or null if not cached

    - #### addCachedFilter

          public void addCachedFilter(FilterKey key,
                                      Query filter)

      Description copied from interface: `FilterCachingStrategy`
      Propose a candidate filter for caching.
      Specified by:
        `addCachedFilter` in interface `FilterCachingStrategy`
      Parameters:
        `key` - the filter key
        `filter` - the filter to cache

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved