Package org.eclipse.ecf.remoteservice.util.tracker

Examples of org.eclipse.ecf.remoteservice.util.tracker.RemoteServiceTracker


    super.tearDown();
  }

  protected IRemoteService getRemoteService(
      IRemoteServiceContainerAdapter adapter, String clazz, String filter) {
    remoteServiceTracker = new RemoteServiceTracker(adapter, null, clazz,
        null);
    assertNotNull(remoteServiceTracker);
    remoteServiceTracker.open();
    return remoteServiceTracker.getRemoteService();
  }
View Full Code Here


        new String[] { IConcatService.class.getName() },
        createService(), props);
    // Give some time for propagation
    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);
    System.out.println("proxy call start");
    final String result = concatService.concat("OSGi ", "is cool");
    System.out.println("proxy call end. result=" + result);
    sleep(3000);
    st.close();
    sleep(3000);
  }
View Full Code Here

    }
    super.tearDown();
  }

  protected IRemoteService getRemoteService(IRemoteServiceContainerAdapter adapter, String clazz, String filter) {
    remoteServiceTracker = new RemoteServiceTracker(adapter, null, clazz, null);
    assertNotNull(remoteServiceTracker);
    remoteServiceTracker.open();
    return remoteServiceTracker.getRemoteService();
  }
View Full Code Here

    // Register
    adapters[0].registerRemoteService(new String[] {IConcatService.class.getName()}, createService(), props);
    // Give some time for propagation
    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");
      Object result = RemoteServiceHelper.syncExec(remoteService, "concat" , new Object[] { "IRemoteServiceProxy ","is very cool" }, 20000);
      System.out.println("remoteserviceproxy call end. result=" + result);
    } else {
      System.out.println("proxy call start");
      final String result = concatService.concat("OSGi ", "is cool");
      System.out.println("proxy call end. result=" + result);
    }
    sleep(3000);
    st.close();
    sleep(3000);
  }
View Full Code Here

    }
    super.tearDown();
  }

  protected IRemoteService getRemoteService(IRemoteServiceContainerAdapter adapter, String clazz, String filter) {
    remoteServiceTracker = new RemoteServiceTracker(adapter, null, clazz, null);
    assertNotNull(remoteServiceTracker);
    remoteServiceTracker.open();
    return remoteServiceTracker.getRemoteService();
  }
View Full Code Here

    // Register
    adapters[0].registerRemoteService(new String[] {IConcatService.class.getName()}, createService(), props);
    // Give some time for propagation
    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");
      Object result = RemoteServiceHelper.syncExec(remoteService, "concat" , new Object[] { "IRemoteServiceProxy ","is very cool" }, 20000);
      System.out.println("remoteserviceproxy call end. result=" + result);
    } else {
      System.out.println("proxy call start");
      final String result = concatService.concat("OSGi ", "is cool");
      System.out.println("proxy call end. result=" + result);
    }
    sleep(3000);
    st.close();
    sleep(3000);
  }
View Full Code Here

    // Get appropriate adapter
    remoteServiceAdapter = (IRemoteServiceContainerAdapter) container
        .getAdapter(IRemoteServiceContainerAdapter.class);

    // Create remote service tracker, and then open it
    RemoteServiceTracker tracker = new RemoteServiceTracker(
        remoteServiceAdapter, null, IDataProcessor.class.getName(),
        new RemoteServiceTrackerCustomizer());
    // Open it
    tracker.open();

    // Connect to topic.  This should trigger remote service registration to be asynchronously
    // added, and in turn call RemoteServiceTrackerCustomizer.addingService (see impl of that
    // method above
    container.connect(
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.remoteservice.util.tracker.RemoteServiceTracker

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.