Package org.eclipse.ecf.examples.loadbalancing

Examples of org.eclipse.ecf.examples.loadbalancing.IDataProcessorAsync


    String result = dataProcessor.processData(data);
    System.out.println("Sync result="+result);
    System.out.println();
    // See if we've got an async interface and if so, use it
    if (dataProcessor instanceof IDataProcessorAsync) {
      IDataProcessorAsync dpAsync = (IDataProcessorAsync) dataProcessor;
      System.out.println("Got async data processor on client");
      IAsyncCallback<String> callback = new IAsyncCallback<String>() {
        public void onSuccess(String result) {
          System.out.println("Async result="+result);
        }
        public void onFailure(Throwable exception) {
          System.out.println("Async invoke failed with exception");
          if (exception != null) exception.printStackTrace();
        }
       
      };
      // Now invoke async
      dpAsync.processDataAsync(data, callback);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.examples.loadbalancing.IDataProcessorAsync

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.