Beispiel #1
0
 private static ConnectorFacade getConnectorFacade(Configuration configuration) {
   ConnectorType connectorType =
       ConnectorType.getValidConnectorType(
           configuration.getProperty(GeneralOption.CONNECTOR_TYPE));
   ConnectorFacade facade = null;
   try {
     facade = ConnectorFacadeFactory.INSTANCE.build(connectorType, configuration);
     facade.validate(configuration);
   } catch (GeneralOptionNotSupportedException e) {
     System.out.println(e.getMessage());
     System.exit(2);
   }
   return facade;
 }
Beispiel #2
0
  public static void main(String[] args) {
    printWelcomeMessage();
    CliWrapper cliWrapper = new CliWrapper();
    CommandLine commandLine = null;
    try {
      commandLine = cliWrapper.parse(args);
    } catch (ParseException e) {
      printUsage(cliWrapper);
      System.out.println(e.getMessage());
      System.exit(1);
    }

    Configuration configuration =
        ConfigurationBuilder.initFromFile(
            commandLine.getOptionValue(CliOption.CONF.getCommandLineParam()));
    configuration.updateWithCliOptions(commandLine);

    ConnectorFacade facade = getConnectorFacade(configuration);
    new Engine(facade, facade, configuration).run();
  }