public class InMemoryObjectStore<T extends Serializable> extends AbstractMonitoredObjectStore<T>
InMemoryObjectStore implements an optionally bounded in-memory store for message IDs with periodic expiry of old
entries. The bounded size is a soft limit and only enforced periodically by the expiry process; this means that the
store may temporarily exceed its maximum size between expiry runs, but will eventually shrink to its configured size.| Modifier and Type | Class and Description |
|---|---|
protected static class |
InMemoryObjectStore.StoredObject<T>
Represents the object stored in the store.
|
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentSkipListMap<Long,InMemoryObjectStore.StoredObject<T>> |
store |
context, entryTTL, expirationInterval, logger, maxEntries, name| Constructor and Description |
|---|
InMemoryObjectStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
contains(Serializable key) |
protected int |
doTrimAndExpire() |
void |
expire() |
protected int |
expireAndCount() |
protected boolean |
isExpirationNeeded() |
boolean |
isPersistent() |
protected boolean |
isTrimNeeded(int currentSize) |
T |
remove(Serializable key) |
T |
retrieve(Serializable key) |
void |
store(Serializable id,
T value) |
String |
toString() |
dispose, getEntryTTL, getExpirationInterval, getMaxEntries, getMuleContext, getName, initialise, run, setEntryTTL, setExpirationInterval, setMaxEntries, setMuleContext, setNameprotected ConcurrentSkipListMap<Long,InMemoryObjectStore.StoredObject<T extends Serializable>> store
public boolean isPersistent()
public boolean contains(Serializable key) throws org.mule.runtime.api.store.ObjectStoreException
org.mule.runtime.api.store.ObjectStoreExceptionpublic void store(Serializable id, T value) throws org.mule.runtime.api.store.ObjectStoreException
org.mule.runtime.api.store.ObjectStoreExceptionpublic T retrieve(Serializable key) throws org.mule.runtime.api.store.ObjectStoreException
org.mule.runtime.api.store.ObjectStoreExceptionpublic T remove(Serializable key) throws org.mule.runtime.api.store.ObjectStoreException
org.mule.runtime.api.store.ObjectStoreExceptionpublic void clear()
throws org.mule.runtime.api.store.ObjectStoreException
org.mule.runtime.api.store.ObjectStoreExceptionprotected int expireAndCount()
protected boolean isTrimNeeded(int currentSize)
protected boolean isExpirationNeeded()
protected int doTrimAndExpire()
public void expire()
expire in class AbstractMonitoredObjectStore<T extends Serializable>Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.