|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.calendar.AbstractTimeSystem
public abstract class AbstractTimeSystem
the basis for a custom TimeSystem based on an offset value (delta) relative to the system time.
| Field Summary |
|---|
| Fields inherited from interface com.antelmann.calendar.TimeSystem |
|---|
SYSTEM_TIME |
| Constructor Summary | |
|---|---|
AbstractTimeSystem()
|
|
| Method Summary | |
|---|---|
long |
adjustDelta()
adjusts the delta value used for getTime() through
using the server time |
long |
adjustedTimeMills()
|
protected abstract long |
aquireDelta()
returns the current difference between system time and the time of this implementation in milliseconds. |
TimerTask |
createTimerTask(Logger logger)
creates a TimerTask that will adjust the delta and log the result to the given logger. |
long |
currentTimeMillis()
returns the system time adjusted by the delta value. |
long |
getDelta()
returns the stored difference between system time and atomic time in milliseconds. |
long |
getLastDeltaAdjustmentTime()
returns the system time when adjustDelta() has been
successfully called last time. |
long |
getLastRoundTripDelay()
returns the time of the time it took to adjust the delta the last time the adjustment was made. |
protected void |
setDelta(long delta)
manually sets the value used to adjust system time |
void |
setLastRoundTripDelay(long lastRoundTripDelay)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractTimeSystem()
| Method Detail |
|---|
public long currentTimeMillis()
currentTimeMillis in interface TimeSystem
public long adjustedTimeMills()
throws IOException
IOException
protected abstract long aquireDelta()
throws IOException
IOExceptionadjustDelta()public long getDelta()
adjustDelta(),
setDelta(long)protected void setDelta(long delta)
adjustDelta()public long getLastDeltaAdjustmentTime()
adjustDelta() has been
successfully called last time.
If no successful adjustment has taken place, yet, the method returns 0.
adjustDelta()public long getLastRoundTripDelay()
public void setLastRoundTripDelay(long lastRoundTripDelay)
public long adjustDelta()
throws IOException
getTime() through
using the server time
IOExceptioncurrentTimeMillis(),
getDelta(),
setDelta(long),
getLastDeltaAdjustmentTime(),
getLastRoundTripDelay()public TimerTask createTimerTask(Logger logger)
adjustDelta(),
Timer
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||