Back to Clock Service Examples Page Back

Clock Example: UTC Time

Description

The UtcTimeServiceQuery example demonstrates how to query a UtcTimeService object. The example displays the universal time as returned from the UtcTimeServiceSingleton.

The universal time is obtained via the invocation of the "universal_time" operation on the UtcTimeService interface.

Source File

The source file for the UTC Time example is:

UtcTimeServiceQuery.java

How To Run This Example

  1. Start the Clock Service from the command line or by using the Administration Manager.

    From the command line use:

    server -start ClockService

    Using the Administration Manager:

    Start the Administration Manager, right click on the ClockService node and select Start from the pop-up menu.

  2. Start the client:
    run com.prismt.cos.CosClockService.examples.UtcTimeServiceQuery

You should see the universal time displayed on the standard output device.

Note: this example uses the UTC valuetype. This means that a ValueFactory object must be registered with the client-side ORB to deal with demarshalling of the UTC valuetype. This is handled in the example code.



PrismTech TOP
Top