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);
}
});
}