Examples of Vertx


Examples of org.vertx.java.core.Vertx

      "</body>\n" +
      "</html>";

  // For debug only
  public static void main(String[] args) throws Exception {
    Vertx vertx = VertxFactory.newVertx();
    HttpServer httpServer = vertx.createHttpServer();
    DefaultSockJSServer sjsServer = (DefaultSockJSServer)vertx.createSockJSServer(httpServer);
    sjsServer.installTestApplications();
    httpServer.listen(8081);
    Thread.sleep(Long.MAX_VALUE);
  }
View Full Code Here

Examples of org.vertx.java.core.Vertx

  private static ServeFileHandler fileHandler = new ServeFileHandler();
  private static ServeApiHandler apiHandler = new ServeApiHandler();

  public WebAdmin(final Verticle verticle) {
    final Vertx vertx = verticle.getVertx();

    HttpServer server = vertx.createHttpServer();
    server.requestHandler(new Handler<HttpServerRequest>() {

      @Override
      public void handle(HttpServerRequest request) {
        Path path = Paths.get(request.uri);

        if (path.startsWith("/api")) {
          apiHandler.handle(request);
          return;
        }

        fileHandler.handle(request);
      }
    });

    SockJSServer sockjsServer = vertx.createSockJSServer(server);

    JsonObject config = new JsonObject().putString("prefix", "/eventbus");
    JsonArray inbound = new JsonArray();
    inbound.addObject(new JsonObject().putString("address_re",
        "deployment-manager\\.server\\..+"));
View Full Code Here

Examples of org.vertx.java.core.Vertx

public class HelloVertx {

    public static void main(String[] args) throws Exception {
        Configuration config = HBaseConfiguration.create();
        HTable table = new HTable(config, "Requests");
        Vertx vertx = VertxFactory.newVertx();
        vertx.createHttpServer().requestHandler((HttpServerRequest request) -> {
            System.out.println("A request has arrived on the server!");
            System.out.println(request.uri());
            MultiMap params = request.params();
            params.entries().stream().forEach((entry) -> {
                try {
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.