Time Service

This service gives program the ability to acquire an accurate value for the current time, and an estimate of the error of the value provided. The Time Service uses Universal Time Coordinated time representation to report time values. This representation uses time intervals of 100 nanoseconds, starting on midnight, October 15, 1582. The time reported is always relative to the Greenwich Time Zone.

The Time Service also provides facilities for generating time-based events, using timers and alarms, and for the ordering and linear positioning of events in time.

An implementation of the Time Service is responsible for communicating with an accurate time source, such as a Cesium clock or radio time broadcasts, for determining its time estimates and error estimates.

Time is reported from a TimeService object in the form of UTO objects, which stand for “universal time objects.” Time intervals are given in the form of TIO objects, or time interval objects. A timer event is represented by a TimerEventT structure that includes the time that the event triggered and any data that was specified to be delivered with the event. A timer event is indirectly created through the TimerEventService by registering a consumer for the event, which returns a TimerEventHandler object that can be used to set the trigger time for the event, set the data to be delivered with the event, or cancel the event.

The timer event portion of the Time Service depends on an Event Service being available.

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.