Examples of requestHandler()


Examples of org.vertx.java.core.http.HttpServer.requestHandler()

        final RackApplication app;
        boolean ssl = config.getBoolean("ssl");
        try {
            app = new RackApplication((WrappedVertx) vertx, runtime.getCurrentContext(), rackApplication, config);
            httpServer.setAcceptBacklog(10000);
            httpServer.requestHandler(new Handler<HttpServerRequest>() {
                public void handle(final HttpServerRequest req) {
                    app.call(req);
                }
            });
            if (config.containsField("event_bus")) {
View Full Code Here

Examples of org.vertx.java.core.http.HttpServer.requestHandler()

        // Init jersey handler
        jerseyHandler.init(configurator);

        // Set request handler, use route matcher if a route handler is provided.
        if (routeMatcherHandler == null) {
            server.requestHandler(jerseyHandler);
        } else {
            RouteMatcher rm = new RouteMatcher();
            String pattern = jerseyHandler.getBaseUri().getPath() + "*";
            rm.all(pattern, jerseyHandler);
            routeMatcherHandler.handle(rm);
View Full Code Here

Examples of org.vertx.java.core.http.HttpServer.requestHandler()

        JerseyHandler handler = jerseyHandlerProvider.get();
        if (handler == null) {
            throw new IllegalStateException("A JerseyHandlerProvider has not been configured");
        }
        handler.init(vertx, container);
        server.requestHandler(handler);

        if (receiveBufferSize > 0) {
            // TODO: This doesn't seem to actually affect buffer size for dataHandler.  Is this being used correctly or is it a Vertx bug?
            server.setReceiveBufferSize(receiveBufferSize);
        }
View Full Code Here

Examples of org.vertx.java.core.http.HttpServer.requestHandler()

  public void start() throws Exception {
    HttpServer server = vertx.createHttpServer();

    // Also serve the static resources. In real life this would probably be done by a CDN
    server.requestHandler(new Handler<HttpServerRequest>() {
      public void handle(HttpServerRequest req) {
        if (req.path.equals("/")) req.response.sendFile("eventbusbridge/index.html"); // Serve the index.html
        if (req.path.endsWith("vertxbus.js")) req.response.sendFile("eventbusbridge/vertxbus.js"); // Serve the js
      }
    });
View Full Code Here

Examples of org.vertx.java.core.http.HttpServer.requestHandler()

public class SockJSExample extends Verticle {

  public void start() {
    HttpServer server = vertx.createHttpServer();

    server.requestHandler(new Handler<HttpServerRequest>() {
      public void handle(HttpServerRequest req) {
        if (req.path.equals("/")) req.response.sendFile("sockjs/index.html"); // Serve the html
      }
    });
View Full Code Here

Examples of org.vertx.java.core.http.HttpServer.requestHandler()

  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);
View Full Code Here

Examples of org.vertx.java.core.http.HttpServer.requestHandler()

            server.setReceiveBufferSize(receiveBufferSize);
        }

        // Set request handler, use route matcher if a route handler is provided.
        if (routeMatcherHandler == null) {
            server.requestHandler(jerseyHandler);
        } else {
            RouteMatcher rm = new RouteMatcher();
            String pattern = jerseyHandler.getBaseUri().getPath() + "*";
            rm.all(pattern, jerseyHandler);
            routeMatcherHandler.handle(rm);
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.