Examples of ITimeServiceAsync


Examples of com.mycorp.examples.timeservice.ITimeServiceAsync

    // Call the service and print out result!
    System.out.println("Current time is: " + timeService.getCurrentTime());
   
    // Then invoke asynchronously
      if (timeService instanceof ITimeServiceAsync) {
          ITimeServiceAsync asyncTimeService = (ITimeServiceAsync) timeService;
          System.out.println("Discovered ITimeServiceAsync via DS");
          // Call the asynchronous remote service.  Unlike the synchronous getTimeService(),
          // this method will not block
          Future<Long> currentTimeFuture = asyncTimeService.getCurrentTimeAsync();
          // potentially do other operations here...
          try {
        System.out.println("Current time via future.get is: " + currentTimeFuture.get());
      } catch (InterruptedException e) {
        e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.