use of org.eclipse.ecf.provider.jmdns.container.ContainerInstantiator in project ecf by eclipse.
the class JMDNSPlugin method start.
/**
* This method is called upon plug-in activation
*/
public void start(final BundleContext ctxt) throws Exception {
this.context = ctxt;
final Properties props = new Properties();
props.put(IDiscoveryService.CONTAINER_NAME, NAME);
props.put(Constants.SERVICE_RANKING, new Integer(750));
String[] clazzes = new String[] { IDiscoveryService.class.getName(), IDiscoveryLocator.class.getName(), IDiscoveryAdvertiser.class.getName() };
serviceRegistration = context.registerService(clazzes, serviceFactory, props);
SafeRunner.run(new ExtensionRegistryRunnable(ctxt) {
protected void runWithoutRegistry() throws Exception {
ctxt.registerService(Namespace.class, new JMDNSNamespace("JMDNS Discovery Namespace"), null);
ctxt.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(ContainerInstantiator.JMDNS_CONTAINER_NAME, new ContainerInstantiator(), "JMDNS Discovery Container", true, false), null);
ctxt.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(ContainerInstantiator.JMDNS_LOCATOR_NAME, new ContainerInstantiator(), "JMDNS Discovery Locator"), null);
ctxt.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(ContainerInstantiator.JMDNS_ADVERTISER_NAME, new ContainerInstantiator(), "JMDNS Discovery Advertiser"), null);
}
});
}
Aggregations