Class EmbeddedStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- java.lang.Object
-
- one.microstream.util.InstanceDispatcher.Default
-
- one.microstream.storage.types.StorageFoundation.Default<F>
-
- one.microstream.storage.types.EmbeddedStorageFoundation.Default<F>
-
- All Implemented Interfaces:
Unpersistable
,EmbeddedStorageFoundation<F>
,StorageFoundation<F>
,InstanceDispatcher
- Enclosing interface:
- EmbeddedStorageFoundation<F extends EmbeddedStorageFoundation<?>>
public static class EmbeddedStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>> extends StorageFoundation.Default<F> implements EmbeddedStorageFoundation<F>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface one.microstream.storage.types.EmbeddedStorageFoundation
EmbeddedStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
-
Nested classes/interfaces inherited from interface one.microstream.util.InstanceDispatcher
InstanceDispatcher.Default
-
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageFoundation
StorageFoundation.Default<F extends StorageFoundation.Default<?>>
-
-
Constructor Summary
Constructors Constructor Description Default()
-
Method Summary
-
Methods inherited from class one.microstream.storage.types.StorageFoundation.Default
createStorageManager, getBackupThreadProvider, getChannelCreator, getChannelThreadProvider, getConfiguration, getDataChunkValidatorProvider, getDataChunkValidatorProvider2, getDataFileValidatorCreator, getEntityDataIteratorProvider, getEntityDataValidatorCreator, getEntityMarkMonitorCreator, getExceptionHandler, getGCZombieOidHandler, getInitialDataFileNumberProvider, getLockFileManagerCreator, getLockFileManagerThreadProvider, getLockFileSetup, getLockFileSetupProvider, getObjectIdRangeEvaluator, getOidMarkQueueCreator, getOperationControllerCreator, getProcessIdentityProvider, getReaderProvider, getRequestAcceptorCreator, getRequestTaskCreator, getRootOidSelectorProvider, getRootTypeIdProvider, getTaskBrokerCreator, getThreadProvider, getTimestampProvider, getTypeDictionary, getWriterProvider, isByteOrderMismatch, setBackupThreadProvider, setChannelThreadProvider, setDataChunkValidatorProvider2, setDataFileValidatorCreator, setEntityDataIteratorProvider, setEntityDataValidatorCreator, setEntityMarkMonitorCreator, setExceptionHandler, setGCZombieOidHandler, setInitialDataFileNumberProvider, setLockFileManagerCreator, setLockFileManagerThreadProvider, setLockFileSetup, setLockFileSetupProvider, setObjectIdRangeEvaluator, setOidMarkQueueCreator, setOperationControllerCreator, setProcessIdentityProvider, setReaderProvider, setRootOidSelectorProvider, setThreadProvider, setWriterProvider
-
Methods inherited from class one.microstream.util.InstanceDispatcher.Default
getInstanceDispatcherLogic, setInstanceDispatcherLogic
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface one.microstream.storage.types.EmbeddedStorageFoundation
createEmbeddedStorageManager, createEmbeddedStorageManager, start, start
-
Methods inherited from interface one.microstream.storage.types.StorageFoundation
createStorageManager, getBackupThreadProvider, getChannelCreator, getChannelThreadProvider, getConfiguration, getDataChunkValidatorProvider, getDataChunkValidatorProvider2, getDataFileValidatorCreator, getEntityDataIteratorProvider, getEntityDataValidatorCreator, getEntityMarkMonitorCreator, getExceptionHandler, getGCZombieOidHandler, getInitialDataFileNumberProvider, getLockFileManagerCreator, getLockFileManagerThreadProvider, getLockFileSetup, getLockFileSetupProvider, getObjectIdRangeEvaluator, getOidMarkQueueCreator, getOperationControllerCreator, getProcessIdentityProvider, getReaderProvider, getRequestAcceptorCreator, getRequestTaskCreator, getRootOidSelectorProvider, getRootTypeIdProvider, getTaskBrokerCreator, getThreadProvider, getTimestampProvider, getTypeDictionary, getWriterProvider, setBackupThreadProvider, setChannelThreadProvider, setDataChunkValidatorProvider2, setDataFileValidatorCreator, setEntityDataIteratorProvider, setEntityDataValidatorCreator, setEntityMarkMonitorCreator, setExceptionHandler, setGCZombieOidHandler, setInitialDataFileNumberProvider, setLockFileManagerCreator, setLockFileManagerThreadProvider, setLockFileSetup, setLockFileSetupProvider, setObjectIdRangeEvaluator, setOidMarkQueueCreator, setOperationControllerCreator, setProcessIdentityProvider, setReaderProvider, setRootOidSelectorProvider, setThreadProvider, setWriterProvider
-
-
-
-
Method Detail
-
onConnectionFoundation
public F onConnectionFoundation(Consumer<? super EmbeddedStorageConnectionFoundation<?>> logic)
Description copied from interface:EmbeddedStorageFoundation
Executes the passed logic on theEmbeddedStorageConnectionFoundation
instance provided byEmbeddedStorageFoundation.getConnectionFoundation()
.This is a mere utility method to allow more concise syntax and multi-layered method chaining.
- Specified by:
onConnectionFoundation
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
logic
- the logic to be executed.- Returns:
- this to allow method chaining.
-
onThis
public F onThis(Consumer<? super EmbeddedStorageFoundation<?>> logic)
Description copied from interface:EmbeddedStorageFoundation
Executes the passed logic on this.This is a mere utility method to allow more concise syntax and multi-layered method chaining.
- Specified by:
onThis
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
logic
- the logic to be executed.- Returns:
- this to allow method chaining.
-
setRoot
public F setRoot(Object root)
Description copied from interface:EmbeddedStorageFoundation
Registers the passed root instance as the root instance at theEmbeddedStorageConnectionFoundation
instance provided byEmbeddedStorageFoundation.getConnectionFoundation()
.
UseEmbeddedStorageFoundation.setRootSupplier(Supplier)
for a more dynamic approach, i.e. if the actual root instance must be created after setting up and creating theEmbeddedStorageManager
.- Specified by:
setRoot
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
root
- the instance to be used as the persistent entity graph's root instance.- Returns:
- this to allow method chaining.
- See Also:
EmbeddedStorageFoundation.setRootSupplier(Supplier)
,#setRootResolverProvider(PersistenceRootResolver)
,EmbeddedStorageConnectionFoundation#setRootResolverProvider(PersistenceRootResolver)
-
setRootSupplier
public F setRootSupplier(Supplier<?> rootSupplier)
Description copied from interface:EmbeddedStorageFoundation
Registers the passed rootSupplierSupplier
as the root instance supplier at thePersistenceRootResolverProvider
instance provided byPersistenceFoundation.getRootResolverProvider()
of theEmbeddedStorageConnectionFoundation
instance provided byEmbeddedStorageFoundation.getConnectionFoundation()
.This means this method is merely an alias for
.onConnectionFoundation(f -> f.getRootResolverProvider().registerCustomRootSupplier(rootSupplier);
) }Note that replacing the
PersistenceRootResolverProvider
instance, for example via #setRootResolverProvider, will nullify the changes made via this method.The actual root instance will be queried during startup, not before.
This technique allows a more dynamic approach thanEmbeddedStorageFoundation.setRoot(Object)
, i.e. if the actual root instance must be created after setting up and creating theEmbeddedStorageManager
.- Specified by:
setRootSupplier
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
rootSupplier
- the supplying logic to obtain the instance to be used during startup as the persistent entity graph's root instance.- Returns:
- this to allow method chaining.
- See Also:
EmbeddedStorageManager.start()
,EmbeddedStorageFoundation.setRoot(Object)
,#setRootResolverProvider(PersistenceRootResolver)
,EmbeddedStorageConnectionFoundation#setRootResolverProvider(PersistenceRootResolver)
,EmbeddedStorageConnectionFoundation#registerCustomRootSupplier(PersistenceRootResolver)
-
setRootResolverProvider
public F setRootResolverProvider(PersistenceRootResolverProvider rootResolverProvider)
Description copied from interface:EmbeddedStorageFoundation
Alias for.onConnectionFoundation(f -> f.setRootResolverProvider(rootResolverProvider);
) }PersistenceRootResolverProvider
instance to be used in the internalEmbeddedStorageConnectionFoundation
.- Specified by:
setRootResolverProvider
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
rootResolverProvider
- thePersistenceRootResolverProvider
to be set.- Returns:
- this to allow method chaining.
- See Also:
EmbeddedStorageFoundation.setRootSupplier(Supplier)
,EmbeddedStorageConnectionFoundation#setRootResolverProvider(PersistenceRootResolver)
-
getConnectionFoundation
public EmbeddedStorageConnectionFoundation<?> getConnectionFoundation()
Description copied from interface:EmbeddedStorageFoundation
Returns the currently setStorageConfiguration
instance.If no instance is set and the implementation deems an instance of this type mandatory for the successful executon of
EmbeddedStorageFoundation.createEmbeddedStorageManager()
, a suitable instance is created via an internal default creation logic and then set as the current. If the implementation has not sufficient logic and/or data to create a default instance, aMissingFoundationPartException
is thrown.- Specified by:
getConnectionFoundation
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Returns:
- the currently set instance, potentially created on-demand if required.
-
getRootResolverProvider
public PersistenceRootResolverProvider getRootResolverProvider()
Description copied from interface:EmbeddedStorageFoundation
Returns the internalEmbeddedStorageConnectionFoundation
instance'sPersistenceRootResolverProvider
instance. If none is present so far, a new default one is created.- Specified by:
getRootResolverProvider
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Returns:
- the
PersistenceRootResolverProvider
instance to be used.
-
setConfiguration
public F setConfiguration(StorageConfiguration configuration)
Description copied from interface:StorageFoundation
Sets theStorageConfiguration
instance to be used for the assembly.- Specified by:
setConfiguration
in interfaceStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Overrides:
setConfiguration
in classStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
configuration
- the instance to be used.- Returns:
- this to allow method chaining.
-
setRequestAcceptorCreator
public F setRequestAcceptorCreator(StorageRequestAcceptor.Creator requestAcceptorCreator)
Description copied from interface:StorageFoundation
Sets theStorageRequestAcceptor.Creator
instance to be used for the assembly.- Specified by:
setRequestAcceptorCreator
in interfaceStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Overrides:
setRequestAcceptorCreator
in classStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
requestAcceptorCreator
- the instance to be used.- Returns:
- this to allow method chaining.
-
setTaskBrokerCreator
public F setTaskBrokerCreator(StorageTaskBroker.Creator taskBrokerCreator)
Description copied from interface:StorageFoundation
Sets theStorageTaskBroker.Creator
instance to be used for the assembly.- Specified by:
setTaskBrokerCreator
in interfaceStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Overrides:
setTaskBrokerCreator
in classStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
taskBrokerCreator
- the instance to be used.- Returns:
- this to allow method chaining.
-
setDataChunkValidatorProvider
public F setDataChunkValidatorProvider(StorageDataChunkValidator.Provider dataChunkValidatorProvider)
Description copied from interface:StorageFoundation
Sets theStorageDataChunkValidator.Provider
instance to be used for the assembly.- Specified by:
setDataChunkValidatorProvider
in interfaceStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Overrides:
setDataChunkValidatorProvider
in classStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
dataChunkValidatorProvider
- the instance to be used.- Returns:
- this to allow method chaining.
-
setChannelCreator
public F setChannelCreator(StorageChannelsCreator channelCreator)
Description copied from interface:StorageFoundation
Sets theStorageChannelsCreator
instance to be used for the assembly.- Specified by:
setChannelCreator
in interfaceStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Overrides:
setChannelCreator
in classStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
channelCreator
- the instance to be used.- Returns:
- this to allow method chaining.
-
setTaskCreator
public F setTaskCreator(StorageRequestTaskCreator taskCreator)
Description copied from interface:StorageFoundation
Sets theStorageRequestTaskCreator
instance to be used for the assembly.- Specified by:
setTaskCreator
in interfaceStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Overrides:
setTaskCreator
in classStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
taskCreator
- the instance to be used.- Returns:
- this to allow method chaining.
-
setTypeDictionary
public F setTypeDictionary(StorageTypeDictionary typeDictionary)
Description copied from interface:StorageFoundation
Sets theStorageTypeDictionary
instance to be used for the assembly.- Specified by:
setTypeDictionary
in interfaceStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Overrides:
setTypeDictionary
in classStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
typeDictionary
- the instance to be used.- Returns:
- this to allow method chaining.
-
setRootTypeIdProvider
public F setRootTypeIdProvider(StorageRootTypeIdProvider rootTypeIdProvider)
Description copied from interface:StorageFoundation
Sets theStorageRootTypeIdProvider
instance to be used for the assembly.- Specified by:
setRootTypeIdProvider
in interfaceStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Overrides:
setRootTypeIdProvider
in classStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
rootTypeIdProvider
- the instance to be used.- Returns:
- this to allow method chaining.
-
setConnectionFoundation
public F setConnectionFoundation(EmbeddedStorageConnectionFoundation<?> connectionFoundation)
Description copied from interface:EmbeddedStorageFoundation
Sets theEmbeddedStorageConnectionFoundation
instance to be used for the assembly.- Specified by:
setConnectionFoundation
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
connectionFoundation
- the instance to be used.- Returns:
- this to allow method chaining.
-
setRefactoringMappingProvider
public F setRefactoringMappingProvider(PersistenceRefactoringMappingProvider refactoringMappingProvider)
Description copied from interface:EmbeddedStorageFoundation
Sets the passedPersistenceRefactoringMappingProvider
instance to theEmbeddedStorageConnectionFoundation
instance provided byEmbeddedStorageFoundation.getConnectionFoundation()
.- Specified by:
setRefactoringMappingProvider
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
refactoringMappingProvider
- the instance to be used.- Returns:
- this to allow method chaining.
- See Also:
PersistenceFoundation.setRefactoringMappingProvider(PersistenceRefactoringMappingProvider)
-
setTimestampProvider
public F setTimestampProvider(StorageTimestampProvider timestampProvider)
Description copied from interface:StorageFoundation
Sets theStorageTimestampProvider
instance to be used for the assembly.- Specified by:
setTimestampProvider
in interfaceStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Overrides:
setTimestampProvider
in classStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
timestampProvider
- the instance to be used.- Returns:
- this to allow method chaining.
-
executeTypeHandlerRegistration
public F executeTypeHandlerRegistration(PersistenceTypeHandlerRegistration<Binary> typeHandlerRegistration)
Description copied from interface:EmbeddedStorageFoundation
Convenience method forthis.getConnectionFoundation().executeTypeHandlerRegistration(typeHandlerRegistration)
.See
PersistenceFoundation.executeTypeHandlerRegistration(PersistenceTypeHandlerRegistration)
for details.- Specified by:
executeTypeHandlerRegistration
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
typeHandlerRegistration
- thePersistenceTypeHandlerRegistration
to be executed.- Returns:
- this to allow method chaining.
-
createEmbeddedStorageManager
public EmbeddedStorageManager createEmbeddedStorageManager(Supplier<?> rootSupplier)
Description copied from interface:EmbeddedStorageFoundation
Creates and returns a newEmbeddedStorageManager
instance by using the current state of all registered logic part instances and by on-demand creating missing ones via a default logic.If the passed rootSupplier is null, a default root instance will be created, see
EmbeddedStorageManager.defaultRoot()
. Otherwise, it will be used to resolve the root instance to be used duringEmbeddedStorageFoundation.start()
. This indirection is necessary if the actual root instance is not yet available at the time theEmbeddedStorageManager
is created, but will be at the timeEmbeddedStorageFoundation.start()
is called.The returned
EmbeddedStorageManager
instance will NOT yet be started.- Specified by:
createEmbeddedStorageManager
in interfaceEmbeddedStorageFoundation<F extends EmbeddedStorageFoundation.Default<?>>
- Parameters:
rootSupplier
- an indirection logic to later supply the instance to be used as the persistent entity graph's root instance.- Returns:
- a new
EmbeddedStorageManager
instance. - See Also:
EmbeddedStorageFoundation.createEmbeddedStorageManager()
,EmbeddedStorageFoundation.createEmbeddedStorageManager(Object)
,EmbeddedStorageFoundation.start()
,EmbeddedStorageFoundation.start(Object)
-
-