public HttpServerSimulator(int numOfWorkers, int minProcessTime, int maxProcessTime) {
   server = new HttpServer();
   handler = new MessageHandler();
   server.add("/message", handler);
   server.setPort(7080);
   server.setNumberOfWorkers(numOfWorkers);
   handler.setMinProcessTime(minProcessTime);
   handler.setMaxProcessTime(maxProcessTime);
 }
Exemplo n.º 2
0
 public SparknginServer() throws Exception {
   FileUtil.removeIfExist("build/queue", false);
   forwarder = new NullDevMessageForwarder();
   server = new HttpServer();
   server.setPort(7080);
   metricRegistry = new MetricRegistry();
   server.add(
       "/message/json",
       new JSONMessageRouteHandler(new Sparkngin(metricRegistry, forwarder, "build/queue/data")));
   server.setDefault(new StaticFileHandler("."));
   server.startAsDeamon();
   Thread.sleep(2000);
 }
Exemplo n.º 3
0
 public void shutdown() {
   server.shutdown();
 }
 public HttpServerSimulator shutdown() {
   server.shutdown();
   return this;
 }
 public HttpServerSimulator start() {
   server.startAsDeamon();
   return this;
 }