ome.services.util.cache
Class DiskCache<K extends ome.model.IObject,V extends Serializable>

java.lang.Object
  extended by ome.services.util.cache.DiskCache<K,V>
All Implemented Interfaces:
Cache<K,V>

public class DiskCache<K extends ome.model.IObject,V extends Serializable>
extends Object
implements Cache<K,V>

Disk cache which is keyed to a particular type. Possible to wrap with IdBackedStore to have elements removed if the backing type is also removed.

Since:
3.0-Beta4
Author:
Josh Moore, josh at glencoesoftware.com

Constructor Summary
DiskCache(LocalQuery query, net.sf.ehcache.CacheManager manager, String name, File dataDir, Class<K> objectType)
           
 
Method Summary
 V get(long id)
           
 List<Long> getKeys()
           
 Class<K> getType()
           
 void put(long id, V s)
           
 void reap()
           
 void remove(long id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiskCache

public DiskCache(LocalQuery query,
                 net.sf.ehcache.CacheManager manager,
                 String name,
                 File dataDir,
                 Class<K> objectType)
Method Detail

getType

public Class<K> getType()
Specified by:
getType in interface Cache<K extends ome.model.IObject,V extends Serializable>

getKeys

public List<Long> getKeys()
Specified by:
getKeys in interface Cache<K extends ome.model.IObject,V extends Serializable>

get

public V get(long id)
Specified by:
get in interface Cache<K extends ome.model.IObject,V extends Serializable>

put

public void put(long id,
                V s)
Specified by:
put in interface Cache<K extends ome.model.IObject,V extends Serializable>

remove

public void remove(long id)
Specified by:
remove in interface Cache<K extends ome.model.IObject,V extends Serializable>

reap

public void reap()
Specified by:
reap in interface Cache<K extends ome.model.IObject,V extends Serializable>


OmeroJava Api

Version: Beta-4.2.0-r7571-b29

Copyright © 2009 The University of Dundee. All Rights Reserved.