private synchronized void bindRegistry(Registry registry, String[] intents, String[] configs) { RegistryWatcher watcher = new RegistryWatcher(ctx, registry); watchers.put(registry, watcher); ServiceRegistration[] regs = new ServiceRegistration[2]; ExportedServiceTracker export = new ExportedServiceTracker(ctx, registry, intents, configs); export.open(); trackers.put(registry, export); ImportedServiceFindHook find = new ImportedServiceFindHook(watcher); regs[0] = ctx.registerService(FindHook.class.getName(), find, null); ImportedServiceListenerHook listener = new ImportedServiceListenerHook( watcher); regs[1] = ctx.registerService(ListenerHook.class.getName(), listener, null); serviceRegs.put(registry, regs); }
public void start() { bctx.registerService(RemoteServiceAdminListener.class, this, null); bctx.registerService(ListenerHook.class, listenerHook, null); bctx.registerService(FindHook.class, findHook, null); endpointListenerManager.start(); }