org.apache.cayenne.cache

## Class EhCacheQueryCache

- java.lang.Object
- - org.apache.cayenne.cache.EhCacheQueryCache

- All Implemented Interfaces:
    QueryCache

  Deprecated.
  since 4.0 please use JCacheQueryCache (provided by "cayenne-jcache" module)

      @Deprecated
      public class EhCacheQueryCache
      extends Object
      implements QueryCache

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected net.sf.ehcache.CacheManager` | `cacheManager` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EhCacheQueryCache()` Deprecated.
    `EhCacheQueryCache(net.sf.ehcache.CacheManager cacheManager)` Deprecated.
    `EhCacheQueryCache(String configFile)` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `cacheName(QueryMetadata metadata)` Deprecated.
    `void` | `clear()` Deprecated. Clears all cache entries.
    `List` | `get(QueryMetadata metadata)` Deprecated. Returns a cached query result for the given QueryMetadata or null if the result is not cached or is expired.
    `List` | `get(QueryMetadata metadata, QueryCacheEntryFactory factory)` Deprecated. Returns a cached query result for the given QueryMetadata.
    `net.sf.ehcache.Ehcache` | `getDefaultCache()` Deprecated. since 4.0 - this method is no longer in use. If you are overriding it, override `cacheName(QueryMetadata)` instead.
    `void` | `put(QueryMetadata metadata, List results)` Deprecated.
    `void` | `remove(String key)` Deprecated. Removes a single entry from cache.
    `void` | `removeGroup(String groupKey)` Deprecated. Removes a group of entries identified by group key.
    `void` | `removeGroup(String groupKey, Class<?> keyType, Class<?> valueType)` Deprecated. Removes a group of entries identified by group key.
    `void` | `shutdown()` Deprecated. Shuts down EhCache CacheManager
    `int` | `size()` Deprecated. Returns the number of entries currently in the cache, including expired but not removed entries.

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

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

- - ### Field Detail

    - #### cacheManager

          protected net.sf.ehcache.CacheManager cacheManager

      Deprecated.

  - ### Constructor Detail

    - #### EhCacheQueryCache

          public EhCacheQueryCache()

      Deprecated.

    - #### EhCacheQueryCache

          public EhCacheQueryCache(String configFile)

      Deprecated.

    - #### EhCacheQueryCache

          public EhCacheQueryCache(net.sf.ehcache.CacheManager cacheManager)

      Deprecated.

  - ### Method Detail

    - #### get

          public List get(QueryMetadata metadata)

      Deprecated.
      Description copied from interface: `QueryCache`
      Returns a cached query result for the given QueryMetadata or null if the result is not cached or is expired.
      Specified by:
        `get` in interface `QueryCache`

    - #### get

          public List get(QueryMetadata metadata,
                          QueryCacheEntryFactory factory)

      Deprecated.
      Description copied from interface: `QueryCache`
      Returns a cached query result for the given QueryMetadata. If the result is not cached or is expired, cache will use provided factory to rebuild the value and store it in the cache. A corollary is that this method never returns null.

      Compared to `QueryCache.get(QueryMetadata)`, this method allows the cache to do appropriate synchronization when refreshing the entry, preventing multiple threads from running the same query when a missing entry is requested by multiple threads simultaneously.

      Specified by:
        `get` in interface `QueryCache`

    - #### cacheName

          protected String cacheName(QueryMetadata metadata)

      Deprecated.
      Since:
        4.0

    - #### put

          public void put(QueryMetadata metadata,
                          List results)

      Deprecated.
      Specified by:
        `put` in interface `QueryCache`

    - #### remove

          public void remove(String key)

      Deprecated.
      Description copied from interface: `QueryCache`
      Removes a single entry from cache.
      Specified by:
        `remove` in interface `QueryCache`

    - #### removeGroup

          public void removeGroup(String groupKey)

      Deprecated.
      Description copied from interface: `QueryCache`
      Removes a group of entries identified by group key. Note that depending on implementation this method may either actively remove the entries belonging to the group or just mark them as expired, so that they are refreshed on the next access. In the former case the cache size would shrink, but in the later the cache size will not change after calling this method.
      Specified by:
        `removeGroup` in interface `QueryCache`

    - #### removeGroup

          public void removeGroup(String groupKey,
                                  Class<?> keyType,
                                  Class<?> valueType)

      Deprecated.
      Description copied from interface: `QueryCache`
      Removes a group of entries identified by group key. Can be used if cache provider supports strictly typed caches.
      Specified by:
        `removeGroup` in interface `QueryCache`
      See Also:
        `QueryCache.removeGroup(String)`

    - #### clear

          public void clear()

      Deprecated.
      Description copied from interface: `QueryCache`
      Clears all cache entries.
      Specified by:
        `clear` in interface `QueryCache`

    - #### size

          public int size()

      Deprecated.
      Description copied from interface: `QueryCache`
      Returns the number of entries currently in the cache, including expired but not removed entries.
      Specified by:
        `size` in interface `QueryCache`

    - #### getDefaultCache

          @Deprecated
          public net.sf.ehcache.Ehcache getDefaultCache()

      Deprecated. since 4.0 - this method is no longer in use. If you are overriding it, override `cacheName(QueryMetadata)` instead.
      Returns default cache group.

    - #### shutdown

          @BeforeScopeEnd
          public void shutdown()

      Deprecated.
      Shuts down EhCache CacheManager

Copyright © 2001–2018 Apache Cayenne. All rights reserved.