Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.cache
Class QueryCacheLazyInitializationProxy

    java.lang.Object
      org.apache.cayenne.cache.QueryCacheLazyInitializationProxy

All Implemented Interfaces:
  QueryCache

    public class QueryCacheLazyInitializationProxy

extends Object
implements QueryCache

Since:
  3.1

Constructor Summary
`QueryCacheLazyInitializationProxy(Provider<QueryCache> provider)`

Method Summary
`void` | `clear()` Clears all cache entries.
`List` | `get(QueryMetadata metadata)` 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)` Returns a cached query result for the given QueryMetadata.
`void` | `put(QueryMetadata metadata, List results)`
`void` | `remove(String key)` Removes a single entry from cache.
`void` | `removeGroup(String groupKey)` Removes a group of entries identified by group key.
`int` | `size()` 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`

Constructor Detail

### QueryCacheLazyInitializationProxy

    public QueryCacheLazyInitializationProxy(Provider<QueryCache> provider)

Method Detail

### clear

    public void clear()

  Description copied from interface: `QueryCache`
  Clears all cache entries.

  Specified by:
    `clear` in interface `QueryCache`

### get

    public List get(QueryMetadata metadata,
                    QueryCacheEntryFactory factory)

  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`

### get

    public List get(QueryMetadata metadata)

  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`

### put

    public void put(QueryMetadata metadata,
                    List results)

  Specified by:
    `put` in interface `QueryCache`

### remove

    public void remove(String key)

  Description copied from interface: `QueryCache`
  Removes a single entry from cache.

  Specified by:
    `remove` in interface `QueryCache`

### removeGroup

    public void removeGroup(String groupKey)

  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`

### size

    public int size()

  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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.