public class

HashtableCache

extends Object
implements Cache
java.lang.Object
   ↳ org.hibernate.cache.HashtableCache

Class Overview

A lightweight implementation of the Cache interface

Summary

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

Public Constructors

public HashtableCache (String regionName)

Public Methods

public void clear ()

Clear the cache

public void destroy ()

Clean up

public Object get (Object key)

Get an item from the cache, nontransactionally

Returns
  • the cached object or null

public 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 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 String getRegionName ()

Get the name of the cache region

public 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 int getTimeout ()

Get a reasonable "lock timeout"

public void lock (Object key)

If this is a clustered cache, lock the item

public long nextTimestamp ()

Generate a timestamp

public void put (Object key, Object value)

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

public Object read (Object key)

Get an item from the cache

Returns
  • the cached object or null

public void remove (Object key)

Remove an item from the cache

public Map toMap ()

optional operation

public String toString ()

public void unlock (Object key)

If this is a clustered cache, unlock the item

public void update (Object key, Object value)

Add an item to the cache