Timestamper.UpdateListenerpublic class RouterClock extends Clock
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
RouterClock.ClockShiftListener |
Clock.ClockUpdateListener| Modifier and Type | Field | Description |
|---|---|---|
static int |
DEFAULT_STRATUM |
_alreadyChanged, _context, _isSystemClockBad, _offset, _startedOn, _statCreated, MAX_LIVE_OFFSET, MAX_OFFSET, MIN_OFFSET_CHANGE| Constructor | Description |
|---|---|
RouterClock(RouterContext context) |
Does not start.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addShiftListener(RouterClock.ClockShiftListener lsnr) |
|
long |
getDeltaOffset() |
Deprecated.
|
Timestamper |
getTimestamper() |
The RouterTimestamper
|
long |
now() |
Retrieve the current time synchronized with whatever reference clock is in use.
|
void |
removeShiftListener(RouterClock.ClockShiftListener lsnr) |
|
void |
setNow(long realTime,
int stratum) |
Warning - overridden in RouterClock
|
void |
setOffset(long offsetMs,
boolean force) |
Specify how far away from the "correct" time the computer is - a positive
value means that the system time is slow, while a negative value means the system time is fast.
|
void |
start() |
Cannot be stopped, but RouterTimestamper registers a shutdown task.
|
addUpdateListener, fireOffsetChanged, getInstance, getLog, getOffset, getUpdatedSuccessfully, removeUpdateListener, setNow, setOffsetpublic static final int DEFAULT_STRATUM
public RouterClock(RouterContext context)
public void start()
public Timestamper getTimestamper()
getTimestamper in class Clockpublic void setOffset(long offsetMs,
boolean force)
public void setNow(long realTime,
int stratum)
ClocksetNow in interface Timestamper.UpdateListenersetNow in class Clockstratum - used to determine whether we should ignorepublic long now()
public void addShiftListener(RouterClock.ClockShiftListener lsnr)
public void removeShiftListener(RouterClock.ClockShiftListener lsnr)
@Deprecated public long getDeltaOffset()