|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.util.Updater
public abstract class Updater
Updates the local database. This may be done automatically (by a background thread) and manually by method call. The automatic update is only done if this is allowed by the model.
Nested Class Summary | |
---|---|
protected static class |
Updater.ConstantUpdateInterval
|
protected static class |
Updater.DynamicUpdateInterval
|
protected static interface |
Updater.IUpdateInterval
|
static class |
Updater.ObservableInfo
|
Field Summary | |
---|---|
private boolean |
m_bAutoUpdateChanged
|
private boolean |
m_bInitialRun
|
private boolean |
m_bUpdating
|
private boolean |
m_interrupted
|
private Updater.ObservableInfo |
m_observable
|
private Updater.IUpdateInterval |
m_updateInterval
|
private java.lang.Thread |
m_updateThread
|
private static long |
MIN_WAITING_TIME_MS
|
private java.lang.Object |
UPDATE_SYNC
|
Constructor Summary | |
---|---|
Updater(Updater.IUpdateInterval a_updateInterval,
Updater.ObservableInfo a_observable)
Initialises and starts the database update thread. |
Method Summary | |
---|---|
protected Updater.ObservableInfo |
getObservableInfo()
|
abstract java.lang.Class |
getUpdatedClass()
|
protected java.lang.String |
getUpdatedClassName()
|
Updater.IUpdateInterval |
getUpdateInterval()
|
private void |
init()
May be used to re-initialise the thread after stopping it. |
abstract boolean |
isFirstUpdateDone()
|
protected boolean |
isUpdatePaused()
May be overwritten if an update is currently no wanted. |
void |
start(boolean a_bSynchronized)
Starts the thread if it has not already started or has been stopped before. |
void |
stop()
Stops the update thread. |
boolean |
update()
Force a synchronized update of the known database entries. |
private boolean |
update(boolean a_bSynchronized)
Force an update of the known database entries. |
void |
update(java.util.Observable a_observable,
java.lang.Object a_argument)
|
void |
updateAsync()
Force an update of the known database entries. |
protected abstract void |
updateInternal()
Does the update and should tell if it was successful or not. |
protected abstract boolean |
wasUpdateSuccessful()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long MIN_WAITING_TIME_MS
private Updater.IUpdateInterval m_updateInterval
private java.lang.Thread m_updateThread
private boolean m_bAutoUpdateChanged
private boolean m_bInitialRun
private boolean m_interrupted
private boolean m_bUpdating
private java.lang.Object UPDATE_SYNC
private Updater.ObservableInfo m_observable
Constructor Detail |
---|
public Updater(Updater.IUpdateInterval a_updateInterval, Updater.ObservableInfo a_observable)
Method Detail |
---|
private final void init()
protected Updater.ObservableInfo getObservableInfo()
public void update(java.util.Observable a_observable, java.lang.Object a_argument)
update
in interface java.util.Observer
public final void start(boolean a_bSynchronized)
public final boolean update()
public final void updateAsync()
private final boolean update(boolean a_bSynchronized)
a_bSynchronized
- true if the current thread should wait until the update is done; false otherwise
public final void stop()
public final Updater.IUpdateInterval getUpdateInterval()
public abstract java.lang.Class getUpdatedClass()
protected abstract boolean wasUpdateSuccessful()
public abstract boolean isFirstUpdateDone()
protected abstract void updateInternal()
protected boolean isUpdatePaused()
protected final java.lang.String getUpdatedClassName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |