org.apache.commons.cache
Class FileStash
java.lang.Object
org.apache.commons.cache.BaseStash
org.apache.commons.cache.FileStash
- All Implemented Interfaces:
- Serializable, Stash
public class FileStash
- extends BaseStash
- implements Stash
tk.
- Version:
- $Id: FileStash.java 155435 2005-02-26 13:17:27Z dirkv $
- Author:
- Rodney Waldhoff
- See Also:
- Serialized Form
Constructor Summary |
FileStash()
|
FileStash(long maxbytes)
|
FileStash(long maxbytes,
long maxobjs)
|
FileStash(long maxbytes,
long maxobjs,
File[] tempdirs,
boolean cleanup)
|
FileStash(long maxbytes,
long maxobjs,
File rootdir,
int numdirs)
|
FileStash(long maxbytes,
long maxobjs,
File rootdir,
int numdirs,
boolean cleanup)
|
FileStash(long maxbytes,
long maxobjs,
String rootdir,
int numdirs)
|
FileStash(long maxbytes,
long maxobjs,
String rootdir,
int numdirs,
boolean cleanup)
|
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)
|
protected byte[] |
getSerializedForm(Serializable val)
|
protected File |
getTempfile()
|
protected Serializable |
readFromFile(File file)
|
Serializable |
retrieve(Serializable key)
|
void |
setCache(Cache c)
|
boolean |
store(Serializable key,
Serializable val,
Long expiresAt,
Long cost,
Serializable group,
byte[] serialized)
|
void |
unsetCache()
|
boolean |
wantsSerializedForm()
Returns false. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_MAX_OBJS
public static final transient long DEFAULT_MAX_OBJS
DEFAULT_MAX_BYTES
public static final transient long DEFAULT_MAX_BYTES
DEFAULT_TEMP_DIRS
public static final transient File[] DEFAULT_TEMP_DIRS
DEFAULT_FILE_PREFIX
public static final transient String DEFAULT_FILE_PREFIX
DEFAULT_FILE_SUFFIX
public static final transient String DEFAULT_FILE_SUFFIX
_hash
protected HashMap _hash
_maxObjs
protected long _maxObjs
_maxBytes
protected long _maxBytes
_cache
protected Cache _cache
_curBytes
protected long _curBytes
_tempFileDirs
protected File[] _tempFileDirs
_tempFilePrefix
protected String _tempFilePrefix
_tempFileSuffix
protected String _tempFileSuffix
_cleanupfiles
protected boolean _cleanupfiles
_tempfileCounter
protected int _tempfileCounter
FileStash
public FileStash()
FileStash
public FileStash(long maxbytes)
FileStash
public FileStash(long maxbytes,
long maxobjs)
FileStash
public FileStash(long maxbytes,
long maxobjs,
File[] tempdirs,
boolean cleanup)
FileStash
public FileStash(long maxbytes,
long maxobjs,
String rootdir,
int numdirs)
FileStash
public FileStash(long maxbytes,
long maxobjs,
String rootdir,
int numdirs,
boolean cleanup)
FileStash
public FileStash(long maxbytes,
long maxobjs,
File rootdir,
int numdirs)
FileStash
public FileStash(long maxbytes,
long maxobjs,
File rootdir,
int numdirs,
boolean cleanup)
getSerializedForm
protected byte[] getSerializedForm(Serializable val)
readFromFile
protected Serializable readFromFile(File file)
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
getTempfile
protected File getTempfile()
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
wantsSerializedForm
public boolean wantsSerializedForm()
- Description copied from class:
BaseStash
- Returns false.
- Specified by:
wantsSerializedForm
in interface Stash
- Overrides:
wantsSerializedForm
in class BaseStash
- Returns:
- false.
Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.