code: private ConfigurationAdmin getConfigurationAdmin( final BundleContext bundleContext )
      {
          final ServiceReference ref = bundleContext.getServiceReference( ConfigurationAdmin.class.getName() );
          if( ref == null )
          {
              throw new IllegalStateException( "Cannot find a configuration admin service" );
          }
          return (ConfigurationAdmin) bundleContext.getService( ref );
      }
docs: Gets Configuration Admin service from service registry.
  
  @param bundleContext bundle context
  
  @return configuration admin service
  
  @throws IllegalStateException - If no Configuration Admin service is available