Class UndertowJaxrsServer
- java.lang.Object
-
- org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer
-
- All Implemented Interfaces:
EmbeddedJaxrsServer<UndertowJaxrsServer>
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
Fields Modifier and Type Field Description protected io.undertow.servlet.api.ServletContainercontainerprotected Map<String,String>contextParamsprotected Map<String,String>initParamsprotected io.undertow.servlet.api.DeploymentManagermanagerprotected io.undertow.server.handlers.PathHandlerrootprotected io.undertow.Undertowserver
-
Constructor Summary
Constructors Constructor Description UndertowJaxrsServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResourcePrefixPath(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.UndertowJaxrsServerdeploy()UndertowJaxrsServerdeploy(io.undertow.servlet.api.DeploymentInfo builder)Adds an arbitrary web deployment to underlying Undertow server.UndertowJaxrsServerdeploy(Class<? extends javax.ws.rs.core.Application> application)UndertowJaxrsServerdeploy(Class<? extends javax.ws.rs.core.Application> application, String contextPath)UndertowJaxrsServerdeploy(javax.ws.rs.core.Application application)UndertowJaxrsServerdeploy(javax.ws.rs.core.Application application, String contextPath)UndertowJaxrsServerdeploy(ResteasyDeployment resteasyDeployment)UndertowJaxrsServerdeployOldStyle(Class<? extends javax.ws.rs.core.Application> application)UndertowJaxrsServerdeployOldStyle(Class<? extends javax.ws.rs.core.Application> application, String ctxtPath)Map<String,String>getContextParams()ResteasyDeploymentgetDeployment()Map<String,String>getInitParams()io.undertow.servlet.api.DeploymentManagergetManager()UndertowJaxrsServersetContextParams(Map<String,String> contextParams)UndertowJaxrsServersetDeployment(ResteasyDeployment deployment)UndertowJaxrsServersetHostname(String hostname)UndertowJaxrsServersetInitParams(Map<String,String> initParams)UndertowJaxrsServersetPort(int port)UndertowJaxrsServersetRootResourcePath(String rootResourcePath)UndertowJaxrsServersetSecurityDomain(SecurityDomain sc)UndertowJaxrsServerstart()UndertowJaxrsServerstart(io.undertow.Undertow.Builder builder)voidstop()io.undertow.servlet.api.DeploymentInfoundertowDeployment(Class<? extends javax.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);
-
-
-
Method Detail
-
deploy
public UndertowJaxrsServer deploy()
- Specified by:
deployin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
start
public UndertowJaxrsServer start()
- Specified by:
startin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
stop
public void stop()
- Specified by:
stopin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
getDeployment
public ResteasyDeployment getDeployment()
- Specified by:
getDeploymentin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
setDeployment
public UndertowJaxrsServer setDeployment(ResteasyDeployment deployment)
- Specified by:
setDeploymentin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
setPort
public UndertowJaxrsServer setPort(int port)
- Specified by:
setPortin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
setHostname
public UndertowJaxrsServer setHostname(String hostname)
- Specified by:
setHostnamein interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
setRootResourcePath
public UndertowJaxrsServer setRootResourcePath(String rootResourcePath)
- Specified by:
setRootResourcePathin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
setSecurityDomain
public UndertowJaxrsServer setSecurityDomain(SecurityDomain sc)
- Specified by:
setSecurityDomainin interfaceEmbeddedJaxrsServer<UndertowJaxrsServer>
-
deploy
public UndertowJaxrsServer deploy(javax.ws.rs.core.Application application)
-
deploy
public UndertowJaxrsServer deploy(javax.ws.rs.core.Application application, String contextPath)
-
deploy
public UndertowJaxrsServer deploy(Class<? extends javax.ws.rs.core.Application> application)
-
deploy
public UndertowJaxrsServer deploy(Class<? extends javax.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 javax.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
public UndertowJaxrsServer deploy(ResteasyDeployment resteasyDeployment)
-
deploy
public UndertowJaxrsServer deploy(io.undertow.servlet.api.DeploymentInfo builder)
Adds an arbitrary web deployment to underlying Undertow server. This is for your own deployments- Parameters:
builder-- Returns:
-
start
public UndertowJaxrsServer start(io.undertow.Undertow.Builder builder)
-
getManager
public io.undertow.servlet.api.DeploymentManager getManager()
-
setContextParams
public UndertowJaxrsServer setContextParams(Map<String,String> contextParams)
-
setInitParams
public UndertowJaxrsServer setInitParams(Map<String,String> initParams)
-
deployOldStyle
public UndertowJaxrsServer deployOldStyle(Class<? extends javax.ws.rs.core.Application> application)
-
deployOldStyle
public UndertowJaxrsServer deployOldStyle(Class<? extends javax.ws.rs.core.Application> application, String ctxtPath)
-
-