code: private static <T> Collection<String> loadClasses(final ClassLoader classLoader, final Class<? extends T> service) {
  		String name = SERVICE_PREFIX + service.getName();
  		Enumeration<URL> urls;
  		try {
  			urls = classLoader.getResources(name);
  		} catch (IOException ex) {
  			InternalLogger.log(Level.ERROR, "Failed loading services from '" + name + "'");
  			return Collections.emptyList();
  		}
  
  		Collection<String> classes = new ArrayList<String>();
  
  		while (urls.hasMoreElements()) {
  			URL url = urls.nextElement();
  			BufferedReader reader = null;
  
  			try {
  				reader = new BufferedReader(new InputStreamReader(url.openStream(), "utf-8"));
  				for (String line = reader.readLine(); line != null; line = reader.readLine()) {
  					line = line.trim();
  					if (line.length() > 0 && line.charAt(0) != '#' && !classes.contains(line)) {
  						classes.add(line);
  					}
  				}
  			} catch (IOException ex) {
  				InternalLogger.log(Level.ERROR, "Failed reading service resource '" + url + "'");
  			} finally {
  				if (reader != null) {
  					try {
  						reader.close();
  					} catch (IOException ex) {
  						// Ignore
  					}
  				}
  			}
  		}
  
  		return classes;
  	}
docs: Loads all registered service class names.
  
  @param <T>
  Service interface
  @param classLoader
  Class loader to use for finding service files
  @param service
  Service interface
  @return Class names