public interface

Cache

org.hibernate.cache.Cache
Known Indirect Subclasses

Summary

Public Methods
abstract void clear()
Clear the cache
abstract void destroy()
Clean up
abstract Object get(Object key)
Get an item from the cache, nontransactionally
abstract long getElementCountInMemory()
The count of entries currently contained in the regions in-memory store.
abstract long getElementCountOnDisk()
The count of entries currently contained in the regions disk store.
abstract String getRegionName()
Get the name of the cache region
abstract long getSizeInMemory()
The number of bytes is this cache region currently consuming in memory.
abstract int getTimeout()
Get a reasonable "lock timeout"
abstract void lock(Object key)
If this is a clustered cache, lock the item
abstract long nextTimestamp()
Generate a timestamp
abstract void put(Object key, Object value)
Add an item to the cache, nontransactionally, with failfast semantics
abstract Object read(Object key)
Get an item from the cache
abstract void remove(Object key)
Remove an item from the cache
abstract Map toMap()
optional operation
abstract void unlock(Object key)
If this is a clustered cache, unlock the item
abstract void update(Object key, Object value)
Add an item to the cache

Public Methods

public abstract void clear ()

Clear the cache

public abstract void destroy ()

Clean up

public abstract Object get (Object key)

Get an item from the cache, nontransactionally

Returns
  • the cached object or null

public abstract long getElementCountInMemory ()

The count of entries currently contained in the regions in-memory store.

Returns
  • The count of entries in memory; -1 if unknown or unsupported.

public abstract long getElementCountOnDisk ()

The count of entries currently contained in the regions disk store.

Returns
  • The count of entries on disk; -1 if unknown or unsupported.

public abstract String getRegionName ()

Get the name of the cache region

public abstract long getSizeInMemory ()

The number of bytes is this cache region currently consuming in memory.

Returns
  • The number of bytes consumed by this region; -1 if unknown or unsupported.

public abstract int getTimeout ()

Get a reasonable "lock timeout"

public abstract void lock (Object key)

If this is a clustered cache, lock the item

public abstract long nextTimestamp ()

Generate a timestamp

public abstract void put (Object key, Object value)

Add an item to the cache, nontransactionally, with failfast semantics

public abstract Object read (Object key)

Get an item from the cache

Returns
  • the cached object or null

public abstract void remove (Object key)

Remove an item from the cache

public abstract Map toMap ()

optional operation

public abstract void unlock (Object key)

If this is a clustered cache, unlock the item

public abstract void update (Object key, Object value)

Add an item to the cache