|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.riotfamily.cachius.CacheEntry
public class CacheEntry
Class that holds a reference to the actual cached data and a lock that can be used to synchronize the access. It also keeps track of the last access time so that least recently used items can be evicted if the cache capacity is exceeded.
| Constructor Summary | |
|---|---|
CacheEntry(String key,
File cacheDir)
|
|
| Method Summary | |
|---|---|
protected void |
delete()
|
boolean |
equals(Object obj)
|
CacheItem |
getItem()
|
String |
getKey()
Returns the key. |
long |
getLastAccess()
Returns the last access time. |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
getLock()
Returns the lock. |
int |
hashCode()
|
CacheItem |
newItem()
|
void |
replaceItem(CacheItem newItem)
|
String |
toString()
|
protected void |
touch()
Sets the lastUsed timestamp to the current time. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CacheEntry(String key,
File cacheDir)
throws IOException
IOException| Method Detail |
|---|
public String getKey()
public CacheItem getItem()
public void replaceItem(CacheItem newItem)
public CacheItem newItem()
throws IOException
IOExceptionprotected java.util.concurrent.locks.ReentrantReadWriteLock getLock()
protected void touch()
public long getLastAccess()
protected void delete()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||