public class RouterClock extends Clock
Modifier and Type | Class and Description |
---|---|
static interface |
RouterClock.ClockShiftListener |
Clock.ClockUpdateListener
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_STRATUM |
_alreadyChanged, _context, _isSystemClockBad, _offset, _startedOn, _statCreated, MAX_LIVE_OFFSET, MAX_OFFSET, MIN_OFFSET_CHANGE
Constructor and Description |
---|
RouterClock(RouterContext context)
Does not start.
|
Modifier and Type | Method and 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, setOffset
public static final int DEFAULT_STRATUM
public RouterClock(RouterContext context)
public void start()
public Timestamper getTimestamper()
getTimestamper
in class Clock
public void setOffset(long offsetMs, boolean force)
public void setNow(long realTime, int stratum)
Clock
setNow
in interface Timestamper.UpdateListener
setNow
in class Clock
stratum
- 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()