Class VertxEmbeddedServer

java.lang.Object
dev.resteasy.vertx.server.VertxEmbeddedServer
All Implemented Interfaces:
org.jboss.resteasy.plugins.server.embedded.EmbeddedServer

public class VertxEmbeddedServer extends Object implements org.jboss.resteasy.plugins.server.embedded.EmbeddedServer
Embedded server implementation using Vert.x HTTP server with Vert.x Web Router.

This server integrates RESTEasy with Vert.x's async, event-driven HTTP server. It implements the EmbeddedServer interface for SeBootstrap integration.

The server uses a Router for request handling, which enables Vert.x Web middleware (CORS, sessions, authentication, etc.) to be added via a custom RouterFactory.

The server can be configured programmatically via SeBootstrap:

SeBootstrap.start(MyApplication.class, config)
        .thenAccept(instance -> {
            // Server running
        });
Since:
2.0
Author:
James R. Perkins
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Creates a new embedded server with a default deployment.
    protected
    VertxEmbeddedServer(org.jboss.resteasy.spi.ResteasyDeployment deployment)
    Creates a new embedded server with the given deployment.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    configurePreRoute(io.vertx.ext.web.Route route)
    Configures the Route before the RESTEasy handler is installed.
    org.jboss.resteasy.spi.ResteasyDeployment
     
    void
    start(jakarta.ws.rs.SeBootstrap.Configuration configuration)
     
    void
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VertxEmbeddedServer

      public VertxEmbeddedServer()
      Creates a new embedded server with a default deployment.
    • VertxEmbeddedServer

      protected VertxEmbeddedServer(org.jboss.resteasy.spi.ResteasyDeployment deployment)
      Creates a new embedded server with the given deployment. Subclasses can use this to provide a custom ResteasyDeployment implementation.
      Parameters:
      deployment - the RESTEasy deployment to use
  • Method Details

    • start

      public void start(jakarta.ws.rs.SeBootstrap.Configuration configuration)
      Specified by:
      start in interface org.jboss.resteasy.plugins.server.embedded.EmbeddedServer
    • stop

      public void stop()
      Specified by:
      stop in interface org.jboss.resteasy.plugins.server.embedded.EmbeddedServer
    • getDeployment

      public org.jboss.resteasy.spi.ResteasyDeployment getDeployment()
      Specified by:
      getDeployment in interface org.jboss.resteasy.plugins.server.embedded.EmbeddedServer
    • configurePreRoute

      protected void configurePreRoute(io.vertx.ext.web.Route route)
      Configures the Route before the RESTEasy handler is installed. Subclasses can override this to add handlers that run before RESTEasy processes the request.
      Parameters:
      route - the route to configure