org.hibernate.cache

Class HashtableCache

Implemented Interfaces:
Cache

public class HashtableCache
extends java.lang.Object
implements Cache

A lightweight implementation of the Cache interface
Author:
Gavin King

Constructor Summary

HashtableCache(String regionName)

Method Summary

void
clear()
void
destroy()
Object
get(Object key)
long
getElementCountInMemory()
long
getElementCountOnDisk()
String
getRegionName()
long
getSizeInMemory()
int
getTimeout()
void
lock(Object key)
long
nextTimestamp()
void
put(Object key, Object value)
Object
read(Object key)
void
remove(Object key)
Map
toMap()
String
toString()
void
unlock(Object key)
void
update(Object key, Object value)

Constructor Details

HashtableCache

public HashtableCache(String regionName)

Method Details

clear

public void clear()
            throws CacheException
Specified by:
clear in interface Cache

destroy

public void destroy()
            throws CacheException
Specified by:
destroy in interface Cache

get

public Object get(Object key)
            throws CacheException
Specified by:
get in interface Cache

getElementCountInMemory

public long getElementCountInMemory()
Specified by:
getElementCountInMemory in interface Cache

getElementCountOnDisk

public long getElementCountOnDisk()
Specified by:
getElementCountOnDisk in interface Cache

getRegionName

public String getRegionName()
Specified by:
getRegionName in interface Cache

getSizeInMemory

public long getSizeInMemory()
Specified by:
getSizeInMemory in interface Cache

getTimeout

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

lock

public void lock(Object key)
            throws CacheException
Specified by:
lock in interface Cache

nextTimestamp

public long nextTimestamp()
Specified by:
nextTimestamp in interface Cache

put

public void put(Object key,
                Object value)
            throws CacheException
Specified by:
put in interface Cache

read

public Object read(Object key)
            throws CacheException
Specified by:
read in interface Cache

remove

public void remove(Object key)
            throws CacheException
Specified by:
remove in interface Cache

toMap

public Map toMap()
Specified by:
toMap in interface Cache

toString

public String toString()

unlock

public void unlock(Object key)
            throws CacheException
Specified by:
unlock in interface Cache

update

public void update(Object key,
                   Object value)
            throws CacheException
Specified by:
update in interface Cache