Package net.optionfactory.undertow
Interface Deployment
public interface Deployment
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionio.undertow.servlet.api.DeploymentInfodefault DeploymentenableWebSockets(UnaryOperator<io.undertow.websockets.jsr.WebSocketDeploymentInfo> webSocketConfiguration) Enable WebSocket support.static DeploymentspringSelfContained(Class<? extends org.springframework.web.WebApplicationInitializer>... webAppInitializers) Deployment configuration for a root web application, with resources fetched from the classpath, and initialized by the givenWebApplicationInitializerimplementations.static DeploymentspringWithExternalWebResources(Path localResources, Class<? extends org.springframework.web.WebApplicationInitializer>... webAppInitializers) Deployment configuration for a root web application, with resources fetched from the given path on the local filesystem, and initialized by the givenWebApplicationInitializerimplementations.default DeploymentApplication runs behind a reverse proxy and X-Forwarded-* HTTP headers should be read.default DeploymentwithProperties(Map<String, String> properties) Adds overrides to web application properties.default DeploymentwithProperties(org.springframework.core.env.EnumerablePropertySource propertySource) Adds an additional Spring property source, e.g.
-
Field Details
-
ROOT_PATH
- See Also:
-
-
Method Details
-
configuration
io.undertow.servlet.api.DeploymentInfo configuration() -
springSelfContained
static Deployment springSelfContained(Class<? extends org.springframework.web.WebApplicationInitializer>... webAppInitializers) Deployment configuration for a root web application, with resources fetched from the classpath, and initialized by the givenWebApplicationInitializerimplementations.- Parameters:
webAppInitializers- Spring initialization classes- Returns:
- a deployment configuration with sensible defaults
-
springWithExternalWebResources
static Deployment springWithExternalWebResources(Path localResources, Class<? extends org.springframework.web.WebApplicationInitializer>... webAppInitializers) Deployment configuration for a root web application, with resources fetched from the given path on the local filesystem, and initialized by the givenWebApplicationInitializerimplementations.- Parameters:
localResources- the root path from where the web application resources are fetchedwebAppInitializers- Spring initialization classes- Returns:
- a deployment configuration with sensible defaults
-
useForwardHeaders
Application runs behind a reverse proxy and X-Forwarded-* HTTP headers should be read. It is insecure to run this configuration when not behind a proxy that sets such headers, because a peer address can be forged.- Returns:
- a modified copy of the deployment configuration
-
enableWebSockets
default Deployment enableWebSockets(UnaryOperator<io.undertow.websockets.jsr.WebSocketDeploymentInfo> webSocketConfiguration) Enable WebSocket support. If no custom configuration is needed, the parameter should just be an identity function.- Parameters:
webSocketConfiguration- a function that configures the default WebSocket deployment and returns it- Returns:
- a modified copy of the deployment configuration
-
withProperties
Adds overrides to web application properties.- Parameters:
properties- the overriding properties- Returns:
- a modified copy of the deployment configuration
-
withProperties
default Deployment withProperties(org.springframework.core.env.EnumerablePropertySource propertySource) Adds an additional Spring property source, e.g.SimpleCommandLinePropertySourcefor overriding application properties from the command line.- Parameters:
propertySource- the overriding properties- Returns:
- a modified copy of the deployment configuration
-