org.datanucleus.jpa
Class JPADataStoreCache

java.lang.Object
  extended by org.datanucleus.jpa.JPADataStoreCache
All Implemented Interfaces:
javax.persistence.Cache

public class JPADataStoreCache
extends java.lang.Object
implements javax.persistence.Cache

Implementation of the JPA DataStoreCache. Provides a wrapper and hands off calls to the underlying Level2 cache.


Constructor Summary
JPADataStoreCache(org.datanucleus.OMFContext omfCtx, org.datanucleus.cache.Level2Cache cache)
          Constructor.
 
Method Summary
 boolean contains(java.lang.Class cls, java.lang.Object pk)
          Accessor for whether the object with specified PK is contained in the cache.
 void evict(java.lang.Class cls)
          Evict the parameter instance from the second-level cache.
 void evict(java.lang.Class cls, java.lang.Object pk)
          Evict the parameter instance from the second-level cache.
 void evictAll()
          Evict all instances from the second-level cache.
 org.datanucleus.cache.Level2Cache getLevel2Cache()
          Accessor for the underlying Level 2 cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPADataStoreCache

public JPADataStoreCache(org.datanucleus.OMFContext omfCtx,
                         org.datanucleus.cache.Level2Cache cache)
Constructor.

Parameters:
omfCtx - OMFContext
cache - Level 2 Cache
Method Detail

getLevel2Cache

public org.datanucleus.cache.Level2Cache getLevel2Cache()
Accessor for the underlying Level 2 cache.

Returns:
Underlying L2 cache.

contains

public boolean contains(java.lang.Class cls,
                        java.lang.Object pk)
Accessor for whether the object with specified PK is contained in the cache.

Specified by:
contains in interface javax.persistence.Cache
Parameters:
cls - The class
pk - PK of the instance to evict.
Returns:
whether it is contained

evictAll

public void evictAll()
Evict all instances from the second-level cache.

Specified by:
evictAll in interface javax.persistence.Cache

evict

public void evict(java.lang.Class cls)
Evict the parameter instance from the second-level cache.

Specified by:
evict in interface javax.persistence.Cache
Parameters:
cls - Class of which to evict all objects

evict

public void evict(java.lang.Class cls,
                  java.lang.Object pk)
Evict the parameter instance from the second-level cache.

Specified by:
evict in interface javax.persistence.Cache
Parameters:
cls - Class of which to evict the object
pk - PK of the instance to evict.


Copyright © 2011. All Rights Reserved.