|
|||||||||||
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.SimpleMemoryCache
Simple cache. Uses map internally.
Constructor Summary | |
SimpleMemoryCache(Producer producer)
|
Method Summary | |
void |
clear()
Removes all cache entries |
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.pavelvlasov.cache.Producer |
addCache |
Constructor Detail |
public SimpleMemoryCache(Producer producer)
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
key
- public void remove(Acceptor acceptor)
Cache
remove
in interface Cache
acceptor
- public void stop()
Component
stop
in interface Component
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 |