Skip to main content
blob: 99495ded59268a4ac5311016f7d37199028b0760 (plain) (tree)

This project provides a runnable example of a remote TimeServiceAsync Consumer.   This consumer 
is to be used in combination with the TimeService Remote Service Host which is in the bundle project.  See the readme.txt file in that
project for details on how to start the TimeService Host.  It's necessary to start the
TimeServiceHost before it can be accessed by this TimeServiceConsumer.

To run the TimeServiceAsync Remote Service Consumer:

1) Open the TimeServiceConsumer.generic.zeroconf.product file
2) Go to the Overview tab
3) Click on Launch an Eclipse Application or Launch an Eclipse Application in Debug Mode

If the example TimeServiceHost is running on the local LAN, it should be automatically 
discovered (via Zeroconf) and output similar to the following should appear on
the Console after ~10 seconds:

osgi> Discovered ITimeServiceAsync via DS
Remote time is: 1480820262391

This is discovering the remote TimeService and then calling the ITimeService.getCurrentTime()
remote method (implementation provided by the remote TimeService Host) and printing out 
the results.   Note that the class TimeServiceComponent (source code in this project in /src) 
is being injected by Declarative Services when the remote ITimeService is discovered by 
ECF Remote Services Admin.

Back to the top