Runtime runtime = injectedRuntime.getValue();
initConfigurationAdmin(runtime);
// Start listening on the {@link ZooKeeperClusterBootstrap}
final CountDownLatch latch = new CountDownLatch(1);
final ModuleContext syscontext = injectedModuleContext.getValue();
ServiceListener listener = new ServiceListener() {
@Override
public void serviceChanged(ServiceEvent event) {
if (event.getType() == ServiceEvent.REGISTERED) {
ServiceReference<?> sref = event.getServiceReference();
bootstrapService = (ZooKeeperClusterBootstrap) syscontext.getService(sref);
syscontext.removeServiceListener(this);
latch.countDown();
}
}
};
syscontext.addServiceListener(listener, "(objectClass=" + ZooKeeperClusterBootstrap.class.getName() + ")");
// Install and start this as a {@link Module}
ModuleClassLoader classLoader = (ModuleClassLoader) getClass().getClassLoader();
try {
URL url = classLoader.getResource(JarFile.MANIFEST_NAME);