// Path: environment.monitor.core/src/main/java/org/yagel/monitor/MonitorConfig.java
// public interface MonitorConfig {
// 
// 
//   Set<EnvironmentConfig> getEnvironments();
// 
// }
// 
// Path: environment.monitor.plugins/src/main/java/org/yagel/monitor/plugins/exception/PluginException.java
// public class PluginException extends RuntimeException {
// 
//   public PluginException(Throwable cause) {
//     super(cause);
//   }
// 
//   public PluginException(String message, Throwable cause) {
//     super(message, cause);
//   }
// }
// 
// Path: environment.monitor.core/src/main/java/org/yagel/monitor/status/collector/MonitorStatusCollectorLoader.java
// public interface MonitorStatusCollectorLoader {
// 
// 
//   MonitorStatusCollector loadCollector(EnvironmentConfig config);
// 
// }


import org.apache.log4j.Logger;
import org.yagel.monitor.MonitorConfig;
import org.yagel.monitor.plugins.exception.PluginException;
import org.yagel.monitor.status.collector.MonitorStatusCollectorLoader;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

        try {
          log.debug("External class found: " + className);
          Class c = cl.loadClass(className);
          log.debug("Loaded class : " + className);

          if (loaderClass.isAssignableFrom(c)) {
            classProvider = c;
            log.debug("Found implementation of loader class, taking as plugin provider : " + className);
          }
        } catch (ClassNotFoundException ex) {
          throw new PluginException("For some reason was unable to load class from plugin jar", ex);
        }
      }

    } catch (IOException e) {
      throw new PluginException("Exception occurred during loading plugin jar", e);
    }


  }

  public MonitorStatusCollectorLoader getStatusCollectorLoader() {
    try {
      return (MonitorStatusCollectorLoader) classProvider.newInstance();
    } catch (InstantiationException | IllegalAccessException e) {
      throw new PluginException("Unable to instantiate plugin collector class", e);
    }
  }

// Path: environment.monitor.core/src/main/java/org/yagel/monitor/MonitorConfig.java
// public interface MonitorConfig {
// 
// 
//   Set<EnvironmentConfig> getEnvironments();
// 
// }
// 
// Path: environment.monitor.plugins/src/main/java/org/yagel/monitor/plugins/exception/PluginException.java
// public class PluginException extends RuntimeException {
// 
//   public PluginException(Throwable cause) {
//     super(cause);
//   }
// 
//   public PluginException(String message, Throwable cause) {
//     super(message, cause);
//   }
// }
// 
// Path: environment.monitor.core/src/main/java/org/yagel/monitor/status/collector/MonitorStatusCollectorLoader.java
// public interface MonitorStatusCollectorLoader {
// 
// 
//   MonitorStatusCollector loadCollector(EnvironmentConfig config);
// 
// }


// Path: environment.monitor.plugins/src/main/java/org/yagel/monitor/plugins/JarScanner.java
import org.apache.log4j.Logger;
import org.yagel.monitor.MonitorConfig;
import org.yagel.monitor.plugins.exception.PluginException;
import org.yagel.monitor.status.collector.MonitorStatusCollectorLoader;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;


        try {
          log.debug("External class found: " + className);
          Class c = cl.loadClass(className);
          log.debug("Loaded class : " + className);

          if (loaderClass.isAssignableFrom(c)) {
            classProvider = c;
            log.debug("Found implementation of loader class, taking as plugin provider : " + className);
          }
        } catch (ClassNotFoundException ex) {
          throw new PluginException("For some reason was unable to load class from plugin jar", ex);
        }
      }

    } catch (IOException e) {
      throw new PluginException("Exception occurred during loading plugin jar", e);
    }


  }

  public MonitorStatusCollectorLoader getStatusCollectorLoader() {
    try {
      return (MonitorStatusCollectorLoader) classProvider.newInstance();
    } catch (InstantiationException | IllegalAccessException e) {
      throw new PluginException("Unable to instantiate plugin collector class", e);
    }
  }

  public MonitorConfig getMonitorConfig() {