コード例 #1
0
  /** @param args the command line arguments */
  public static void main(String[] args) {
    try {
      Configuration.Prepare();

      NoSQL.InitializeApplicationContext();
      NoSQL.InitializeHttpServer();
    } catch (IOException ex) {
      Logger.getLogger(NoSQL.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
コード例 #2
0
  private static void InitializeHttpServer() throws IOException {
    Long port = (Long) Configuration.GetParam("main:port");

    server = HttpServer.create(new InetSocketAddress(port.intValue()), 0);

    server.createContext("/info", new InfoRequest());
    server.createContext("/db/couchdb", new CouchdbJobRequest());
    server.createContext("/db/mongodb", new MongodbJobRequest());
    server.createContext("/db/postgresql", new PostgresqlJobRequest());

    server.setExecutor(null);
    server.start();
  }