public class FRCache
extends java.lang.Object
implements java.io.Serializable
构造器和说明 |
---|
FRCache(CacheConfiguration config) |
限定符和类型 | 方法和说明 |
---|---|
void |
dispose() |
Unity |
get(java.lang.Object key)
Gets an element from the cache.
|
RegisteredEventListeners |
getCacheEventNotificationService()
Use this to access the service in order to register and unregister listeners
|
int |
getMaxElementsInMemory()
Gets the maximum number of elements to hold in memory.
|
MemoryStoreEvictionPolicy |
getMemoryStoreEvictionPolicy() |
java.lang.Object |
getObject(java.lang.Object key) |
Status |
getStatus() |
MemoryStore |
getStore() |
boolean |
isExpired(Unity unity) |
void |
put(java.lang.Object key,
java.lang.Object value) |
void |
put(Unity unity) |
boolean |
remove(java.lang.Object key)
Removes or expires an Unity from the Cache after an attempt to get it determined that it should be expired.
|
public FRCache(CacheConfiguration config)
public final void put(java.lang.Object key, java.lang.Object value)
public final void put(Unity unity)
public final java.lang.Object getObject(java.lang.Object key)
public final Unity get(java.lang.Object key) throws java.lang.IllegalStateException, CacheException
#getQuiet(Object)
to peak into the Element to see its last access time with get
Synchronization is handled within the method.key
- an Object valuejava.lang.IllegalStateException
- if the cache is not Status#STATUS_ALIVECacheException
isExpired(com.fr.cache.Unity)
public final boolean isExpired(Unity unity) throws java.lang.IllegalStateException, java.lang.NullPointerException
java.lang.IllegalStateException
java.lang.NullPointerException
public MemoryStore getStore()
public boolean remove(java.lang.Object key) throws java.lang.IllegalStateException
key
- the element key to operate onexpiry
- if the reason this method is being called is to expire the elementnotifyListeners
- whether to notify listenersdoNotNotifyCacheReplicators
- whether not to notify cache replicatorsjava.lang.IllegalStateException
- if the cache is not Status#STATUS_ALIVEpublic final RegisteredEventListeners getCacheEventNotificationService()
public final int getMaxElementsInMemory()
public final MemoryStoreEvictionPolicy getMemoryStoreEvictionPolicy()
public final Status getStatus()
public void dispose() throws java.lang.IllegalStateException
java.lang.IllegalStateException