/** * Sets config. * * @param configFile the config file. * @throws AdminException the admin exception */ public void setConfig(File configFile) throws AdminException { this.config = new Config(configFile); }
private void verifyConfig(File configFile) { Config config = new Config(configFile); config.stop(); }
config = new Config(configFile); break; case "file": throw new IllegalArgumentException("File not found in " + configFile.getAbsolutePath()); config = new Config(configFile); break; case "zookeeper": ZookeeperConfigProvider zookeeperConfigProvider = new ZookeeperConfigProvider(configUri); configFile = zookeeperConfigProvider.getConfigFile(); config = new Config(zookeeperConfigProvider); } catch (Exception e) { throw new RuntimeException(e);
public static void main(String[] args) throws ParseException, IOException { PropertyConfigurator.configure("conf/log4j.properties"); CommandLineParser parser = new DefaultParser(); Options options = new Options(); options.addOption("port", true, "Listening port"); options.addOption("config", true, "config file"); options.addOption("h", false, "help"); CommandLine commandLine = parser.parse(options, args); if (commandLine.hasOption("help")) { new HelpFormatter().printHelp("GondolaAgent", options); return; } if (commandLine.hasOption("port")) { port = Integer.parseInt(commandLine.getOptionValue("port")); } else { port = 1200; } if (commandLine.hasOption("config")) { configFile = commandLine.getOptionValue("config"); } else { configFile = "conf/gondola-sample.conf"; } config = new Config(new File(configFile)); logger.info("Initialize system, kill all gondola processes"); new DefaultExecutor().execute(org.apache.commons.exec.CommandLine.parse("bin/gondola-local-test.sh stop")); new GondolaAgent(port); }
private void loadConfig(File configFile) { this.configFile = configFile; config = new Config(configFile); configImpl = ConfigFactory.parseFile(configFile); tmpFile = confFile(true); verify(); }
config = new Config(configFile); if (hostId == null || clusterId == null) { printUsage();