Package org.eclipse.rdf4j.spring.resultcache

## Class LRUResultCache<T>

- java.lang.Object
- - org.eclipse.rdf4j.spring.resultcache.LRUResultCache<T>

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    `Clearable`, `ResultCache<Integer,​T>`

      public class LRUResultCache<T>
      extends Object
      implements ResultCache<Integer,​T>

  Since:
    4.0.0
  Author:
    Florian Kleedorfer

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LRUResultCache​(ResultCacheProperties properties)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `bypassForCurrentThread()` | Calling this method instructs the cache to return `null` to all `#get(K)` calls and ignore any `#put(K, T)` calls from the current thread until the cache is cleared.
    `void` | `clearCachedResults()` |
    `T` | `get​(Integer key)` |
    `void` | `markDirty()` |
    `void` | `put​(Integer key, T cachedObject)` |

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

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

- - ### Constructor Detail

    - #### LRUResultCache

          public LRUResultCache​(ResultCacheProperties properties)

  - ### Method Detail

    - #### get

          public T get​(Integer key)

      Specified by:
        `get` in interface `ResultCache<Integer,​T>`

    - #### put

          public void put​(Integer key,
                          T cachedObject)

      Specified by:
        `put` in interface `ResultCache<Integer,​T>`

    - #### markDirty

          public void markDirty()

      Specified by:
        `markDirty` in interface `Clearable`

    - #### clearCachedResults

          public void clearCachedResults()

      Specified by:
        `clearCachedResults` in interface `Clearable`

    - #### bypassForCurrentThread

          public void bypassForCurrentThread()

      Description copied from interface: `ResultCache`
      Calling this method instructs the cache to return `null` to all `#get(K)` calls and ignore any `#put(K, T)` calls from the current thread until the cache is cleared. Context: after a write operation on a connection (which is assumed to be handled exclusively by a dedicated thread), the local cache must be cleared and the global cache bypassed until the connection is returned.
      Specified by:
        `bypassForCurrentThread` in interface `ResultCache<Integer,​T>`