Examples of RatpackServer


Examples of ratpack.server.RatpackServer

  /**
   * {@inheritDoc}
   */
  @Override
  default public URI getAddress() {
    RatpackServer server = getServer();
    try {
      if (!server.isRunning()) {
        server.start();
      }
      return new URI(server.getScheme(), null, server.getBindHost(), server.getBindPort(), "/", null, null);
    } catch (Exception e) {
      throw uncheck(e);
    }
  }
View Full Code Here

Examples of ratpack.server.RatpackServer

          return new GroovyClosureHandlerFactory(closure);
        }
      };
    }

    RatpackServer server = RatpackServerBuilder.build(launchConfig);

    Action<? super RatpackServer> action = CAPTURE_ACTION.getAndSet(null);
    if (action != null) {
      action.execute(server);
    }

    server.start();

    try {
      while (server.isRunning() && !Thread.interrupted()) {
        Thread.sleep(1000);
      }
    } catch (InterruptedException ignore) {
      // do nothing
    }

    server.stop();
  }
View Full Code Here
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.