org.apache.commons.cache
Class MemoryStash

java.lang.Object
  extended by org.apache.commons.cache.BaseStash
      extended by org.apache.commons.cache.MemoryStash
All Implemented Interfaces:
Serializable, Stash

public class MemoryStash
extends BaseStash
implements Stash

tk.

Version:
$Id: MemoryStash.java 155435 2005-02-26 13:17:27Z dirkv $
Author:
Rodney Waldhoff
See Also:
Serialized Form

Field Summary
protected  Cache _cache
           
protected  HashMap _hash
           
protected  int _maxObjs
           
 
Fields inherited from interface org.apache.commons.cache.Stash
NO, NO_FULL, NO_NOT_STORABLE, YES
 
Constructor Summary
MemoryStash(int maxobjs)
           
 
Method Summary
 int canStore(Serializable key, Serializable val, Long expiresAt, Long cost, Serializable group, byte[] serialized)
           
 float capacity()
           
 void clear()
           
 void clear(Serializable key)
           
 boolean contains(Serializable key)
           
 Serializable retrieve(Serializable key)
           
 void setCache(Cache c)
           
 boolean store(Serializable key, Serializable val, Long expiresAt, Long cost, Serializable group, byte[] serialized)
           
 void unsetCache()
           
 
Methods inherited from class org.apache.commons.cache.BaseStash
canStore, store, wantsSerializedForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.cache.Stash
canStore, store, wantsSerializedForm
 

Field Detail

_hash

protected HashMap _hash

_maxObjs

protected int _maxObjs

_cache

protected Cache _cache
Constructor Detail

MemoryStash

public MemoryStash(int maxobjs)
Method Detail

canStore

public int canStore(Serializable key,
                    Serializable val,
                    Long expiresAt,
                    Long cost,
                    Serializable group,
                    byte[] serialized)
Specified by:
canStore in interface Stash
Specified by:
canStore in class BaseStash

store

public boolean store(Serializable key,
                     Serializable val,
                     Long expiresAt,
                     Long cost,
                     Serializable group,
                     byte[] serialized)
Specified by:
store in interface Stash
Specified by:
store in class BaseStash

retrieve

public Serializable retrieve(Serializable key)
Specified by:
retrieve in interface Stash
Specified by:
retrieve in class BaseStash

contains

public boolean contains(Serializable key)
Specified by:
contains in interface Stash
Specified by:
contains in class BaseStash

capacity

public float capacity()
Specified by:
capacity in interface Stash
Specified by:
capacity in class BaseStash

clear

public void clear(Serializable key)
Specified by:
clear in interface Stash
Specified by:
clear in class BaseStash

clear

public void clear()
Specified by:
clear in interface Stash

setCache

public void setCache(Cache c)
Specified by:
setCache in interface Stash
Specified by:
setCache in class BaseStash

unsetCache

public void unsetCache()
Specified by:
unsetCache in interface Stash
Specified by:
unsetCache in class BaseStash


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.