@ParametersAreNonnullByDefault public abstract class AbstractBackend extends AbstractDataMapper implements Backend
Backend
that provides a global behavior about the closure.Modifier | Constructor and Description |
---|---|
protected |
AbstractBackend()
Constructs a new
AbstractBackend . |
protected |
AbstractBackend(String name)
Constructs a new
AbstractBackend with the given name . |
Modifier and Type | Method and Description |
---|---|
Stream<Id> |
allInstancesOf(ClassBean metaClass,
boolean strict)
Retrieves all instances of the given
metaClass . |
void |
close()
Cleanly closes this manager, clear all data in-memory and releases any system resources associated with it.
|
void |
copyTo(DataMapper target) |
protected abstract void |
internalClose()
Cleanly closes the database, and releases any system resources associated with it.
|
protected void |
internalCopyTo(DataMapper target)
Copies the content of this back-end to the
target , using a specific implementation when the target is an instance of this back-end. |
protected abstract void |
internalSave()
Saves all modifications made on this back-end since the last call.
|
void |
save()
Saves all changes made on this manager since the last call.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isDistributed, isPersistent
containerFor, containerOf, removeContainer
allInstancesOf, metaClassFor, metaClassOf
addAllValues, addValue, allValuesOf, appendAllValues, appendValue, removeAllValues, removeValue, sizeOfValue, valueFor, valueOf
removeValue, valueFor, valueOf
addAllReferences, addReference, allReferencesOf, appendAllReferences, appendReference, referenceFor, referenceOf, removeAllReferences, removeReference, sizeOfReference
referenceFor, referenceOf, removeReference
public final void close()
Saveable
Cleanly closes this manager, clear all data in-memory and releases any system resources associated with it. All modifications are saved before closing.
If the manager is already closed, then invoking this method has no effect.
public final void save()
Saveable
protected abstract void internalClose() throws IOException
IOException
- if an I/O error occurs when closingprotected abstract void internalSave() throws IOException
IOException
- if an I/O error occurs when saving@Nonnull public final Stream<Id> allInstancesOf(ClassBean metaClass, boolean strict)
ClassMapper
metaClass
.allInstancesOf
in interface ClassMapper
metaClass
- the meta-class to compute the instances ofstrict
- true
if the lookup searches for strict instancesStream
containing the instances of the metaClass
public void copyTo(DataMapper target)
copyTo
in interface Copiable<DataMapper>
protected void internalCopyTo(DataMapper target)
target
, using a specific implementation when the target
is an instance of this back-end.target
- the back-end where to store the copied contentUnsupportedOperationException
- if this back-end does not support the specific copyCopyright © 2013–2019 Atlanmod. All rights reserved.