code: public static MessagingClientFactoryRegistry lookupMessagingClientFactoryRegistryService( OsgiHelper osgiHelper ) {
  
  		MessagingClientFactoryRegistry result = null;
  		final Logger logger = Logger.getLogger( ReconfigurableClient.class.getName());
  
  		BundleContext bundleCtx = osgiHelper.findBundleContext();
  		if( bundleCtx != null ) {
  			logger.info( "The messaging registry is used in an OSGi environment." );
  
  			// There must be only *one* MessagingClientFactoryRegistry service.
  			final ServiceReference<MessagingClientFactoryRegistry> reference =
  					bundleCtx.getServiceReference( MessagingClientFactoryRegistry.class );
  
  			// The service will be unget when this bundle stops. No need to worry!
  			if( reference != null ) {
  				logger.fine( "The service reference was found." );
  				result = bundleCtx.getService( reference );
  			}
  
  		} else {
  			logger.info( "The messaging registry is NOT used in an OSGi environment." );
  		}
  
  		return result;
  	}
docs: Try to locate the {@code MessagingClientFactoryRegistry} service in an OSGi execution context.
  <p>
  NOTE: this method is, by definition, quite dirty.
  </p>
  TODO: what happens when the registry component is being started, but the service is not yet registered. Wait? How long?
  @return the located {@code MessagingClientFactoryRegistry} service, or {@code null} if the service cannot be
  found, or if there is no OSGi execution context.