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
ConstructorsModifierConstructorDescriptionCreates a new embedded server with a default deployment.protectedVertxEmbeddedServer(org.jboss.resteasy.spi.ResteasyDeployment deployment) Creates a new embedded server with the given deployment. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigurePreRoute(io.vertx.ext.web.Route route) Configures theRoutebefore the RESTEasy handler is installed.org.jboss.resteasy.spi.ResteasyDeploymentvoidstart(jakarta.ws.rs.SeBootstrap.Configuration configuration) voidstop()
-
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 customResteasyDeploymentimplementation.- Parameters:
deployment- the RESTEasy deployment to use
-
-
Method Details
-
start
public void start(jakarta.ws.rs.SeBootstrap.Configuration configuration) - Specified by:
startin interfaceorg.jboss.resteasy.plugins.server.embedded.EmbeddedServer
-
stop
public void stop()- Specified by:
stopin interfaceorg.jboss.resteasy.plugins.server.embedded.EmbeddedServer
-
getDeployment
public org.jboss.resteasy.spi.ResteasyDeployment getDeployment()- Specified by:
getDeploymentin interfaceorg.jboss.resteasy.plugins.server.embedded.EmbeddedServer
-
configurePreRoute
protected void configurePreRoute(io.vertx.ext.web.Route route) Configures theRoutebefore 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
-