Examples of IDiscoveryLocator


Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

     * @see
     * org.osgi.util.tracker.ServiceTrackerCustomizer#addingService(org.
     * osgi.framework.ServiceReference)
     */
    public Object addingService(ServiceReference reference) {
      IDiscoveryLocator locator = (IDiscoveryLocator) context
          .getService(reference);
      if (locator != null)
        openLocator(locator);
      return locator;
    }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

   
    final Collection discoveryContainers = ((CompositeDiscoveryContainer) discoveryLocator)
        .getDiscoveryContainers();
    final Set s = new HashSet();
    for (final Iterator itr = discoveryContainers.iterator(); itr.hasNext();) {
      final IDiscoveryLocator object = (IDiscoveryLocator) itr.next();
      final IContainer adapter = (IContainer) object
          .getAdapter(IContainer.class);
      s.add(adapter.getID());
    }
    // make sure it's never (accidentally) modified by a test
    idsToExpect = Collections.unmodifiableSet(s);
View Full Code Here

Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

 
  /* (non-Javadoc)
   * @see org.eclipse.ecf.tests.discovery.DiscoveryServiceTest#getDiscoveryLocator()
   */
  protected IDiscoveryLocator getDiscoveryLocator() {
    final IDiscoveryLocator idl = super.getDiscoveryLocator();
    checkCompositeDiscoveryContainer(className, (CompositeDiscoveryContainer)idl);
    return idl;
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

  // make sure the CDC has only a single IDC registered with the correct type
  private static void checkCompositeDiscoveryContainer(final String aClassName, final CompositeDiscoveryContainer cdc) {
    final Collection discoveryContainers = cdc.getDiscoveryContainers();
    assertTrue("One IDiscoveryContainer must be registered with the CDC at this point: " + discoveryContainers, discoveryContainers.size() == 1);
    for (final Iterator iterator = discoveryContainers.iterator(); iterator.hasNext();) {
      final IDiscoveryLocator dl = (IDiscoveryLocator) iterator.next();
      assertEquals(aClassName, dl.getClass().getName());
    }
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

    assertNotNull(this.container);
    super.setUp();
  }

  protected IDiscoveryLocator getDiscoveryLocator() {
    final IDiscoveryLocator adapter = (IDiscoveryLocator) this.container
        .getAdapter(IDiscoveryLocator.class);
    assertNotNull("Adapter must not be null", adapter); //$NON-NLS-1$
    return adapter;
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

  public DiscoveryContainerTest(String name) {
    super(name);
  }
 
  protected IDiscoveryLocator getDiscoveryLocator() {
    final IDiscoveryLocator adapter = (IDiscoveryLocator) container.getAdapter(IDiscoveryLocator.class);
    assertNotNull("Adapter must not be null", adapter);
    return adapter;
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

  protected IDiscoveryLocator discoveryLocator;

  protected IDiscoveryLocator getDiscoveryLocator() {
    ServiceTracker serviceTracker = new ServiceTracker(Activator.getDefault().getContext(),IDiscoveryLocator.class.getName(), null);
    serviceTracker.open();
    IDiscoveryLocator result = (IDiscoveryLocator) serviceTracker.getService();
    serviceTracker.close();
    return result;
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

  public DiscoveryTestsWithoutRegister(String name) {
    super(name);
  }
 
  protected IDiscoveryLocator getDiscoveryLocator() {
    final IDiscoveryLocator adapter = (IDiscoveryLocator) container.getAdapter(IDiscoveryLocator.class);
    assertNotNull("Adapter must not be null", adapter);
    return adapter;
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

   * This method is called when the plug-in is stopped
   */
  public void stop(final BundleContext ctxt) throws Exception {
    if (serviceRegistration != null && serviceFactory.isActive()) {
      ServiceReference reference = serviceRegistration.getReference();
      IDiscoveryLocator aLocator = (IDiscoveryLocator) ctxt.getService(reference);

      serviceRegistration.unregister();

      IContainer container = (IContainer) aLocator.getAdapter(IContainer.class);
      container.disconnect();
      container.dispose();

      serviceRegistration = null;
    }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IDiscoveryLocator

   */
  public void stop(final BundleContext context) throws Exception {
    //TODO-mkuppe here we should do something like a deregisterAll(), but see ungetService(...);
    if (serviceRegistration != null && serviceFactory.isActive()) {
      ServiceReference reference = serviceRegistration.getReference();
      IDiscoveryLocator aLocator = (IDiscoveryLocator) context.getService(reference);

      serviceRegistration.unregister();

      IContainer container = (IContainer) aLocator.getAdapter(IContainer.class);
      container.disconnect();
      container.dispose();

      serviceRegistration = null;
    }
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.