|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClockSynchronizer
ClockSynchronizer provides an interface through which two nodes may synchronize their clocks. It is expected that one node will act as the reference clock, to which no delta need be applied, and the other node will act as the slave, and which must apply a delta to its local clock to get a clock synchronized with the reference.
The slave side will initiate the computation of a clock delta by calling thesynch()
method. This method
will not return until the delta has been computed, at which point there is a method to return its value, as well as
an estimate of the likely error (usually one standard deviation), in the synchronization. For convenience there is a
nanoTime()
method to return the value of System.nanoTime() with the delta added in.
Responsibilities | Collaborations |
---|---|
Trigger a clock synchronization. | |
Compute a clock delta to apply to the local clock. | |
Estimate the error in the synchronzation. |
Method Summary | |
---|---|
long |
getDelta()
Gets the clock delta in nano seconds. |
long |
getEpsilon()
Gets an estimate of the clock error in nan seconds. |
long |
nanoTime()
Gets the local clock time with any computed delta added in. |
void |
synch()
The slave side should call this to copute a clock delta with the reference. |
Method Detail |
---|
void synch() throws ClockSynchFailureException
ClockSynchFailureException
- If synchronization cannot be achieved.long getDelta()
long getEpsilon()
long nanoTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |