Package com.mycorp.examples.timeservice

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

Related Classes of com.mycorp.examples.timeservice.ITimeServiceAsync

Copyright © 2018 www.massapicom. 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.