package io.vertx.example.core.ha;

import io.vertx.core.AbstractVerticle;

import java.lang.management.ManagementFactory;

/*
 * This is just a simple verticle creating a HTTP server. The served response contains an id identifying the process
 * for illustration purpose as it will change when the verticle is migrated.
 *
 * The verticle is intended to be launched using the `-ha` option.
 */
public class Server extends AbstractVerticle {

  @Override
  public void start() throws Exception {
    vertx.createHttpServer().requestHandler(req -> {
      final String name = ManagementFactory.getRuntimeMXBean().getName();
      req.response().end("Happily served by " + name);
    }).listen(8080);
  }
}

@@ -66,16 +66,132 @@
 erticle;
+%0Aimport io.vertx.core.VertxOptions;%0Aimport io.vertx.example.util.ExampleRunner;%0Aimport io.vertx.example.util.Runner;
 %0A%0Aimport
@@ -551,16 +551,244 @@
 icle %7B%0A%0A
+  // Convenience method so you can run it in your IDE%0A  public static void main(String%5B%5D args) %7B%0A    ExampleRunner.runJavaExample(%22core-examples/src/main/java%22,%0A        Server.class, new VertxOptions().setHAEnabled(true));%0A  %7D%0A%0A
   @Overr

Add the main method to launch the server from the IDE as discussed in https://github.com/vert-x3/vertx-examples/pull/37#discussion_r31921428