Package org.apache.activemq.memory
Interface Cache
- All Known Implementing Classes:
CacheFilter,MapCache,UsageManagerCacheFilter
public interface Cache
Defines the interface used to cache messages.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Lets a cache know it will not be used any further and that it can release acquired resourcesGets an object that was previouslyputinto this object.Puts an object into the cache.Removes an object from the cache.intsize()How big is the cache right now?
-
Method Details
-
get
Gets an object that was previouslyputinto this object.- Parameters:
key-- Returns:
- null if the object was not previously put or if the object has expired out of the cache.
-
put
Puts an object into the cache.- Parameters:
key-value-
-
remove
Removes an object from the cache.- Parameters:
key-- Returns:
- the object associated with the key if it was still in the cache.
-
close
void close()Lets a cache know it will not be used any further and that it can release acquired resources -
size
int size()How big is the cache right now?- Returns:
- the size.
-