org.apache.commons.cache
Class ShareableFileStash
java.lang.Object
org.apache.commons.cache.BaseStash
org.apache.commons.cache.ShareableFileStash
- All Implemented Interfaces:
- Serializable, Stash
public class ShareableFileStash
- extends BaseStash
- implements Stash
tk.
- Version:
- $Id: ShareableFileStash.java 155435 2005-02-26 13:17:27Z dirkv $
- Author:
- Rodney Waldhoff
- See Also:
- Serialized Form
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 File |
getFile(Serializable key,
boolean mkdirs)
|
protected File |
getMoveToLoc()
|
protected byte[] |
getSerializedForm(Serializable val)
|
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 |
_numDirectories
protected int _numDirectories
_rootdir
protected File _rootdir
_maxFilenameLength
protected int _maxFilenameLength
ShareableFileStash
public ShareableFileStash(String root,
int numdirs)
- Parameters:
root
- the root directory to store objects innumdirs
- the number of directories to create under root (must be >0)
ShareableFileStash
public ShareableFileStash(File root,
int numdirs)
- Parameters:
root
- the root directory to store objects innumdirs
- the number of directories to create under root (must be >0)
ShareableFileStash
public ShareableFileStash(File root,
int numdirs,
int maxfilenamelength)
- Parameters:
root
- the root directory to store objects innumdirs
- the number of directories to create under root (must be >0)maxfilenamelength
- the maximum length filename to create
ShareableFileStash
public ShareableFileStash(String root,
int numdirs,
int maxfilenamelength)
- Parameters:
root
- the root directory to store objects innumdirs
- the number of directories to create under root (must be >0)maxfilenamelength
- the maximum length filename to create
getSerializedForm
protected byte[] getSerializedForm(Serializable val)
readFromFile
protected Serializable readFromFile(File file)
getFile
protected File getFile(Serializable key,
boolean mkdirs)
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
wantsSerializedForm
public boolean wantsSerializedForm()
- Description copied from class:
BaseStash
- Returns false.
- Specified by:
wantsSerializedForm
in interface Stash
- Overrides:
wantsSerializedForm
in class BaseStash
- Returns:
- false.
unsetCache
public void unsetCache()
- Specified by:
unsetCache
in interface Stash
- Specified by:
unsetCache
in class BaseStash
setCache
public void setCache(Cache c)
- Specified by:
setCache
in interface Stash
- Specified by:
setCache
in class BaseStash
getMoveToLoc
protected File getMoveToLoc()
Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.