Package com.hubspot.singularity.logwatcher

Source Code of com.hubspot.singularity.logwatcher.SingularityLogWatcherRunner

package com.hubspot.singularity.logwatcher;

import java.util.List;

import com.google.common.collect.Lists;
import com.google.inject.Module;
import com.hubspot.singularity.logwatcher.config.SingularityLogWatcherConfigurationLoader;
import com.hubspot.singularity.logwatcher.config.SingularityLogWatcherModule;
import com.hubspot.singularity.logwatcher.config.test.SingularityLogWatcherNoopModule;
import com.hubspot.singularity.logwatcher.config.test.SingularityLogWatcherTestModule;
import com.hubspot.singularity.logwatcher.impl.SingularityLogWatcherImplModule;
import com.hubspot.singularity.runner.base.config.SingularityRunnerBaseModule;
import com.hubspot.singularity.runner.base.shared.SingularityRunner;

public class SingularityLogWatcherRunner {

  public static void main(String... args) {
    new SingularityLogWatcherRunner().run(args);
  }

  private SingularityLogWatcherRunner() {}

  public void run(String[] args) {
    List<Module> modules = Lists.newArrayListWithCapacity(3);
    modules.add(new SingularityRunnerBaseModule(new SingularityLogWatcherConfigurationLoader()));
    modules.add(new SingularityLogWatcherModule());

    if (args.length > 0) {
      if (args[0].equals("--test")) {
        System.out.println("Using test module...");
        modules.add(new SingularityLogWatcherTestModule());
      } else if (args[0].equals("--noop")) {
        System.out.println("Using noop module...");
        modules.add(new SingularityLogWatcherNoopModule());
      }
    } else {
      modules.add(new SingularityLogWatcherImplModule());
    }

    new SingularityRunner().run(modules);
  }

}
TOP

Related Classes of com.hubspot.singularity.logwatcher.SingularityLogWatcherRunner

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.