Package org.eclipse.ecf.remoteservice

Examples of org.eclipse.ecf.remoteservice.IRemoteCallListener


  }

  private void invokeAsyncListener(final Class interfaceClass,
      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());
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[]);
View Full Code Here

  public void testSimpleClientAndServerWithCallAsyncListener() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1),new IRemoteCallListener(){
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          result = (String) ((IRemoteCallCompleteEvent) event).getResponse();
        }
      }
View Full Code Here

  public void testSimpleClientAndServerWithCallAsyncListener() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1),new IRemoteCallListener(){
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          result = (String) ((IRemoteCallCompleteEvent) event).getResponse();
        }
      }
View Full Code Here

  protected void traceCallEnd(String callType) {
    System.out.println(callType + " end.");
  }

  protected IRemoteCallListener createRemoteCallListener() {
    return new IRemoteCallListener() {
      public void handleEvent(IRemoteCallEvent event) {
        System.out.println("CLIENT.handleEvent(" + event + ")");
      }
    };
  }
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

        getClient(0).getConnectedID(), getIDFilter(),
        IConcatService.class.getName(), customizeProperties(null), SLEEPTIME);
  }

  protected IRemoteCallListener createRemoteCallListener() {
    return new IRemoteCallListener() {
      public void handleEvent(IRemoteCallEvent event) {
        System.out.println("CLIENT.handleEvent(" + event + ")");
      }
    };
  }
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

        }
    }

    private IRemoteCallListener createRemoteCallListener()
    {
        return new IRemoteCallListener()
        {
            public void handleEvent(IRemoteCallEvent event)
            {
                if (event instanceof IRemoteCallCompleteEvent)
                {
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())
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.remoteservice.IRemoteCallListener

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.