Package org.eclipse.ecf.remoteservice

Examples of org.eclipse.ecf.remoteservice.IRemoteService


        .getService(remoteReferences[0]);

    assertProxyValid(proxy);
   
    // Get IRemoteService from proxy
    final IRemoteService remoteService = getRemoteServiceFromProxy(proxy);

    // Call remote service synchronously
    final Object result = remoteService.callSync(createRemoteCall());
    Trace.trace(Activator.PLUGIN_ID, "proxy.doStuff1 result=" + result);
    assertStringResultValid(result, TestServiceInterface1.TEST_SERVICE_STRING1);
  }
View Full Code Here


    assertReferencesValidAndFirstHasCorrectType(remoteReferences, classname);

    final Object o = remoteReferences[0].getProperty(RemoteConstants.SERVICE_IMPORTED);
    assertNotNull(o);
    assertTrue(o instanceof IRemoteService);
    final IRemoteService rs = (IRemoteService) o;

    // Call synchronously
    final Object result = rs.callSync(createRemoteCall());
    Trace.trace(Activator.PLUGIN_ID, "callSync.doStuff1 result=" + result);
    assertStringResultValid(result, TestServiceInterface1.TEST_SERVICE_STRING1);
  }
View Full Code Here

    assertReferencesValid(remoteReferences);

    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

    assertReferencesValid(remoteReferences);

    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

    assertReferencesValid(remoteReferences);

    final Object o = remoteReferences[0].getProperty(RemoteConstants.SERVICE_IMPORTED);
    assertNotNull(o);
    assertTrue(o instanceof IRemoteService);
    final IRemoteService rs = (IRemoteService) o;
    // Call asynchronously
    rs.fireAsync(createRemoteCall());
    Thread.sleep(REGISTER_WAIT);
  }
View Full Code Here

        e.printStackTrace();
      }
    }
   
    // It's also possible to get the remote service directly from the proxy
    IRemoteService remoteService = ((IRemoteServiceProxy) proxy).getRemoteService();
    Assert.isNotNull(remoteService);
   
    // In this case, we will make an non-blocking call and immediately get a 'future'...which is
    // a placeholder for a result of the remote computation.  This will not block.
    System.out.println("STARTING async remote call via future...");
View Full Code Here

        adapter = getRestClientContainerAdapter();

        adapter.setResponseDeserializer(new SyndFeedResponseDeserializer());

        IRemoteService restClientService = adapter.getRemoteService(registerCall().getReference());

        asyncCall(restClientService);
    }
View Full Code Here

    }
   
    // OSGi 4.2 remote service spec requires a property named 'service.imported' to be
    // set to a non-null value.  In the case of any ECF provider, this 'service.imported' property
    // is set to the IRemoteService object associated with the remote service.
    IRemoteService remoteService = (IRemoteService) reference
        .getProperty(IDistributionConstants.SERVICE_IMPORTED);
    Assert.isNotNull(remoteService);
   
    // This IRemoteService instance allows allows non-blocking/asynchronous invocation of
    // remote methods.  This allows the client to decide (at runtime if necessary) whether
View Full Code Here

            container.getConnectNamespace(), ROSGI_SERVICE_HOST),
            IHello.class.getName(), null);
    Assert.isNotNull(helloReferences);
    Assert.isTrue(helloReferences.length > 0);
    // 4. Get remote service for reference
    IRemoteService remoteService = containerAdapter
        .getRemoteService(helloReferences[0]);
    // 5. Get the proxy
    IHello proxy = (IHello) remoteService.getProxy();
    // 6. Finally...call the proxy
    proxy.hello("RemoteService Consumer");

    // Call asynchronously via listener
    callViaListener(remoteService);
View Full Code Here

        .getService(remoteReferences[0]);

    assertProxyValid(proxy);
   
    // Get IRemoteService from proxy
    final IRemoteService remoteService = getRemoteServiceFromProxy(proxy);

    // Call remote service synchronously
    final Object result = remoteService.callSync(createRemoteCall());
    Trace.trace(Activator.PLUGIN_ID, "proxy.doStuff1 result=" + result);
    assertStringResultValid(result, TestServiceInterface1.TEST_SERVICE_STRING1);
    endTest("testCallSyncFromProxy");
  }
View Full Code Here

TOP

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

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.