public abstract class AbstractObjectStore<T extends Serializable> extends Object implements ObjectStore<T>
ObjectStore implementations that conforms to the
contract defined in the interface's javadocs. Subclasses only need to implement storing the
actual objects.| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
AbstractObjectStore() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Serializable key)
Check whether the given Object is already registered with this store.
|
protected abstract boolean |
doContains(Serializable key) |
protected abstract T |
doRemove(Serializable key) |
protected abstract T |
doRetrieve(Serializable key) |
protected abstract void |
doStore(Serializable key,
T value) |
T |
remove(Serializable key)
Remove the object with key.
|
T |
retrieve(Serializable key)
Retrieve the given Object.
|
void |
store(Serializable key,
T value)
Store the given Object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclear, isPersistentpublic boolean contains(Serializable key) throws ObjectStoreException
ObjectStorecontains in interface ObjectStore<T extends Serializable>key - the identifier of the object to checktrue 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 availableprotected abstract boolean doContains(Serializable key) throws ObjectStoreException
ObjectStoreExceptionpublic void store(Serializable key, T value) throws ObjectStoreException
ObjectStorestore in interface ObjectStore<T extends Serializable>key - the identifier for valuevalue - the Object to store with keyObjectStoreException - 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.protected abstract void doStore(Serializable key, T value) throws ObjectStoreException
ObjectStoreExceptionpublic T retrieve(Serializable key) throws ObjectStoreException
ObjectStoreretrieve in interface ObjectStore<T extends Serializable>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.protected abstract T doRetrieve(Serializable key) throws ObjectStoreException
ObjectStoreExceptionpublic T remove(Serializable key) throws ObjectStoreException
ObjectStoreremove in interface ObjectStore<T extends Serializable>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
occuredObjectDoesNotExistException - if no value for the given key was
previously stored.protected abstract T doRemove(Serializable key) throws ObjectStoreException
ObjectStoreExceptionCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.