|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.pavelvlasov.cache.AbstractProducer
com.pavelvlasov.cache.PassiveMemoryCache
Memory sensitive cache. Uses soft references to cache objects. Doesn't create helper threads - housekeepeng happens on every 'cleanupInterval' get() invocation.
| Constructor Summary | |
PassiveMemoryCache(Producer producer,
Cache fallBack,
int cleanupInterval)
|
|
| Method Summary | |
void |
clear()
Removes all cache entries |
protected void |
finalize()
|
Entry |
get(java.lang.Object key)
|
boolean |
isActive()
|
java.util.Set |
keySet()
|
void |
put(java.lang.Object key,
java.lang.Object value,
long time,
long expirationTime)
Puts entry to cache |
void |
remove(Acceptor acceptor)
Removes keys accepted by acceptor |
void |
remove(java.lang.Object key)
Removes entry with specified key |
void |
setOwner(java.lang.Object owner)
Invoked by container to set component owner for callbacks. |
void |
start()
Invoked by container before the first use. |
void |
stop()
Invoked by container when component is not needed anymore. |
| Methods inherited from class com.pavelvlasov.cache.AbstractProducer |
addCache, onRemove |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.pavelvlasov.cache.Producer |
addCache |
| Constructor Detail |
public PassiveMemoryCache(Producer producer,
Cache fallBack,
int cleanupInterval)
| Method Detail |
public void put(java.lang.Object key,
java.lang.Object value,
long time,
long expirationTime)
Cache
put in interface Cachekey - Keyvalue - Valuetime - Timestamp (last modified)expirationTime - Expiration timepublic Entry get(java.lang.Object key)
get in interface Producerpublic void clear()
Cache
clear in interface Cachepublic void remove(java.lang.Object key)
Cache
remove in interface Cachekey - public void remove(Acceptor acceptor)
Cache
remove in interface Cacheacceptor - public void stop()
Component
stop in interface Component
protected void finalize()
throws java.lang.Throwable
java.lang.Throwablepublic java.util.Set keySet()
keySet in interface Producerpublic boolean isActive()
isActive in interface Cache
public void start()
throws ConfigurationException
Component
start in interface ComponentConfigurationExceptionpublic void setOwner(java.lang.Object owner)
Component
setOwner in interface Component
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||