// Path: core/src/main/java/org/n52/supervisor/checks/BasicRunnerFactory.java
// public class BasicRunnerFactory implements RunnerFactory {
// 	
// 	@Inject
// 	private ResultDatabase rd;
// 
// 	@Override
// 	public CheckRunner resolveRunner(Check check) {
// 		CheckRunner r = null;
//         
// 		if (check instanceof HeapCheck) {
//             final HeapCheck hc = (HeapCheck) check;
//             r = new HeapCheckRunner(hc);
//         }
//         else if (check instanceof SelfCheck) {
//             final SelfCheck sc = (SelfCheck) check;
//             r = new SelfCheckRunner(sc);
//         }
//         
// 		if (r != null) {
// 			r.setResultDatabase(rd);
// 		}
// 		
//         return r;
// 	}
// 
// }
// 
// Path: core/src/main/java/org/n52/supervisor/checks/RunnerFactory.java
// public interface RunnerFactory {
// 
// 	CheckRunner resolveRunner(Check check);
// 
// }


import com.google.inject.multibindings.Multibinder;
import com.google.inject.name.Names;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.n52.supervisor.checks.BasicRunnerFactory;
import org.n52.supervisor.checks.RunnerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.inject.AbstractModule;
			final String msg = "SuperVisor properties not found.";
			log.error(msg, e);
			throw new RuntimeException(msg,e);
		} catch (final IOException e) {
			final String msg = "SuperVisor properties not readable.";
			log.error(msg, e);
			throw new RuntimeException(msg,e);
		}
    	// try storing properties in user.home
    	final File folder = new File(USER_HOME_PATH);
		if (!folder.exists() && !folder.mkdir()) {
			log.warn("SuperVisor properties could not be saved. No writing permissions at '{}'.", folder);
			return properties;
		}
		final File file = new File(USER_HOME_PATH + name);
		log.info("Save properties at '{}'.", file.getAbsolutePath());
		try { //save properties
			final OutputStream os = new FileOutputStream(file);
			properties.store(os, null);
		} catch (final IOException e) {
			log.error("SuperVisor properties could not be saved.", e);
		}
		return properties;
    }

    @Override
    protected void configure() {
        final Properties appProps = loadProperties("app.properties");
        Names.bindProperties(binder(), appProps);

// Path: core/src/main/java/org/n52/supervisor/checks/BasicRunnerFactory.java
// public class BasicRunnerFactory implements RunnerFactory {
// 	
// 	@Inject
// 	private ResultDatabase rd;
// 
// 	@Override
// 	public CheckRunner resolveRunner(Check check) {
// 		CheckRunner r = null;
//         
// 		if (check instanceof HeapCheck) {
//             final HeapCheck hc = (HeapCheck) check;
//             r = new HeapCheckRunner(hc);
//         }
//         else if (check instanceof SelfCheck) {
//             final SelfCheck sc = (SelfCheck) check;
//             r = new SelfCheckRunner(sc);
//         }
//         
// 		if (r != null) {
// 			r.setResultDatabase(rd);
// 		}
// 		
//         return r;
// 	}
// 
// }
// 
// Path: core/src/main/java/org/n52/supervisor/checks/RunnerFactory.java
// public interface RunnerFactory {
// 
// 	CheckRunner resolveRunner(Check check);
// 
// }


// Path: core/src/main/java/org/n52/supervisor/ConfigModule.java
import com.google.inject.multibindings.Multibinder;
import com.google.inject.name.Names;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.n52.supervisor.checks.BasicRunnerFactory;
import org.n52.supervisor.checks.RunnerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.inject.AbstractModule;

			final String msg = "SuperVisor properties not found.";
			log.error(msg, e);
			throw new RuntimeException(msg,e);
		} catch (final IOException e) {
			final String msg = "SuperVisor properties not readable.";
			log.error(msg, e);
			throw new RuntimeException(msg,e);
		}
    	// try storing properties in user.home
    	final File folder = new File(USER_HOME_PATH);
		if (!folder.exists() && !folder.mkdir()) {
			log.warn("SuperVisor properties could not be saved. No writing permissions at '{}'.", folder);
			return properties;
		}
		final File file = new File(USER_HOME_PATH + name);
		log.info("Save properties at '{}'.", file.getAbsolutePath());
		try { //save properties
			final OutputStream os = new FileOutputStream(file);
			properties.store(os, null);
		} catch (final IOException e) {
			log.error("SuperVisor properties could not be saved.", e);
		}
		return properties;
    }

    @Override
    protected void configure() {
        final Properties appProps = loadProperties("app.properties");
        Names.bindProperties(binder(), appProps);

		Multibinder<RunnerFactory> binder = Multibinder.newSetBinder(binder(),