Java 类org.osgi.framework.hooks.service.ListenerHook 实例源码

项目:osgi-in-action    文件:Activator.java   
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);
}
项目:osgi_in_action-    文件:Activator.java   
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);
}
项目:aries-rsa    文件:TopologyManagerImport.java   
public void start() {
    bctx.registerService(RemoteServiceAdminListener.class, this, null);
    bctx.registerService(ListenerHook.class, listenerHook, null);
    bctx.registerService(FindHook.class, findHook, null);
    endpointListenerManager.start();
}