T - allows enforcing subtypes of Identifiablepublic class XMLStorage<T extends Identifiable> extends AbstractStorage<T,XMLStorageConf> implements Storage<T,XMLStorageConf>
| Constructor and Description |
|---|
XMLStorage(XMLStorageConf storageConf) |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(T object) |
XMLStorageConf |
getStorageConf() |
void |
refresh(Object object) |
void |
registerPostStoreCallback(T object,
StorageCallback callback)
Registers a callback which is executed right after
object is
stored with Storage.store(java.lang.Object). |
void |
registerPreStoreCallback(T object,
StorageCallback callback)
Registers a callback which is executed right before
object is
stored with Storage.store(java.lang.Object). |
<U extends T> |
retrieve(Object id,
Class<U> clazz)
Retrieves the instance with ID
id of type clazz from
storage. |
void |
shutdown()
Frees eventually aquired resources.
|
void |
start()
Starts referenced resources.
|
void |
store(T object) |
void |
update(T object) |
getPostStoreCallbacks, getPreStoreCallbacks, isStartedpublic XMLStorage(XMLStorageConf storageConf)
public void store(T object) throws StorageException
store in interface Storage<T extends Identifiable,XMLStorageConf>StorageExceptionpublic <U extends T> U retrieve(Object id, Class<U> clazz) throws StorageException
Storageid of type clazz from
storage.retrieve in interface Storage<T extends Identifiable,XMLStorageConf>U - allows enforcing a subtype of the type of the storage via the
clazz parameterStorageException - wraps any exception occuring during storagepublic void update(T object) throws StorageException
update in interface Storage<T extends Identifiable,XMLStorageConf>StorageExceptionpublic void delete(T object) throws StorageException
delete in interface Storage<T extends Identifiable,XMLStorageConf>StorageExceptionpublic void refresh(Object object) throws StorageException
refresh in interface Storage<T extends Identifiable,XMLStorageConf>StorageExceptionpublic void start()
throws StorageCreationException
Storagestart in interface Storage<T extends Identifiable,XMLStorageConf>start in class AbstractStorage<T extends Identifiable,XMLStorageConf>StorageCreationException - wraps any exception which occurs during the creation of this storagepublic void shutdown()
Storageshutdown in interface Storage<T extends Identifiable,XMLStorageConf>public XMLStorageConf getStorageConf()
getStorageConf in interface Storage<T extends Identifiable,XMLStorageConf>public void registerPostStoreCallback(T object, StorageCallback callback)
Storageobject is
stored with Storage.store(java.lang.Object).
Note that entities are supposed to be equals in all persistent entity
states transient, attached, detached and removedhttps://vladmihalcea.com/2014/07/30/a-beginners-guide-to-jpahibernate-entity-state-transitions/
and if they're not this method will explicitly has undefined behaviour.registerPostStoreCallback in interface Storage<T extends Identifiable,XMLStorageConf>registerPostStoreCallback in class AbstractStorage<T extends Identifiable,XMLStorageConf>object - the object the callback ought to be registered forcallback - the callback to registerpublic void registerPreStoreCallback(T object, StorageCallback callback)
Storageobject is
stored with Storage.store(java.lang.Object).
Note that entities are supposed to be equals in all persistent entity
states transient, attached, detached and removedhttps://vladmihalcea.com/2014/07/30/a-beginners-guide-to-jpahibernate-entity-state-transitions/
and if they're not this method will explicitly has undefined behaviour.registerPreStoreCallback in interface Storage<T extends Identifiable,XMLStorageConf>registerPreStoreCallback in class AbstractStorage<T extends Identifiable,XMLStorageConf>object - the object the callback ought to be registered forcallback - the callback to registerCopyright © 2018. All rights reserved.