Skip to content

Commit

Permalink
javadoc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MammatusPlatypus committed Apr 9, 2016
1 parent 14b3811 commit 0218dbe
Showing 1 changed file with 68 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,86 +11,86 @@

/**
* Allows one to build an HTTP server.
* <p>
*
* It also allows one to pass a shared Vertx object if running inside of the Vertx world.
* It also allows one to pass a shared HttpServer if you want to use more than just QBit routing.
* If you are using routing or you want to limit this HttpServer to one route then you can
* pass routes.
* <p>
*
* This class allows you to mix and match Vertx routes and QBit REST routing.
* <p>
*
* ##Usage
* <p>
*
* #### Using this server with a single route
* ```java
* vertxHttpServerBuilder = VertxHttpServerBuilder.vertxHttpServerBuilder()
* .setVertx(vertx).setHttpServer(httpServer).setRoute(route);
* <p>
* HttpServer httpServer = vertxHttpServerBuilder.build();
* <p>
* vertxHttpServerBuilder = VertxHttpServerBuilder.vertxHttpServerBuilder()
* .setVertx(vertx).setHttpServer(httpServer).setRoute(route);
*
* HttpServer httpServer = vertxHttpServerBuilder.build();
*
* ```
* <p>
*
* #### Using this server but using Vertx Routes by passing a router.
* ```java
* <p>
* <p>
* Router router = Router.router(vertx); //Vertx router
* Route route1 = router.route("/some/path/").handler(routingContext -> {
* HttpServerResponse response = routingContext.response();
* // enable chunked responses because we will be adding data as
* // we execute over other handlers. This is only required once and
* // only if several handlers do output.
* response.setChunked(true);
* response.write("route1\n");
* <p>
* // Call the next matching route after a 5 second delay
* routingContext.vertx().setTimer(5000, tid -> routingContext.next());
* });
* <p>
* //Now install our QBit Server to handle REST calls.
* vertxHttpServerBuilder = VertxHttpServerBuilder.vertxHttpServerBuilder()
* .setVertx(vertx).setHttpServer(httpServer).setRouter(router);
* <p>
* HttpServer httpServer = vertxHttpServerBuilder.build();
* httpServer.start();
* <p>
* ```
* <p>
* Note that you can pass `HttpServerBuilder` or a `HttpServer` to `EndpointServerBuilder`
* to use that builder instead or `HttpServer` instead of the default.
* <p>
* #### EndpointServerBuilder integration
* ```java
* <p>
* //Like before
* vertxHttpServerBuilder = VertxHttpServerBuilder.vertxHttpServerBuilder()
* .setVertx(vertx).setHttpServer(httpServer).setRouter(router);
* //Now just inject it into the vertxHttpServerBuilder before you call build
* HttpServer httpServer = vertxHttpServerBuilder.build();
* endpointServerBuilder.setHttpServer(httpServer);
* ```
* <p>
* If you are using QBit REST with Vertx, that is one integration point.
* <p>
* Also note that you can pass `HttpServerBuilder` or a `HttpServer` to `ManagedServiceBuilder`
* to use that builder instead or `HttpServer` instead of the default.
* <p>
* #### ManagedServiceBuilder integration
* ```java
* //Like before
* vertxHttpServerBuilder = VertxHttpServerBuilder.vertxHttpServerBuilder()
* .setVertx(vertx).setHttpServer(httpServer).setRouter(router);
* <p>
* //Now just inject it into the vertxHttpServerBuilder before you call build
* HttpServer httpServer = vertxHttpServerBuilder.build();
* managedServiceBuilder.setHttpServer(httpServer);
*
*
* Router router = Router.router(vertx); //Vertx router
* Route route1 = router.route("/some/path/").handler(routingContext -> {
* HttpServerResponse response = routingContext.response();
* // enable chunked responses because we will be adding data as
* // we execute over other handlers. This is only required once and
* // only if several handlers do output.
* response.setChunked(true);
* response.write("route1\n");
*
* // Call the next matching route after a 5 second delay
* routingContext.vertx().setTimer(5000, tid -> routingContext.next());
* });
*
* //Now install our QBit Server to handle REST calls.
* vertxHttpServerBuilder = VertxHttpServerBuilder.vertxHttpServerBuilder()
* .setVertx(vertx).setHttpServer(httpServer).setRouter(router);
*
* HttpServer httpServer = vertxHttpServerBuilder.build();
* httpServer.start();
*
* ```
* <p>
* If you wanted to use QBit REST and QBit Swagger support with Vertx then you
* would want to use `ManagedServiceBuilder` with this class.
* <p>
* Read Vertx guide on routing for more details
* [Vertx Http Ext Manual](http://vertx.io/docs/vertx-web/java/#_routing_by_exact_path)
*
* Note that you can pass `HttpServerBuilder` or a `HttpServer` to `EndpointServerBuilder`
* to use that builder instead or `HttpServer` instead of the default.
*
* #### EndpointServerBuilder integration
* ```java
*
* //Like before
* vertxHttpServerBuilder = VertxHttpServerBuilder.vertxHttpServerBuilder()
* .setVertx(vertx).setHttpServer(httpServer).setRouter(router);
* //Now just inject it into the vertxHttpServerBuilder before you call build
* HttpServer httpServer = vertxHttpServerBuilder.build();
* endpointServerBuilder.setHttpServer(httpServer);
* ```
*
* If you are using QBit REST with Vertx, that is one integration point.
*
* Also note that you can pass `HttpServerBuilder` or a `HttpServer` to `ManagedServiceBuilder`
* to use that builder instead or `HttpServer` instead of the default.
*
* #### ManagedServiceBuilder integration
* ```java
* //Like before
* vertxHttpServerBuilder = VertxHttpServerBuilder.vertxHttpServerBuilder()
* .setVertx(vertx).setHttpServer(httpServer).setRouter(router);
*
* //Now just inject it into the vertxHttpServerBuilder before you call build
* HttpServer httpServer = vertxHttpServerBuilder.build();
* managedServiceBuilder.setHttpServer(httpServer);
* ```
*
* If you wanted to use QBit REST and QBit Swagger support with Vertx then you
* would want to use `ManagedServiceBuilder` with this class.
*
* Read Vertx guide on routing for more details
* [Vertx Http Ext Manual](http://vertx.io/docs/vertx-web/java/#_routing_by_exact_path)
*
* @author rhightower
*/
Expand Down

0 comments on commit 0218dbe

Please sign in to comment.