BibDatabaseContext on every BibDatabaseContextChangedEvent by posting a new AutosaveEvent.
An intelligent ScheduledThreadPoolExecutor prevents a high load while saving and rejects all redundant save tasks.
The scheduled action is stored and canceled if a newer save action is proposed.
| Modifier and Type | Field and Description |
|---|---|
| private final BibDatabaseContext | |
| private final CoarseChangeFilter | |
| private static final int | |
| private final EventBus | |
| private final ScheduledThreadPoolExecutor | |
| private static final Logger | |
| private boolean | |
| private static Set |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| private void | |
| public static void | shutdown(BibDatabaseContext
Associated bibDatabaseContext)BibDatabaseContextShuts down the Autosaver which is associated with the given |
| public static AutosaveManager | start(BibDatabaseContext
Associated bibDatabaseContext)BibDatabaseContextStarts the Autosaver which is associated with the given |
| public void |
| bibDatabaseContext | back to summary |
|---|---|
| private final BibDatabaseContext bibDatabaseContext | |
| changeFilter | back to summary |
|---|---|
| private final CoarseChangeFilter changeFilter | |
| DELAY_BETWEEN_AUTOSAVE_ATTEMPTS_IN_SECONDS | back to summary |
|---|---|
| private static final int DELAY_BETWEEN_AUTOSAVE_ATTEMPTS_IN_SECONDS | |
| eventBus | back to summary |
|---|---|
| private final EventBus eventBus | |
| executor | back to summary |
|---|---|
| private final ScheduledThreadPoolExecutor executor | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| needsSave | back to summary |
|---|---|
| private boolean needsSave | |
| runningInstances | back to summary |
|---|---|
| private static Set<AutosaveManager> runningInstances | |
| AutosaveManager | back to summary |
|---|---|
| private AutosaveManager(BibDatabaseContext bibDatabaseContext) | |
| listen | back to summary |
|---|---|
public void listen(BibDatabaseContextChangedEvent event)
| |
| registerListener | back to summary |
|---|---|
| public void registerListener(Object listener) | |
| shutdown | back to summary |
|---|---|
| private void shutdown() | |
| shutdown | back to summary |
|---|---|
| public static void shutdown(BibDatabaseContext bibDatabaseContext) Shuts down the Autosaver which is associated with the given
| |
| start | back to summary |
|---|---|
| public static AutosaveManager start(BibDatabaseContext bibDatabaseContext) Starts the Autosaver which is associated with the given
| |
| unregisterListener | back to summary |
|---|---|
| public void unregisterListener(Object listener) | |