public class InMemoryObjectStore extends AbstractMonitoredObjectStore
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.DOModifier and Type | Class and Description |
---|---|
protected static class |
InMemoryObjectStore.StoredObject
Represents the object stored in the store.
|
Modifier and Type | Field and Description |
---|---|
protected ConcurrentSkipListMap |
store |
context, entryTTL, expirationInterval, logger, maxEntries, name, scheduler
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
InMemoryObjectStore() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsObject(String id)
Check whether the given Object is already registered with this store.
|
void |
expire() |
boolean |
removeObject(String id) |
Object |
retrieveObject(String id)
Retrieve the given Object.
|
boolean |
storeObject(String id,
Object item)
Store the given Object.
|
dispose, getEntryTTL, getExpirationInterval, getMaxEntries, getName, getScheduler, initialise, run, setEntryTTL, setExpirationInterval, setMaxEntries, setMuleContext, setName, setScheduler
protected ConcurrentSkipListMap store
public boolean containsObject(String id) throws Exception
id
- the ID to checktrue
if the ID is stored or false
if it could
not be foundIllegalArgumentException
- if the given ID is null
Exception
- if any implementation-specific error occured, e.g. when the store
is not availablepublic boolean storeObject(String id, Object item) throws Exception
id
- the ID to storeitem
- the Object to store with the idtrue
if the ID was stored properly, or false
if it already existedIllegalArgumentException
- if the given ID cannot be stored or is
null
Exception
- if the store is not available or any other
implementation-specific error occuredpublic Object retrieveObject(String id) throws Exception
id
- the ID to storeIllegalArgumentException
- if the given ID cannot be stored or is
null
Exception
- if the store is not available or any other
implementation-specific error occuredpublic final void expire()
expire
in class AbstractMonitoredObjectStore
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.