Interface EmbeddedStorageFoundation<F extends EmbeddedStorageFoundation<?>>
-
- Type Parameters:
F- the "self-type" of theEmbeddedStorageManagerimplementation.
- All Superinterfaces:
StorageFoundation<F>
- All Known Implementing Classes:
EmbeddedStorageFoundation.Default
public interface EmbeddedStorageFoundation<F extends EmbeddedStorageFoundation<?>> extends StorageFoundation<F>
A kind of factory type that holds and creates on demand all the parts that form anEmbeddedStorageManagerinstance, i.e. a functional database handling logic embedded in the same process as the application using it.Additionally to the services of a mere factory type, a foundation type also keeps references to all parts after a
EmbeddedStorageManagerinstance has been created. This is useful if some internal logic parts shall be accessed while theEmbeddedStorageManagerlogic is already running. Therefore, this type can best be thought of as a foundation on which the running database handling logic stands.All set~ methods are simple setter methods without any additional logic worth mentioning.
All set~ methods return this to allow for easy method chaining to improve readability.
All get~ methods return a logic part instance, if present or otherwise creates and sets one beforehand via a default creation logic.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classEmbeddedStorageFoundation.Default<F extends EmbeddedStorageFoundation.Default<?>>
-
Method Summary
Modifier and Type Method Description default EmbeddedStorageManagercreateEmbeddedStorageManager()Creates and returns a newEmbeddedStorageManagerinstance by using the current state of all registered logic part instances and by on-demand creating missing ones via a default logic.EmbeddedStorageManagercreateEmbeddedStorageManager(Object explicitRoot)Creates and returns a newEmbeddedStorageManagerinstance by using the current state of all registered logic part instances and by on-demand creating missing ones via a default logic.FexecuteTypeHandlerRegistration(PersistenceTypeHandlerRegistration<Binary> typeHandlerRegistration)Convenience method forthis.getConnectionFoundation().executeTypeHandlerRegistration(typeHandlerRegistration).EmbeddedStorageConnectionFoundation<?>getConnectionFoundation()Returns the currently setStorageConfigurationinstance.PersistenceRootResolverProvidergetRootResolverProvider()Returns the internalEmbeddedStorageConnectionFoundationinstance'sPersistenceRootResolverProviderinstance.static EmbeddedStorageFoundation<?>New()Pseudo-constructor method to create a newEmbeddedStorageFoundationinstance with default implementation.FonConnectionFoundation(Consumer<? super EmbeddedStorageConnectionFoundation<?>> logic)Executes the passed logic on theEmbeddedStorageConnectionFoundationinstance provided bygetConnectionFoundation().FonThis(Consumer<? super EmbeddedStorageFoundation<?>> logic)Executes the passed logic on this.FsetConnectionFoundation(EmbeddedStorageConnectionFoundation<?> connectionFoundation)Sets theEmbeddedStorageConnectionFoundationinstance to be used for the assembly.FsetRefactoringMappingProvider(PersistenceRefactoringMappingProvider refactoringMappingProvider)Sets the passedPersistenceRefactoringMappingProviderinstance to theEmbeddedStorageConnectionFoundationinstance provided bygetConnectionFoundation().FsetRoot(Object root)Registers the passed root instance as the root instance at theEmbeddedStorageConnectionFoundationinstance provided bygetConnectionFoundation().
UsesetRootSupplier(Supplier)for a more dynamic approach, i.e.FsetRootResolverProvider(PersistenceRootResolverProvider rootResolverProvider)Alias forFsetRootSupplier(Supplier<?> rootSupplier)Registers the passed rootSupplierSupplieras the root instance supplier at thePersistenceRootResolverProviderinstance provided byPersistenceFoundation.getRootResolverProvider()of theEmbeddedStorageConnectionFoundationinstance provided bygetConnectionFoundation().default EmbeddedStorageManagerstart()Convenience method to create, start and return anEmbeddedStorageManagerinstance using a default root instance.default EmbeddedStorageManagerstart(Object explicitRoot)Convenience method to create, start and return anEmbeddedStorageManagerinstance using the passed explicitRoot-
Methods inherited from interface one.microstream.storage.types.StorageFoundation
createStorageSystem, getBackupThreadProvider, getChannelCreator, getChannelThreadProvider, getConfiguration, getDataChunkValidatorProvider, getDataChunkValidatorProvider2, getDataFileValidatorCreator, getEntityDataIteratorProvider, getEntityDataValidatorCreator, getEntityMarkMonitorCreator, getEventLogger, getExceptionHandler, getGCZombieOidHandler, getInitialDataFileNumberProvider, getLockFileManagerCreator, getLockFileManagerThreadProvider, getLockFileSetup, getLockFileSetupProvider, getObjectIdRangeEvaluator, getOidMarkQueueCreator, getOperationControllerCreator, getProcessIdentityProvider, getReaderProvider, getRequestAcceptorCreator, getRequestTaskCreator, getRootOidSelectorProvider, getRootTypeIdProvider, getTaskBrokerCreator, getThreadNameProvider, getThreadProvider, getTimestampProvider, getTypeDictionary, getWriterProvider, setBackupThreadProvider, setChannelCreator, setChannelThreadProvider, setConfiguration, setDataChunkValidatorProvider, setDataChunkValidatorProvider2, setDataFileValidatorCreator, setEntityDataIteratorProvider, setEntityDataValidatorCreator, setEntityMarkMonitorCreator, setEventLogger, setExceptionHandler, setGCZombieOidHandler, setInitialDataFileNumberProvider, setLockFileManagerCreator, setLockFileManagerThreadProvider, setLockFileSetup, setLockFileSetupProvider, setObjectIdRangeEvaluator, setOidMarkQueueCreator, setOperationControllerCreator, setProcessIdentityProvider, setReaderProvider, setRequestAcceptorCreator, setRootOidSelectorProvider, setRootTypeIdProvider, setTaskBrokerCreator, setTaskCreator, setThreadNameProvider, setThreadProvider, setTimestampProvider, setTypeDictionary, setWriterProvider
-
-
-
-
Method Detail
-
getConnectionFoundation
EmbeddedStorageConnectionFoundation<?> getConnectionFoundation()
Returns the currently setStorageConfigurationinstance.If no instance is set and the implementation deems an instance of this type mandatory for the successful executon of
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, aMissingFoundationPartExceptionis thrown.- Returns:
- the currently set instance, potentially created on-demand if required.
- Throws:
MissingFoundationPartException- if a returnable instance is required but cannot be created by default.
-
getRootResolverProvider
PersistenceRootResolverProvider getRootResolverProvider()
Returns the internalEmbeddedStorageConnectionFoundationinstance'sPersistenceRootResolverProviderinstance. If none is present so far, a new default one is created.- Returns:
- the
PersistenceRootResolverProviderinstance to be used.
-
onConnectionFoundation
F onConnectionFoundation(Consumer<? super EmbeddedStorageConnectionFoundation<?>> logic)
Executes the passed logic on theEmbeddedStorageConnectionFoundationinstance provided bygetConnectionFoundation().This is a mere utility method to allow more concise syntax and multi-layered method chaining.
- Parameters:
logic- the logic to be executed.- Returns:
- this to allow method chaining.
-
onThis
F onThis(Consumer<? super EmbeddedStorageFoundation<?>> logic)
Executes the passed logic on this.This is a mere utility method to allow more concise syntax and multi-layered method chaining.
- Parameters:
logic- the logic to be executed.- Returns:
- this to allow method chaining.
-
createEmbeddedStorageManager
default EmbeddedStorageManager createEmbeddedStorageManager()
Creates and returns a newEmbeddedStorageManagerinstance by using the current state of all registered logic part instances and by on-demand creating missing ones via a default logic.Alias for
return this.createEmbeddedStorageManager(null);The returned
EmbeddedStorageManagerinstance will NOT yet be started.- Returns:
- a new
EmbeddedStorageManagerinstance. - See Also:
createEmbeddedStorageManager(Object),start(),start(Object)
-
createEmbeddedStorageManager
EmbeddedStorageManager createEmbeddedStorageManager(Object explicitRoot)
Creates and returns a newEmbeddedStorageManagerinstance 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 explicitRoot is null, a default root instance will be created, see
StorageManager.defaultRoot().The returned
EmbeddedStorageManagerinstance will NOT yet be started.- Parameters:
explicitRoot- the instance to be used as the persistent entity graph's root instance.- Returns:
- a new
EmbeddedStorageManagerinstance. - See Also:
createEmbeddedStorageManager(),#createEmbeddedStorageManager(Supplier),start(),start(Object)
-
start
default EmbeddedStorageManager start()
Convenience method to create, start and return anEmbeddedStorageManagerinstance using a default root instance.- Returns:
- a new
EmbeddedStorageManagerinstance. - See Also:
start(Object),createEmbeddedStorageManager(),createEmbeddedStorageManager(Object)
-
start
default EmbeddedStorageManager start(Object explicitRoot)
Convenience method to create, start and return anEmbeddedStorageManagerinstance using the passed explicitRootBy default, it is an alias for:
EmbeddedStorageManager esm = this.createEmbeddedStorageManager(explicitRoot);
esm.start();
return esm;- Parameters:
explicitRoot- the instance to be used as the persistent entity graph's root instance.- Returns:
- a new
EmbeddedStorageManagerinstance. - See Also:
start(),createEmbeddedStorageManager(),createEmbeddedStorageManager(Object)
-
setConnectionFoundation
F setConnectionFoundation(EmbeddedStorageConnectionFoundation<?> connectionFoundation)
Sets theEmbeddedStorageConnectionFoundationinstance to be used for the assembly.- Parameters:
connectionFoundation- the instance to be used.- Returns:
- this to allow method chaining.
-
setRoot
F setRoot(Object root)
Registers the passed root instance as the root instance at theEmbeddedStorageConnectionFoundationinstance provided bygetConnectionFoundation().
UsesetRootSupplier(Supplier)for a more dynamic approach, i.e. if the actual root instance must be created after setting up and creating theEmbeddedStorageManager.- Parameters:
root- the instance to be used as the persistent entity graph's root instance.- Returns:
- this to allow method chaining.
- See Also:
setRootSupplier(Supplier),#setRootResolverProvider(PersistenceRootResolver),EmbeddedStorageConnectionFoundation#setRootResolverProvider(PersistenceRootResolver)
-
setRootSupplier
F setRootSupplier(Supplier<?> rootSupplier)
Registers the passed rootSupplierSupplieras the root instance supplier at thePersistenceRootResolverProviderinstance provided byPersistenceFoundation.getRootResolverProvider()of theEmbeddedStorageConnectionFoundationinstance provided bygetConnectionFoundation().This means this method is merely an alias for
.onConnectionFoundation(f -> f.getRootResolverProvider().registerCustomRootSupplier(rootSupplier);) }Note that replacing the
PersistenceRootResolverProviderinstance, 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 thansetRoot(Object), i.e. if the actual root instance must be created after setting up and creating theEmbeddedStorageManager.- 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(),setRoot(Object),#setRootResolverProvider(PersistenceRootResolver),EmbeddedStorageConnectionFoundation#setRootResolverProvider(PersistenceRootResolver),EmbeddedStorageConnectionFoundation#registerCustomRootSupplier(PersistenceRootResolver)
-
setRootResolverProvider
F setRootResolverProvider(PersistenceRootResolverProvider rootResolverProvider)
Alias for
Sets the.onConnectionFoundation(f -> f.setRootResolverProvider(rootResolverProvider);) }PersistenceRootResolverProviderinstance to be used in the internalEmbeddedStorageConnectionFoundation.- Parameters:
rootResolverProvider- thePersistenceRootResolverProviderto be set.- Returns:
- this to allow method chaining.
- See Also:
setRootSupplier(Supplier),EmbeddedStorageConnectionFoundation#setRootResolverProvider(PersistenceRootResolver)
-
setRefactoringMappingProvider
F setRefactoringMappingProvider(PersistenceRefactoringMappingProvider refactoringMappingProvider)
Sets the passedPersistenceRefactoringMappingProviderinstance to theEmbeddedStorageConnectionFoundationinstance provided bygetConnectionFoundation().- Parameters:
refactoringMappingProvider- the instance to be used.- Returns:
- this to allow method chaining.
- See Also:
PersistenceFoundation.setRefactoringMappingProvider(PersistenceRefactoringMappingProvider)
-
executeTypeHandlerRegistration
F executeTypeHandlerRegistration(PersistenceTypeHandlerRegistration<Binary> typeHandlerRegistration)
Convenience method forthis.getConnectionFoundation().executeTypeHandlerRegistration(typeHandlerRegistration).See
PersistenceFoundation.executeTypeHandlerRegistration(PersistenceTypeHandlerRegistration)for details.- Parameters:
typeHandlerRegistration- thePersistenceTypeHandlerRegistrationto be executed.- Returns:
- this to allow method chaining.
-
New
static EmbeddedStorageFoundation<?> New()
Pseudo-constructor method to create a newEmbeddedStorageFoundationinstance with default implementation.- Returns:
- a new
EmbeddedStorageFoundationinstance.
-
-