@Override public void start() throws Exception { // Build the Jax-RS hello world deployment VertxResteasyDeployment deployment = new VertxResteasyDeployment(); deployment.start(); deployment.getRegistry().addPerInstanceResource(HelloWorldService.class); // Start the front end server using the Jax-RS controller vertx.createHttpServer() .requestHandler(new VertxRequestHandler(vertx, deployment)) .listen(8080, ar -> { System.out.println("Server started on port "+ ar.result().actualPort()); }); } }
VertxRequestHandler resteasyRh = new VertxRequestHandler(vertx, deployment); .handler(context -> resteasyRh.handle(new Router2ResteasyRequestAdapter(context)));
deployment.getRegistry().addSingletonResource(new HttpApiRootService()); VertxRequestHandler vertxRequestHandler = new VertxRequestHandler(vertx, deployment); Handler<HttpServerRequest> requestHandler = event -> { log.info("Request {} {}", event.method(), event.path()); vertxRequestHandler.handle(event); };
@Override public void start() throws Exception { // Build the Jax-RS controller deployment VertxResteasyDeployment deployment = new VertxResteasyDeployment(); deployment.start(); deployment.getRegistry().addPerInstanceResource(Controller.class); // Start the front end server using the Jax-RS controller vertx.createHttpServer() .requestHandler(new VertxRequestHandler(vertx, deployment)) .listen(8080, ar -> { System.out.println("Server started on port "+ ar.result().actualPort()); }); } }
server.requestHandler(new VertxRequestHandler(vertx, deployment));
public Handler<HttpServerRequest> createHandler(Vertx vertx) { return new VertxRequestHandler(vertx, deployment, root, domain); } }
@Override public void start(Future<Void> startFuture) throws Exception { Helper helper = deploymentMap.get(config().getString("helper")); server = vertx.createHttpServer(helper.serverOptions); server.requestHandler(new VertxRequestHandler(vertx, helper.deployment, helper.root, helper.domain)); server.listen(ar -> { if (ar.succeeded()) { startFuture.complete(); } else { startFuture.fail(ar.cause()); } }); } }
public Handler<HttpServerRequest> createHandler(Vertx vertx) { return new VertxRequestHandler(vertx, deployment, root, domain); } }
@Override public void start(final Future<Void> startFuture) throws Exception { Helper helper = deploymentMap.get(config().getString("helper")); server = vertx.createHttpServer(helper.serverOptions); server.requestHandler(new VertxRequestHandler(vertx, helper.deployment, helper.root, helper.domain)); server.listen(new Handler<AsyncResult<HttpServer>>() { @Override public void handle(AsyncResult<HttpServer> ar) { if (ar.succeeded()) { startFuture.complete(); } else { startFuture.fail(ar.cause()); } } }); } }
server.requestHandler(new VertxRequestHandler(vertx, deployment));
@Override public void start(Future<Void> startPromise) { VertxResteasyDeployment deployment = new VertxResteasyDeployment(); deployment.start(); deployment.getProviderFactory().registerProvider(DefaultExceptionMapper.class); if (enableRbac) { log.info("Enabling RBAC for REST API"); deployment.getProviderFactory().registerProviderInstance(new AuthInterceptor(authApi, path -> path.startsWith(HttpHealthService.BASE_URI) || path.startsWith(HttpConsoleService.BASE_URI))); } else { log.info("Disabling authentication and authorization for REST API"); deployment.getProviderFactory().registerProviderInstance(new AllowAllAuthInterceptor()); } deployment.getRegistry().addSingletonResource(new HttpHealthService()); deployment.getRegistry().addSingletonResource(new HttpConsoleService(authApi.getNamespace(), addressSpaceApi)); deployment.getRegistry().addSingletonResource(new OSBCatalogService(addressSpaceApi, authApi, schemaProvider)); deployment.getRegistry().addSingletonResource(new OSBProvisioningService(addressSpaceApi, authApi, schemaProvider, consoleProxy)); deployment.getRegistry().addSingletonResource(new OSBBindingService(addressSpaceApi, authApi, schemaProvider, userApi)); deployment.getRegistry().addSingletonResource(new OSBLastOperationService(addressSpaceApi, authApi, schemaProvider)); VertxRequestHandler requestHandler = new VertxRequestHandler(vertx, deployment); httpServer = createServer(requestHandler, startPromise); }