|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.util.store.AbstractMonitoredObjectStore<T> org.mule.util.store.InMemoryObjectStore<T>
public class InMemoryObjectStore<T extends Serializable>
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.
Nested Class Summary | |
---|---|
protected static class |
InMemoryObjectStore.StoredObject<T>
Represents the object stored in the store. |
Field Summary | |
---|---|
protected ConcurrentSkipListMap<Long,InMemoryObjectStore.StoredObject<T>> |
store
|
Fields inherited from class org.mule.util.store.AbstractMonitoredObjectStore |
---|
context, entryTTL, expirationInterval, logger, maxEntries, name, scheduler |
Fields inherited from interface org.mule.api.lifecycle.Initialisable |
---|
PHASE_NAME |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
InMemoryObjectStore()
|
Method Summary | |
---|---|
void |
clear()
Removes all items of this store without disposing it, meaning that after performing a clear(), you should still be able perform other operations. |
boolean |
contains(Serializable key)
Check whether the given Object is already registered with this store. |
void |
expire()
|
boolean |
isPersistent()
Is this store persistent? |
T |
remove(Serializable key)
Remove the object with key. |
T |
retrieve(Serializable key)
Retrieve the given Object. |
void |
store(Serializable id,
T value)
Store the given Object. |
String |
toString()
|
Methods inherited from class org.mule.util.store.AbstractMonitoredObjectStore |
---|
dispose, getEntryTTL, getExpirationInterval, getMaxEntries, getMuleContext, getName, getScheduler, initialise, run, setEntryTTL, setExpirationInterval, setMaxEntries, setMuleContext, setName, setScheduler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ConcurrentSkipListMap<Long,InMemoryObjectStore.StoredObject<T extends Serializable>> store
Constructor Detail |
---|
public InMemoryObjectStore()
Method Detail |
---|
public boolean isPersistent()
ObjectStore
public boolean contains(Serializable key) throws ObjectStoreException
ObjectStore
key
- the identifier of the object to check
true
if the key is stored or false
no value
was stored for the key.
ObjectStoreException
- if the given key is null
.
ObjectStoreNotAvaliableException
- if any implementation-specific error
occured, e.g. when the store is not availablepublic void store(Serializable id, T value) throws ObjectStoreException
ObjectStore
id
- the identifier for value
value
- the Object to store with key
ObjectStoreException
- if the given key cannot be stored or is
null
.
ObjectStoreNotAvaliableException
- if the store is not available or any
other implementation-specific error occured.
ObjectAlreadyExistsException
- if an attempt is made to store an object
for a key that already has an object associated.public T retrieve(Serializable key) throws ObjectStoreException
ObjectStore
key
- the identifier of the object to retrieve.
ObjectDoesNotExistException
.
ObjectStoreException
- if the given key is null
.
ObjectStoreNotAvaliableException
- if the store is not available or any
other implementation-specific error occured.
ObjectDoesNotExistException
- if no value for the given key was
previously stored.public T remove(Serializable key) throws ObjectStoreException
ObjectStore
key
- the identifier of the object to remove.
ObjectStoreException
- if the given key is null
or if the
store is not available or any other implementation-specific error
occured
ObjectDoesNotExistException
- if no value for the given key was
previously stored.public void clear() throws ObjectStoreException
ObjectStore
ObjectStoreException
- if the operation failspublic void expire()
expire
in class AbstractMonitoredObjectStore<T extends Serializable>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |