Package ratpack.server

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


          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

Related Classes of ratpack.server.RatpackServer

Copyright © 2018 www.massapicom. 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.