|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectnetworkClock.NetworkClockController
public class NetworkClockController
Controller class of component NetworkClock
.
Provides a clock, which can be synchronized with a SNTP server (See RFC 2030 for further information).
Can retrieve SNTP messages from a SNTP server at regular intervals and calculate the local clock's offset each time. The local clock's offset calculation is implemented according to the SNTP algorithm specified in RFC 2030.
The method getTime()
can be used to generate timestamps (The
typical accuracy of a SNTP client/server exchange is fractions of a second).
The System's time is never changed.
Uses Adam Buckley's class NtpMessage
as message format.
NtpMessage
Constructor Summary | |
---|---|
NetworkClockController()
Generates a new NetworkClock component which provides a
clock, synchronized with a SNTP server. |
Method Summary | |
---|---|
long |
getTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT (The typical accuracy of a SNTP client/server exchange is fractions of a second.) |
void |
initialize()
Initializes the this component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NetworkClockController()
NetworkClock
component which provides a
clock, synchronized with a SNTP server.
Method Detail |
---|
public void initialize()
public long getTime()
getTime
in interface NetworkClockInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |