public abstract class AbstractDatabaseUpdater extends Updater
Updater.ConstantUpdateInterval, Updater.DynamicUpdateInterval, Updater.IUpdateInterval, Updater.ObservableInfo, Updater.ObservableInfoContainer
Modifier and Type | Field and Description |
---|---|
static long |
KEEP_ENTRY_FACTOR
Keep all entries KEEP_ENTRY_FACTOR times of the update interval, even if the InfoService
does not hold this object any longer.
|
private long |
m_lLastUpdate |
private boolean |
m_successfulUpdate |
Constructor and Description |
---|
AbstractDatabaseUpdater(long a_updateInterval,
Updater.ObservableInfo a_observableInfo)
Initializes and starts the database update thread.
|
AbstractDatabaseUpdater(Updater.IUpdateInterval a_updateInterval,
Updater.ObservableInfo a_observableInfo)
Initializes and starts the database update thread.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
doCleanup(java.util.Hashtable a_newEntries)
Does some cleanup operations of the database.
|
protected abstract java.util.Hashtable |
getEntrySerials() |
long |
getLastUpdate()
Should return Long.MAX_VALUE if no update was done since program start.
|
protected AbstractDatabaseEntry |
getPreferredEntry() |
protected abstract java.util.Hashtable |
getUpdatedEntries(java.util.Hashtable a_entriesToUpdate) |
protected boolean |
protectFromCleanup(AbstractDatabaseEntry a_currentEntry) |
protected void |
setPreferredEntry(AbstractDatabaseEntry a_preferredEntry) |
protected void |
updateInternal()
Does the update.
|
protected boolean |
wasUpdateSuccessful() |
getObservableInfo, getUpdatedClass, getUpdatedClassName, getUpdateInterval, isFirstUpdateDone, isUpdatePaused, needsUpdate, start, stop, update, update, update, updateAsync
public static final long KEEP_ENTRY_FACTOR
private boolean m_successfulUpdate
private long m_lLastUpdate
public AbstractDatabaseUpdater(long a_updateInterval, Updater.ObservableInfo a_observableInfo)
public AbstractDatabaseUpdater(Updater.IUpdateInterval a_updateInterval, Updater.ObservableInfo a_observableInfo)
protected void updateInternal()
updateInternal
in class Updater
protected boolean wasUpdateSuccessful()
wasUpdateSuccessful
in class Updater
protected boolean doCleanup(java.util.Hashtable a_newEntries)
a_newEntries
- the list of new entriespublic final long getLastUpdate()
Updater
getLastUpdate
in class Updater
protected boolean protectFromCleanup(AbstractDatabaseEntry a_currentEntry)
protected AbstractDatabaseEntry getPreferredEntry()
protected void setPreferredEntry(AbstractDatabaseEntry a_preferredEntry)
protected abstract java.util.Hashtable getEntrySerials()
protected abstract java.util.Hashtable getUpdatedEntries(java.util.Hashtable a_entriesToUpdate)
Copyright © 2023. All rights reserved.