public class SimpleMemoryObjectStore<T extends Serializable> extends TemplateObjectStore<T> implements ObjectStore<T>
Constructor and Description |
---|
SimpleMemoryObjectStore() |
Modifier and Type | Method and Description |
---|---|
List<String> |
allKeys() |
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.
|
void |
close()
Close the underlying store.
|
protected boolean |
doContains(String key)
Template method for
TemplateObjectStore.contains(String) . |
protected T |
doRemove(String key)
Template method for
TemplateObjectStore.remove(String) (String, Serializable)}. |
protected T |
doRetrieve(String key)
Template method for
TemplateObjectStore.store(String, Serializable) . |
protected void |
doStore(String key,
T value)
Template method for
TemplateObjectStore.store(String, Serializable) . |
boolean |
isPersistent() |
void |
open()
Open the underlying store.
|
Map<String,T> |
retrieveAll() |
contains, remove, retrieve, store
validateKey, validatePresentKey
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, remove, retrieve, store
public boolean isPersistent()
isPersistent
in interface ObjectStore<T extends Serializable>
this
store is persistent or notprotected boolean doContains(String key) throws ObjectStoreException
TemplateObjectStore
TemplateObjectStore.contains(String)
. Implement this method assuming that
the key
is already valid
doContains
in class TemplateObjectStore<T extends Serializable>
ObjectStoreException
protected void doStore(String key, T value) throws ObjectStoreException
TemplateObjectStore
TemplateObjectStore.store(String, Serializable)
. Implement this method assuming that the key is valid
and that TemplateObjectStore.contains(String)
has already been invoked to verify that the key doesn't already exists
in this store.
doStore
in class TemplateObjectStore<T extends Serializable>
ObjectStoreException
protected T doRetrieve(String key) throws ObjectStoreException
TemplateObjectStore
TemplateObjectStore.store(String, Serializable)
. Implement this method assuming that the key is valid
and that TemplateObjectStore.contains(String)
has already been invoked to verify that the key actually exists in this store.
doRetrieve
in class TemplateObjectStore<T extends Serializable>
ObjectStoreException
public void clear() throws ObjectStoreException
ObjectStore
clear
in interface ObjectStore<T extends Serializable>
ObjectStoreException
- if the operation failsprotected T doRemove(String key)
TemplateObjectStore
TemplateObjectStore.remove(String)
(String, Serializable)}. Implement this method assuming that the key is valid
and that TemplateObjectStore.contains(String)
has already been invoked to verify that the key actually exists in this store.
doRemove
in class TemplateObjectStore<T extends Serializable>
public Map<String,T> retrieveAll() throws ObjectStoreException
retrieveAll
in interface ObjectStore<T extends Serializable>
ObjectStoreException
- if an exception occurred while collecting the valuespublic void open() throws ObjectStoreException
ObjectStore
open
in interface ObjectStore<T extends Serializable>
ObjectStoreException
- if an exception occurred while opening the underlying store.public void close() throws ObjectStoreException
ObjectStore
close
in interface ObjectStore<T extends Serializable>
ObjectStoreException
- if an exception occurred while closing the underlying store.public List<String> allKeys() throws ObjectStoreException
allKeys
in interface ObjectStore<T extends Serializable>
ObjectStoreException
- if an exception occurred while collecting the list of all keys.Copyright © 2018. All rights reserved.