Class UndertowJaxrsServer
java.lang.Object
org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer
- All Implemented Interfaces:
EmbeddedJaxrsServer<UndertowJaxrsServer>,EmbeddedServer
@Priority(150)
public class UndertowJaxrsServer
extends Object
implements EmbeddedJaxrsServer<UndertowJaxrsServer>
Wrapper around Undertow to make resteasy deployments easier
Each ResteasyDeployment or jaxrs Application is deployed under its own web deployment (WAR)
You may also deploy after the server has started.
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.undertow.servlet.api.ServletContainerprotected io.undertow.servlet.api.DeploymentManagerprotected final io.undertow.server.handlers.PathHandlerprotected io.undertow.Undertow -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResourcePrefixPath(String path, io.undertow.server.handlers.resource.ResourceHandler handler) Maps a path prefix to a resource handler to allow serving resources other than the JAX-RS endpoints.deploy()deploy(io.undertow.servlet.api.DeploymentInfo builder) Adds an arbitrary web deployment to underlying Undertow server.deploy(jakarta.ws.rs.core.Application application) deploy(ResteasyDeployment resteasyDeployment) deployOldStyle(Class<? extends jakarta.ws.rs.core.Application> application) deployOldStyle(Class<? extends jakarta.ws.rs.core.Application> application, String ctxtPath) Returns the deployment being used for the server.io.undertow.servlet.api.DeploymentManagersetContextParams(Map<String, String> contextParams) setDeployment(ResteasyDeployment deployment) setHostname(String hostname) setInitParams(Map<String, String> initParams) setPort(int port) setRootResourcePath(String rootResourcePath) start()start(io.undertow.Undertow.Builder builder) voidstart(jakarta.ws.rs.SeBootstrap.Configuration configuration) Starts the server synchronously.voidstop()Stops the server.io.undertow.servlet.api.DeploymentInfoundertowDeployment(Class<? extends jakarta.ws.rs.core.Application> application) io.undertow.servlet.api.DeploymentInfoundertowDeployment(ResteasyDeployment resteasyDeployment) io.undertow.servlet.api.DeploymentInfoundertowDeployment(ResteasyDeployment resteasyDeployment, String mappingPrefix) Creates a web deployment for your ResteasyDeployent so you can set up things like security constraints You'd call this method, add your servlet security constraints, then call deploy(DeploymentInfo) Note, only one ResteasyDeployment can be applied per DeploymentInfo ResteasyServlet is mapped to mapping + "/*" Example: DeploymentInfo di = server.undertowDeployment(resteasyDeployment, "rest"); di.setDeploymentName("MyDeployment") di.setContextRoot("root"); server.deploy(di);
-
Field Details
-
root
protected final io.undertow.server.handlers.PathHandler root -
container
protected final io.undertow.servlet.api.ServletContainer container -
server
protected io.undertow.Undertow server -
manager
protected io.undertow.servlet.api.DeploymentManager manager -
contextParams
-
initParams
-
-
Constructor Details
-
UndertowJaxrsServer
public UndertowJaxrsServer()
-
-
Method Details
-
deploy
- Specified by:
deployin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
start
public void start(jakarta.ws.rs.SeBootstrap.Configuration configuration) Description copied from interface:EmbeddedServerStarts the server synchronously.- Specified by:
startin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>- Specified by:
startin interfaceEmbeddedServer- Parameters:
configuration- the configuration used to configure the server
-
start
- Specified by:
startin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
stop
public void stop()Description copied from interface:EmbeddedServerStops the server.- Specified by:
stopin interfaceEmbeddedServer
-
getDeployment
Description copied from interface:EmbeddedServerReturns the deployment being used for the server.- Specified by:
getDeploymentin interfaceEmbeddedServer- Returns:
- the deployment
-
setDeployment
- Specified by:
setDeploymentin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
setPort
- Specified by:
setPortin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
setHostname
- Specified by:
setHostnamein interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
setRootResourcePath
- Specified by:
setRootResourcePathin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
setSecurityDomain
- Specified by:
setSecurityDomainin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
deploy
-
deploy
-
deploy
-
deploy
public UndertowJaxrsServer deploy(Class<? extends jakarta.ws.rs.core.Application> application, String contextPath) -
undertowDeployment
public io.undertow.servlet.api.DeploymentInfo undertowDeployment(ResteasyDeployment resteasyDeployment, String mappingPrefix) Creates a web deployment for your ResteasyDeployent so you can set up things like security constraints You'd call this method, add your servlet security constraints, then call deploy(DeploymentInfo) Note, only one ResteasyDeployment can be applied per DeploymentInfo ResteasyServlet is mapped to mapping + "/*" Example: DeploymentInfo di = server.undertowDeployment(resteasyDeployment, "rest"); di.setDeploymentName("MyDeployment") di.setContextRoot("root"); server.deploy(di);- Parameters:
resteasyDeployment-mappingPrefix- resteasy.servlet.mapping.prefix- Returns:
- must be deployed by calling deploy(DeploymentInfo), also does not set context path or deployment name
-
undertowDeployment
public io.undertow.servlet.api.DeploymentInfo undertowDeployment(ResteasyDeployment resteasyDeployment) -
undertowDeployment
public io.undertow.servlet.api.DeploymentInfo undertowDeployment(Class<? extends jakarta.ws.rs.core.Application> application) -
addResourcePrefixPath
public void addResourcePrefixPath(String path, io.undertow.server.handlers.resource.ResourceHandler handler) Maps a path prefix to a resource handler to allow serving resources other than the JAX-RS endpoints. For example, this can be used for serving static resources like web pages or API documentation that might be deployed with the REST application server.- Parameters:
path-handler-
-
deploy
-
deploy
Adds an arbitrary web deployment to underlying Undertow server. This is for your own deployments- Parameters:
builder-- Returns:
-
start
-
getManager
public io.undertow.servlet.api.DeploymentManager getManager() -
getContextParams
-
setContextParams
-
getInitParams
-
setInitParams
-
deployOldStyle
public UndertowJaxrsServer deployOldStyle(Class<? extends jakarta.ws.rs.core.Application> application) -
deployOldStyle
public UndertowJaxrsServer deployOldStyle(Class<? extends jakarta.ws.rs.core.Application> application, String ctxtPath)
-