Examples of addServiceListener()


Examples of org.osgi.framework.BundleContext.addServiceListener()

            if (hostObjectsThatNeedServices.isEmpty()) {
                Utils.registerDeployerServices(bundleContext);
                log.info("JS Deployer initialized");
            } else {
                final HostObjectServiceListener listener = new HostObjectServiceListener(componentContext.getBundleContext(), hostObjectsThatNeedServices);
                bundleContext.addServiceListener(listener);
                listener.start();
                if (!hostObjectsThatNeedServices.isEmpty()) {
                    Timer timer = new Timer();
                    timer.scheduleAtFixedRate(new TimerTask() {
                        public void run() {
View Full Code Here

Examples of org.osgi.framework.BundleContext.addServiceListener()

          return ctx.getBundle(0).getBundleContext();
        }
      });
      if (systemBundle == null) systemBundle = ctx;
      systemBundle.addBundleListener(cacheClearoutListener);
      systemBundle.addServiceListener(cacheClearoutListener);
    }
  }

  private static final class ServiceKey
  {
View Full Code Here

Examples of org.osgi.framework.BundleContext.addServiceListener()

        BundleContext systemBundleContext = framework.getSystemBundleContext();

        try
        {
            systemBundleContext.addServiceListener(new ServiceListener()
            {
                public void serviceChanged(ServiceEvent serviceEvent)
                {
                    ServiceReference reference = serviceEvent.getServiceReference();
View Full Code Here

Examples of org.osgi.framework.BundleContext.addServiceListener()

                        holders.add(holder);
                    }
                }
            }, "(&(objectClass=" + URLStreamHandlerService.class.getName() + ")(" + URLConstants.URL_HANDLER_PROTOCOL + "=*))");

            systemBundleContext.addServiceListener(new ServiceListener()
            {
                public void serviceChanged(ServiceEvent serviceEvent)
                {
                    ServiceReference reference = serviceEvent.getServiceReference();

View Full Code Here

Examples of org.osgi.framework.BundleContext.addServiceListener()

  @Override
  // 注册
  public void register() {
    BundleContext bundleContext = getBundleContext();
    bundleContext.addServiceListener(serviceListener);
    super.register();
  }

  // 取消注册
  @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.