code: protected Set<String> discover(String path) {
          Set<String> modules = new HashSet<String>();
  
          File root;
          if (path != null && (root = new File(path)).isDirectory()) {
              try {
                  _logger.info("Attempting to discover service modules under " + root.getCanonicalPath());
                  List<URL> urls = new ArrayList<URL>();
                  discover(urls, modules, root, new FileFilter(){ public boolean accept(File f){ return f.isDirectory() || f.getName().endsWith(".jar"); }});
                  if (urls.size() > 0) {
                      ClassLoader loader = Thread.currentThread().getContextClassLoader();
                      if (loader instanceof ServiceModuleClassLoader) {
                          ((ServiceModuleClassLoader)loader).incorporate(urls.toArray(new URL[urls.size()]));
                      } else {
                          Thread.currentThread().setContextClassLoader(new ServiceModuleClassLoader(urls.toArray(new URL[urls.size()]), loader));
                      }
                  }
              } catch (Exception x) {
                  throw new RuntimeException("FailureInLoadingExtensions", x);
              }
          }
  
          return modules;
      }
docs: /*#
  Discovers service modules from a local directory. The current thread's context class loader is updated to incorporate
  all discovered JARs.
  
  @param path - a directory in the local file system where extension modules can be found
  @return a Set of URLs as strings