Class RhythmDatabaseFactoryImpl
- All Implemented Interfaces:
PropertyChangeListener,EventListener,RhythmDatabaseFactory
Upon clean/fresh start:
- copy default rhythm files
- retrieve all available builtin & file-based rhythm instances by polling RhythmProviders (this can be long if many rhythm files need to be scanned).
- update the database
- save the file-based RhythmInfos to a cache file.
Then upon normal start:
- retrieve all available builtin rhythm instances by polling RhythmProviders, create the corresponding RhythmInfos.
- load additional file-based RhythmInfos from the cache file
- create Rhythm instances only when required.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()Get the initialized instance.static RhythmDatabaseFactoryImplFuture<?> Initialize the RhythmDatabase instance.booleanCheck if the RhythmDatabase instance is initialized.booleanCheck if a full rescan s planned for next startup.voidmarkForStartupRescan(boolean b) Request or cancel a full rescan upon next startup.void
-
Field Details
-
ZIP_RESOURCE_PATH
- See Also:
-
PREF_NEED_RESCAN
- See Also:
-
-
Constructor Details
-
RhythmDatabaseFactoryImpl
public RhythmDatabaseFactoryImpl()Do not use, use getInstance() instead.This was made public because of ServiceProvider.
-
-
Method Details
-
getInstance
-
initialize
Description copied from interface:RhythmDatabaseFactoryInitialize the RhythmDatabase instance.As the initialization can take some time (e.g. reading files), the implementation must launch a task in a different thread and return the corresponding Future so that caller can monitor completion.
- Specified by:
initializein interfaceRhythmDatabaseFactory- Returns:
-
isInitialized
public boolean isInitialized()Description copied from interface:RhythmDatabaseFactoryCheck if the RhythmDatabase instance is initialized.- Specified by:
isInitializedin interfaceRhythmDatabaseFactory- Returns:
-
get
Description copied from interface:RhythmDatabaseFactoryGet the initialized instance.If initialization is not done, call initialize(). If initialization is not complete, wait for its completion.
- Specified by:
getin interfaceRhythmDatabaseFactory- Returns:
-
markForStartupRescan
public void markForStartupRescan(boolean b) Request or cancel a full rescan upon next startup.- Parameters:
b-
-
isMarkedForStartupRescan
public boolean isMarkedForStartupRescan()Check if a full rescan s planned for next startup.- Returns:
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-