Class BaseRegionAdapter

java.lang.Object
org.hibernate.cache.impl.bridge.BaseRegionAdapter
All Implemented Interfaces:
Region
Direct Known Subclasses:
BaseGeneralDataRegionAdapter, BaseTransactionalDataRegionAdapter

public abstract class BaseRegionAdapter extends Object implements Region
Basic adapter bridging between Region and Cache.
  • Field Details

    • underlyingCache

      protected final Cache underlyingCache
    • settings

      protected final Settings settings
  • Constructor Details

    • BaseRegionAdapter

      protected BaseRegionAdapter(Cache underlyingCache, Settings settings)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Region
      Retrieve the name of this region.
      Specified by:
      getName in interface Region
      Returns:
      The region name
    • clear

      public void clear() throws CacheException
      Throws:
      CacheException
    • destroy

      public void destroy() throws CacheException
      Description copied from interface: Region
      The "end state" contract of the region's lifecycle. Called during SessionFactory.close() to give the region a chance to cleanup.
      Specified by:
      destroy in interface Region
      Throws:
      CacheException - Indicates problem shutting down
    • contains

      public boolean contains(Object key)
      Description copied from interface: Region
      Determine whether this region contains data for the given key.

      The semantic here is whether the cache contains data visible for the current call context. This should be viewed as a "best effort", meaning blocking should be avoid if possible.

      Specified by:
      contains in interface Region
      Parameters:
      key - The cache key
      Returns:
      True if the underlying cache contains corresponding data; false otherwise.
    • getSizeInMemory

      public long getSizeInMemory()
      Description copied from interface: Region
      The number of bytes is this cache region currently consuming in memory.
      Specified by:
      getSizeInMemory in interface Region
      Returns:
      The number of bytes consumed by this region; -1 if unknown or unsupported.
    • getElementCountInMemory

      public long getElementCountInMemory()
      Description copied from interface: Region
      The count of entries currently contained in the regions in-memory store.
      Specified by:
      getElementCountInMemory in interface Region
      Returns:
      The count of entries in memory; -1 if unknown or unsupported.
    • getElementCountOnDisk

      public long getElementCountOnDisk()
      Description copied from interface: Region
      The count of entries currently contained in the regions disk store.
      Specified by:
      getElementCountOnDisk in interface Region
      Returns:
      The count of entries on disk; -1 if unknown or unsupported.
    • toMap

      public Map toMap()
      Description copied from interface: Region
      Get the contents of this region as a map.

      Implementors which do not support this notion should simply return an empty map.

      Specified by:
      toMap in interface Region
      Returns:
      The content map.
    • nextTimestamp

      public long nextTimestamp()
      Specified by:
      nextTimestamp in interface Region
    • getTimeout

      public int getTimeout()
      Specified by:
      getTimeout in interface Region