|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.hammurapi.cache.AbstractProducer
biz.hammurapi.cache.PassiveMemoryCache
public class 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)
Plugs the component into container and naming bus. |
void |
start()
Invoked by container before the first use. |
void |
stop()
Invoked by container when component is not needed anymore. |
Methods inherited from class biz.hammurapi.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 biz.hammurapi.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 Cache
key
- Keyvalue
- Valuetime
- Timestamp (last modified)expirationTime
- Expiration timepublic Entry get(java.lang.Object key)
get
in interface Producer
public void clear()
Cache
clear
in interface Cache
public void remove(java.lang.Object key)
Cache
remove
in interface Cache
public void remove(Acceptor acceptor)
Cache
remove
in interface Cache
public void stop()
Component
stop
in interface Component
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.util.Set keySet()
keySet
in interface Producer
public boolean isActive()
isActive
in interface Cache
public void start() throws ConfigurationException
Component
start
in interface Component
ConfigurationException
public 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 |