Package org.eclipse.ecf.remoteservice

Examples of org.eclipse.ecf.remoteservice.IRemoteService.callAsync()


    }
  }

  public void testAsynCall() {
    IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationCalc.getReference());
    IFuture future = rpcClientService.callAsync(getCalcPlusCall());
    try {
      Object response = future.get();
      assertTrue(response instanceof Integer);
    } catch (OperationCanceledException e) {
      fail(e.getMessage());
View Full Code Here


    }
  }
 
  public void testAsyncCallWithListener() throws Exception {
    IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationCalc.getReference());
    rpcClientService.callAsync(getCalcPlusCall(), new IRemoteCallListener() {
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) event;
          Object response = cce.getResponse();
          assertTrue(response instanceof Integer);
View Full Code Here

  public void testCallAsynch() throws Exception {
    final IRemoteService service = registerAndGetRemoteService();
    if (service == null)
      return;
    traceCallStart("callAsynch");
    service.callAsync(createRemoteConcat("ECF ", "is cool"),
        createRemoteCallListener());
    traceCallEnd("callAsynch");
    Thread.sleep(SLEEPTIME);
  }
View Full Code Here

  public void testAsyncResult() throws Exception {
    final IRemoteService service = registerAndGetRemoteService();
    if (service == null)
      return;
    traceCallStart("callAsynchResult");
    final IFuture result = service.callAsync(createRemoteConcat(
        "ECF AsynchResults ", "are cool"));
    traceCallEnd("callAsynchResult", result);
    assertNotNull(result);
    Thread.sleep(SLEEPTIME);
  }
View Full Code Here

    final Object o = remoteReferences[0].getProperty(RemoteConstants.SERVICE_IMPORTED);
    assertNotNull(o);
    assertTrue(o instanceof IRemoteService);
    final IRemoteService rs = (IRemoteService) o;
    // Call asynchronously
    rs.callAsync(createRemoteCall(), new IRemoteCallListener() {
      public void handleEvent(final IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          final Object result = ((IRemoteCallCompleteEvent) event)
              .getResponse();
          Trace.trace(Activator.PLUGIN_ID,
View Full Code Here

    final Object o = remoteReferences[0].getProperty(RemoteConstants.SERVICE_IMPORTED);
    assertNotNull(o);
    assertTrue(o instanceof IRemoteService);
    final IRemoteService rs = (IRemoteService) o;
    // Call asynchronously
    final IFuture futureResult = rs.callAsync(createRemoteCall());

    // now get result from futureResult
    final Object result = futureResult.get();
    Trace.trace(Activator.PLUGIN_ID, "callSync.doStuff1 result=" + result);
    assertStringResultValid(result, TestServiceInterface1.TEST_SERVICE_STRING1);
View Full Code Here

    final Object o = remoteReferences[0].getProperty(SERVICE_IMPORTED);
    assertNotNull(o);
    assertTrue(o instanceof IRemoteService);
    final IRemoteService rs = (IRemoteService) o;
    // Call asynchronously
    rs.callAsync(createRemoteCall(), new IRemoteCallListener() {
      public void handleEvent(final IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          final Object result = ((IRemoteCallCompleteEvent) event)
              .getResponse();
          Trace.trace(Activator.PLUGIN_ID,
View Full Code Here

    final Object o = remoteReferences[0].getProperty(SERVICE_IMPORTED);
    assertNotNull(o);
    assertTrue(o instanceof IRemoteService);
    final IRemoteService rs = (IRemoteService) o;
    // Call asynchronously
    final IFuture futureResult = rs.callAsync(createRemoteCall());

    // now get result from futureResult
    final Object result = futureResult.get();
    Trace.trace(Activator.PLUGIN_ID, "callSync.doStuff1 result=" + result);
    assertStringResultValid(result, TestServiceInterface1.TEST_SERVICE_STRING1);
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.