code: public static <T> T loadSpecificPlugin(final String name, 
        final Class<T> type) {
      if (name.isEmpty()) {
        throw new IllegalArgumentException("Missing plugin name");
      }
      ServiceLoader<T> serviceLoader = ServiceLoader.load(type);
      Iterator<T> it = serviceLoader.iterator();
      if (!it.hasNext()) {
        LOG.warn("Unable to locate any plugins of the type: " + type.getName());
        return null;
      }
      
      while(it.hasNext()) {
        T plugin = it.next();
        if (plugin.getClass().getName().equals(name) || plugin.getClass().getSuperclass().getName().equals(name)) {
          return plugin;
        }
      }
      
      LOG.warn("Unable to locate plugin: " + name);
      return null;
    }
docs: Searches the class path for the specific plugin of a given type
  <p>
  <b>Note:</b> If you want to load JARs dynamically, you need to call
  {@link #loadJAR} or {@link #loadJARs} methods with the proper file
  or directory first, otherwise this will only search whatever was loaded
  on startup.
  <p>
  <b>WARNING:</b> If there are multiple versions of the request plugin in the
  class path, only one will be returned, so check the logs to see that the
  correct version was loaded.
  
  @param name The specific name of a plugin to search for, e.g.
  net.opentsdb.search.ElasticSearch
  @param type The class type to search for
  @return An instantiated object of the given type if found, null if the
  class could not be found
  @throws ServiceConfigurationError if the plugin cannot be instantiated
  @throws IllegalArgumentException if the plugin name is null or empty