@Override public void start(final BundleContext bundleContext) throws InvalidSyntaxException { LOG.debug("Starting BundleActivator {}", this.toString()); m_bundleContext.set(bundleContext); // register for ONMS registrations to forward registrations to OSGi service registry getRegistry().addRegistrationHook(this, true); // register service listener for export osgi services to forward to ONMS registry String exportFilter = "("+REGISTRATION_EXPORT+"=*)"; bundleContext.addServiceListener(this, exportFilter); // forward any existing exported OSGi services with ONMS service registry ServiceReference<?>[] osgiServices = bundleContext.getAllServiceReferences(null, exportFilter); if (osgiServices != null) { for(ServiceReference<?> reference : osgiServices) { registerWithOnmsRegistry(reference); } } LOG.debug("BundleActivator {} started", this.toString()); }
@Override public void start(final BundleContext bundleContext) throws InvalidSyntaxException { LOG.debug("Starting BundleActivator {}", this.toString()); m_bundleContext.set(bundleContext); // register for ONMS registrations to forward registrations to OSGi service registry getRegistry().addRegistrationHook(this, true); // register service listener for export osgi services to forward to ONMS registry String exportFilter = "("+REGISTRATION_EXPORT+"=*)"; bundleContext.addServiceListener(this, exportFilter); // forward any existing exported OSGi services with ONMS service registry ServiceReference<?>[] osgiServices = bundleContext.getAllServiceReferences(null, exportFilter); if (osgiServices != null) { for(ServiceReference<?> reference : osgiServices) { registerWithOnmsRegistry(reference); } } LOG.debug("BundleActivator {} started", this.toString()); }
m_registry.addRegistrationHook(hook, true);
m_registry.addRegistrationHook(hook, true);