Package org.vertx.java.core

Examples of org.vertx.java.core.Vertx


        }

        if (instanceCache.containsKey(instanceKey)) {
            return instanceCache.get(instanceKey);
        } else {
            Vertx vertx = createVertx(endpointConfiguration);
            instanceCache.put(instanceKey, vertx);
            return vertx;
        }
    }
View Full Code Here


        Assert.assertEquals(VertxServiceImpl.class.getName(), vertxService.getClass().getSuperclass().getName());
    }
   
    @Test
    public void VertxExistsTest() {
        final Vertx vertx = vertxService.getVertx();
        Assert.assertNotNull(vertx);
    }
View Full Code Here

    }

    private void updateConfiguration(Map<String, ?> configuration) throws Exception {
        configurer.configure(configuration, this);

        Vertx vertx = getVertx();
        handler = new HttpGatewayHandler(vertx, this);
        websocketHandler.setPathPrefix(websocketGatewayPrefix);
        server = new HttpGatewayServer(vertx, handler, enableWebSocketGateway ? websocketHandler : null, port);
        server.init();
    }
View Full Code Here

        // mq-create / mq-client profiles so that we only listen to a subset of the available brokers here?

        ServiceMap serviceMap = new ServiceMap();

        VertxService vertxService = getVertxService();
        Vertx vertx = vertxService.getVertx();
        CuratorFramework curator = getCurator();

        LoadBalancer pathLoadBalancer = LoadBalancers.createLoadBalancer(loadBalancerType, stickyLoadBalancerCacheSize);
        LoadBalancer serviceLoadBalancer = LoadBalancers.createLoadBalancer(loadBalancerType, stickyLoadBalancerCacheSize);
View Full Code Here

      "</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

  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

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

Related Classes of org.vertx.java.core.Vertx

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.