Examples of IRemoteService


Examples of org.eclipse.ecf.remoteservice.IRemoteService

    final IRemoteServiceContainerAdapter containerAdapter = rsContainer
        .getContainerAdapter();
    ID rsContainerID = rsContainer.getContainer().getID();
    // First get IRemoteService for selectedRsReference
    final IRemoteService rs = containerAdapter
        .getRemoteService(selectedRsReference);
    if (rs == null)
      throw new NullPointerException(
          "getRemoteService returned null for selectedRsReference=" //$NON-NLS-1$
              + selectedRsReference + ",rsContainerID=" //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

      MessageDialog.openError(null, "Handler invocation failed",
          "No remote service reference found");
      return null;
    }

    final IRemoteService remoteService = adapter
        .getRemoteService(references[0]);
    if (remoteService == null) {
      MessageDialog.openError(null, "Handler invocation failed",
          "No remote service found");
      return null;
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

      return null;
    }

    // obtain the remote service reference from the local service ref (cool
    // ECF feature, huh?)
    final IRemoteService remoteService = (IRemoteService) serviceReference
        .getProperty(IDistributionConstants.SERVICE_IMPORTED);
    if (remoteService == null) {
      MessageDialog.openError(null,
          Messages.DOSGiReflectiveRemoteServiceHandler_HandlerInvocationFailed, Messages.DOSGiReflectiveRemoteServiceHandler_RemoteServiceUnresolveable);
      return null;
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

      // Create target ID
      String target = TARGET;
      ID targetID = createTargetID(container,target);
      // Get and resolve remote service reference
      IRemoteServiceReference[] ref = adapter.getRemoteServiceReferences(targetID, org.eclipse.ecf.examples.remoteservices.common.IRemoteEnvironmentInfo.class.getName(), null);
      IRemoteService svc = adapter.getRemoteService(ref[0]);
      // get proxy
      IRemoteEnvironmentInfo proxy = (IRemoteEnvironmentInfo) svc.getProxy();
      // Call it!
      String osArch = proxy.getOSArch();
      // Show result
      MessageDialog.openInformation(
          window.getShell(),
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

    final RemoteServiceTracker st = new RemoteServiceTracker(adapters[1],
        null, IConcatService.class.getName(), null);
    assertNotNull(st);
    st.open();
    IRemoteService rs = st.getRemoteService();
    final IConcatService concatService = (IConcatService) rs.getProxy();
    assertNotNull(concatService);
    System.out.println("proxy call start");
    final String result = concatService.concat("OSGi ", "is cool");
    System.out.println("proxy call end. result=" + result);
    sleep(3000);
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

    sleep(3000);

    final RemoteServiceTracker st = new RemoteServiceTracker(adapters[1], null, IConcatService.class.getName(), null);
    assertNotNull(st);
    st.open();
    IRemoteService rs = st.getRemoteService();
    final IConcatService concatService = (IConcatService) rs.getProxy();
    assertNotNull(concatService);
    // test for proxy implementing IRemoteServiceProxy
    if (concatService instanceof IRemoteServiceProxy) {
      IRemoteService remoteService = ((IRemoteServiceProxy) concatService).getRemoteService();
      assertNotNull(remoteService);
      IRemoteServiceReference remoteServiceReference = ((IRemoteServiceProxy) concatService).getRemoteServiceReference();
      assertNotNull(remoteServiceReference);
      System.out.println("remote service reference found from proxy="+remoteServiceReference);
      System.out.println("remoteserviceproxy call start");
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

        }
      }};
  }

  public void testSyncCall() {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    try {
      Object result = restClientService.callSync(RestCallFactory.createRestCall(IUserTimeline.class.getName() + ".getUserStatuses"));
      assertNotNull(result);
    } catch (ECFException e) {
      fail("Could not contact the service");
    }
  }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

      fail("Could not contact the service");
    }
  }

  public void testSyncCallWithCountParameter() {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    try {
      Object result = restClientService.callSync(RestCallFactory.createRestCall(IUserTimeline.class.getName() + ".getUserStatuses", new IRemoteCallParameter[] { new RemoteCallParameter("count", "1") }));
      assertNotNull(result);
      assertTrue(result instanceof IUserStatus[]);
      assertTrue(((IUserStatus[]) result).length == 1);
    } catch (ECFException e) {
      fail("Could not contact the service");
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

      fail("Could not contact the service");
    }
  }

  public void testSyncCallWithCountParameter1() {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    try {
      Object result = restClientService.callSync(RestCallFactory.createRestCall(IUserTimeline.class.getName() + ".getUserStatuses", new String[] { "1" } ));
      assertNotNull(result);
    } catch (ECFException e) {
      fail("Could not contact the service");
    }
  }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

      fail("Could not contact the service");
    }
  }

  public void testGetProxy() {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    try {
      IUserTimeline userTimeline = (IUserTimeline) restClientService.getProxy();
      assertNotNull(userTimeline);
    } catch (ECFException e) {
      fail("Could not contact the service");
    }
  }
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.