gran.tools.cache
Class QueryCachedSwarmCache

java.lang.Object
  extended bygran.tools.cache.QueryCachedSwarmCache
All Implemented Interfaces:
net.sf.hibernate.cache.Cache

public class QueryCachedSwarmCache
extends java.lang.Object
implements net.sf.hibernate.cache.Cache

Author:
Jason Carreira, Gavin King

Constructor Summary
QueryCachedSwarmCache(ObjectCache cache)
           
 
Method Summary
 void clear()
          Clear the cache
 void destroy()
          Clean up
 java.lang.Object get(java.lang.Object key)
          Get an item from the cache
 int getTimeout()
          Get a reasonable "lock timeout"
 void lock(java.lang.Object key)
          If this is a clustered cache, lock the item
 long nextTimestamp()
          Generate a (coarse) timestamp
 void put(java.lang.Object key, java.lang.Object value)
          Add an item to the cache
 void remove(java.lang.Object key)
          Remove an item from the cache
 void unlock(java.lang.Object key)
          If this is a clustered cache, unlock the item
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryCachedSwarmCache

public QueryCachedSwarmCache(ObjectCache cache)
Method Detail

get

public java.lang.Object get(java.lang.Object key)
                     throws net.sf.hibernate.cache.CacheException
Get an item from the cache

Specified by:
get in interface net.sf.hibernate.cache.Cache
Parameters:
key -
Returns:
the cached object or null
Throws:
net.sf.hibernate.cache.CacheException

put

public void put(java.lang.Object key,
                java.lang.Object value)
         throws net.sf.hibernate.cache.CacheException
Add an item to the cache

Specified by:
put in interface net.sf.hibernate.cache.Cache
Parameters:
key -
value -
Throws:
net.sf.hibernate.cache.CacheException

remove

public void remove(java.lang.Object key)
            throws net.sf.hibernate.cache.CacheException
Remove an item from the cache

Specified by:
remove in interface net.sf.hibernate.cache.Cache
Throws:
net.sf.hibernate.cache.CacheException

clear

public void clear()
           throws net.sf.hibernate.cache.CacheException
Clear the cache

Specified by:
clear in interface net.sf.hibernate.cache.Cache
Throws:
net.sf.hibernate.cache.CacheException

destroy

public void destroy()
             throws net.sf.hibernate.cache.CacheException
Clean up

Specified by:
destroy in interface net.sf.hibernate.cache.Cache
Throws:
net.sf.hibernate.cache.CacheException

lock

public void lock(java.lang.Object key)
          throws net.sf.hibernate.cache.CacheException
If this is a clustered cache, lock the item

Specified by:
lock in interface net.sf.hibernate.cache.Cache
Throws:
net.sf.hibernate.cache.CacheException

unlock

public void unlock(java.lang.Object key)
            throws net.sf.hibernate.cache.CacheException
If this is a clustered cache, unlock the item

Specified by:
unlock in interface net.sf.hibernate.cache.Cache
Throws:
net.sf.hibernate.cache.CacheException

nextTimestamp

public long nextTimestamp()
Generate a (coarse) timestamp

Specified by:
nextTimestamp in interface net.sf.hibernate.cache.Cache

getTimeout

public int getTimeout()
Get a reasonable "lock timeout"

Specified by:
getTimeout in interface net.sf.hibernate.cache.Cache


Copyright © 2002-2004 TrackStudio, Ltd. All Rights Reserved.