Search in sources :

Example 46 with IServiceInfo

use of org.eclipse.ecf.discovery.IServiceInfo in project ecf by eclipse.

the class ZooDiscoveryContainer method getServices.

public IServiceInfo[] getServices(IServiceTypeID type) {
    Assert.isNotNull(type);
    if (watchManager == null) {
        return new IServiceInfo[0];
    }
    List<IServiceInfo> services = new ArrayList<IServiceInfo>();
    for (IServiceInfo sinfo : watchManager.getAllKnownServices().values()) {
        if (sinfo.getServiceID().getServiceTypeID().getInternal() == type.getInternal())
            services.add(sinfo);
    }
    return services.toArray(new IServiceInfo[services.size()]);
}
Also used : IServiceInfo(org.eclipse.ecf.discovery.IServiceInfo) ArrayList(java.util.ArrayList)

Example 47 with IServiceInfo

use of org.eclipse.ecf.discovery.IServiceInfo in project ecf by eclipse.

the class WatchManager method unpublish.

public synchronized void unpublish(final String id) {
    Assert.isNotNull(id);
    IServiceInfo p = AdvertisedService.removePublished(id);
    if (p == null) {
        return;
    }
    NodeWriter nw = getNodeWriters().remove(id);
    if (nw != null) {
        allKnownServices.remove(nw.getNode().getWrappedService().getServiceID().getName());
        nw.remove();
    }
    nw = null;
}
Also used : IServiceInfo(org.eclipse.ecf.discovery.IServiceInfo)

Aggregations

IServiceInfo (org.eclipse.ecf.discovery.IServiceInfo)47 IContainerEvent (org.eclipse.ecf.core.events.IContainerEvent)8 IServiceTypeID (org.eclipse.ecf.discovery.identity.IServiceTypeID)8 Properties (java.util.Properties)7 URI (java.net.URI)6 IServiceEvent (org.eclipse.ecf.discovery.IServiceEvent)6 IServiceID (org.eclipse.ecf.discovery.identity.IServiceID)6 BundleContext (org.osgi.framework.BundleContext)6 ArrayList (java.util.ArrayList)5 ExecutionException (org.eclipse.core.commands.ExecutionException)5 ServiceRegistration (org.osgi.framework.ServiceRegistration)5 IServiceListener (org.eclipse.ecf.discovery.IServiceListener)4 ServiceInfo (org.eclipse.ecf.discovery.ServiceInfo)4 TestServiceListener (org.eclipse.ecf.tests.discovery.listener.TestServiceListener)4 ThreadTestServiceListener (org.eclipse.ecf.tests.discovery.listener.ThreadTestServiceListener)4 ServiceURL (ch.ethz.iks.slp.ServiceURL)3 List (java.util.List)3 IDCreateException (org.eclipse.ecf.core.identity.IDCreateException)3 IServiceProperties (org.eclipse.ecf.discovery.IServiceProperties)3 Iterator (java.util.Iterator)2