Package org.eclipse.ecf.remoteservice.events

Examples of org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent


      final IRemoteService remoteService, final IRemoteCall remoteCall) {
    // Make async call
    remoteService.callAsync(remoteCall, new IRemoteCallListener() {
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          final IRemoteCallCompleteEvent complete = (IRemoteCallCompleteEvent) event;
          if (complete.hadException()) {
            showException(complete.getException());
          } else
            showResult(interfaceClass.getName(), remoteCall,
                complete.getResponse());
        }
      }
    });
  }
View Full Code Here


        exception = e;
        AsyncResult.this.notify();
      }

      if (listener != null) {
        listener.handleEvent(new IRemoteCallCompleteEvent() {

          public Throwable getException() {
            return exception;
          }
View Full Code Here

  public void testAsyncCallWithListener() throws Exception {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    restClientService.callAsync(RestCallFactory.createRestCall(IUserTimeline.class.getName() + ".getUserStatuses"), new IRemoteCallListener() {
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) event;
          Object response = cce.getResponse();
          assertTrue(response instanceof IUserStatus[]);
          syncNotify();
        }
      }
    });
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);
          syncNotify();
        }
      }
    });
View Full Code Here

        {
            public void handleEvent(IRemoteCallEvent event)
            {
                if (event instanceof IRemoteCallCompleteEvent)
                {
                    IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) event;
                    if (!cce.hadException())
                    {
                        System.out.println("Remote call completed successfully!");
                        SyndFeed feed = (SyndFeed) cce.getResponse();
                        printFeedContent(feed);
                    }
                    else
                    {
                        System.out.println("Remote call completed with exception: " + cce.getException());
                    }
                }
            }
        };
    }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public void handleEvent(IRemoteCallEvent event) {
    if (event instanceof IRemoteCallCompleteEvent) {
      IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) event;
      if (cce.hadException()) {
        callback.onFailure(cce.getException());
      } else {
        callback.onSuccess(cce.getResponse());
      }
    }
  }
View Full Code Here

  @Override
  protected void callCompletableAsync(AbstractAsyncProxyRemoteCall call, final IAsyncProxyCompletable completable) {
    callAsync((IRemoteCall) call, new IRemoteCallListener() {
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) event;
          completable.handleComplete(cce.getResponse(), cce.hadException(), cce.getException());
        }
      }
    });
  }
View Full Code Here

        exception = e;
        AsyncResult.this.notify();
      }

      if (listener != null) {
        listener.handleEvent(new IRemoteCallCompleteEvent() {

          public Throwable getException() {
            return exception;
          }
View Full Code Here

  IRemoteCallListener createRemoteCallListener() {
    return new IRemoteCallListener() {

      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) event;
          if (!cce.hadException())
            System.out
                .println("Remote call completed successfully!");
          else
            System.out
                .println("Remote call completed with exception: "
                    + cce.getException());
        }
      }
    };
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent

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.