Package one.microstream.persistence.util
Interface Reloader
- All Known Implementing Classes:
Reloader.Default
public interface Reloader
Utility to reload objects or object graphs.
Reload means that the in-memory state of the objects is reset to the state of the underlying storage.
Usage:
EmbeddedStorageManager storage = ...; Reloader reloader = Reloader.New(storage.persistenceManager()); reloader.reloadFlat(obj); // reloads only the given object, but not its references reloader.reloadDeep(obj); // reloads the complete object graph
- Since:
- 08.00.00
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classReloader.Default -
Method Summary
Modifier and Type Method Description static ReloaderNew(PersistenceManager<?> persistenceManager)Pseudo-constructor method to create a newReloader.<T> TreloadDeep(T instance)Resets the state of the given instance and all of its references to the state of the underlying storage.<T> TreloadFlat(T instance)Resets the state of the given instance to the state of the underlying storage.
-
Method Details
-
reloadFlat
<T> T reloadFlat(T instance)Resets the state of the given instance to the state of the underlying storage. But not its references.- Type Parameters:
T- type of the instance- Parameters:
instance- the object to reload- Returns:
- the reloaded object, or
nullif it was not found in the storage
-
reloadDeep
<T> T reloadDeep(T instance)Resets the state of the given instance and all of its references to the state of the underlying storage.- Type Parameters:
T- type of the instance- Parameters:
instance- the object to reload- Returns:
- the reloaded object, or
nullif it was not found in the storage
-
New
Pseudo-constructor method to create a newReloader.- Parameters:
persistenceManager- the persistence manager to reload from- Returns:
- a newly created
Reloader
-