Class DelegatingDataCache

  • All Implemented Interfaces:
    DataCache, Clearable, Closeable

    public class DelegatingDataCache
    extends java.lang.Object
    implements DataCache
    Delegating data cache that can also perform exception translation for use in facades. This cache allows its delegate to be null, in which case it returns default values for all operations.
    Author:
    Abe White
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addExpirationListener​(ExpirationListener listen)
      Add a new expiration event listener to this cache.
      void clear()
      Remove all data from this cache.
      void close()
      Free the resources used by this cache.
      void commit​(java.util.Collection<DataCachePCData> additions, java.util.Collection<DataCachePCData> newUpdates, java.util.Collection<DataCachePCData> existingUpdates, java.util.Collection<java.lang.Object> deletes)
      Perform a batch update of the cache.
      boolean contains​(java.lang.Object oid)
      Returns true if this cache contains data corresponding to oid; otherwise returns false.
      java.util.BitSet containsAll​(java.util.Collection<java.lang.Object> oids)
      Returns the indexes of the oids in this cache.
      boolean equals​(java.lang.Object other)  
      DataCachePCData get​(java.lang.Object oid)
      Return the cached object for the given oid.
      java.util.Map<java.lang.Object,​DataCachePCData> getAll​(java.util.List<java.lang.Object> keys)
      Gets objects from the caches for a given list of keys.
      DataCache getDelegate()
      Return the direct delegate.
      boolean getEvictOnBulkUpdate()
      Returns whether the the cache needs to be updated when bulk updates as executed.
      DataCache getInnermostDelegate()
      Return the native delegate.
      java.lang.String getName()
      Returns a string name that can be used by end-user-visible code to identify this cache.
      DataCache getPartition​(java.lang.String name, boolean create)
      Gets the named partition.
      java.util.Set<java.lang.String> getPartitionNames()
      Gets the name of the known partitions.
      CacheStatistics getStatistics()
      Returns number of read/write request and cache hit ratio data.
      int hashCode()  
      void initialize​(DataCacheManager manager)
      Initialize any resources associated with the given DataCacheManager.
      boolean isPartitioned()
      Affirms if this cache maintains partitions.
      boolean pin​(java.lang.Object oid)
      Pin the value stored under oid into the cache.
      void pinAll​(java.lang.Class<?> cls, boolean subs)
      Pin all oids for the given type.
      java.util.BitSet pinAll​(java.util.Collection<java.lang.Object> oids)
      Pin all oids to the cache.
      DataCachePCData put​(DataCachePCData value)
      Set the cached value for the given instance.
      DataCachePCData remove​(java.lang.Object oid)
      Remove the value stored under the given oid.
      void removeAll​(java.lang.Class<?> cls, boolean subclasses)
      Evict all values of a specified type.
      java.util.BitSet removeAll​(java.util.Collection<java.lang.Object> oids)
      Remove the values stored under the given oids.
      boolean removeExpirationListener​(ExpirationListener listen)
      Remove an expiration event listener from this cache.
      void setName​(java.lang.String name)
      Sets a string name to be used to identify this cache to end-user needs.
      protected java.lang.RuntimeException translate​(java.lang.RuntimeException re)
      Translate the OpenJPA exception.
      boolean unpin​(java.lang.Object oid)
      Unpin the value stored under oid from the cache.
      void unpinAll​(java.lang.Class<?> cls, boolean subs)
      Unpin all oids associaed with the given type from the cache.
      java.util.BitSet unpinAll​(java.util.Collection<java.lang.Object> oids)
      Unpin all oids from the cache.
      void update​(DataCachePCData value)
      Update the cached value for the given instance.
      void writeLock()
      Obtain a write lock on the cache.
      void writeUnlock()
      Release the write lock on the cache.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait