Class EmbeddedServers
- java.lang.Object
-
- org.jboss.resteasy.plugins.server.embedded.EmbeddedServers
-
public class EmbeddedServers extends Object
A utility for interacting with and locating embedded servers.- Author:
- James R. Perkins
-
-
Constructor Summary
Constructors Constructor Description EmbeddedServers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcheckContextPath(String contextPath)Checks the context path and if required creates a new path with a leading/.static StringcheckContextPath(ResteasyDeployment deployment)Checks the context path and if required creates a new path with a leading/.static EmbeddedServerfindServer()Attempts to find the server first via a service loader.static EmbeddedServerfindServer(jakarta.ws.rs.SeBootstrap.Configuration configuration)Attempts to find the server first in the configuration, then via a service loader.static StringresolveContext(Class<?> type)Attempts to resolve theApplicationPathon the type.static StringresolveContext(ResteasyDeployment deployment)Attempts to resolve theApplicationPathon the deployments application.static voidvalidateDeployment(ResteasyDeployment deployment)Validates a deployment is notnulland starts it if required.
-
-
-
Method Detail
-
validateDeployment
public static void validateDeployment(ResteasyDeployment deployment)
Validates a deployment is notnulland starts it if required.- Parameters:
deployment- the deployment to validate
-
resolveContext
public static String resolveContext(ResteasyDeployment deployment)
Attempts to resolve theApplicationPathon the deployments application. If the application is not set or is not annotated,nullis returned.- Parameters:
deployment- the deployment to check- Returns:
- the value of the
ApplicationPathornullif the type is not annotated
-
resolveContext
public static String resolveContext(Class<?> type)
Attempts to resolve theApplicationPathon the type. If the type is not annotated,nullis returned.- Parameters:
type- the type to check- Returns:
- the value of the
ApplicationPathornullif the type is not annotated
-
checkContextPath
public static String checkContextPath(ResteasyDeployment deployment)
Checks the context path and if required creates a new path with a leading/.The deployments application is checked for a
ApplicationPath. If application is not set or is not annotated withApplicationPath, then"/"is returned.- Parameters:
deployment- the deployment to check- Returns:
- the context path with a leading
/if required
-
checkContextPath
public static String checkContextPath(String contextPath)
Checks the context path and if required creates a new path with a leading/.- Parameters:
contextPath- the context path to check- Returns:
- the context path with a leading
/if required
-
findServer
public static EmbeddedServer findServer()
Attempts to find the server first via a service loader.- Returns:
- the embedded server found
-
findServer
public static EmbeddedServer findServer(jakarta.ws.rs.SeBootstrap.Configuration configuration)
Attempts to find the server first in the configuration, then via a service loader.- Parameters:
configuration- the configuration to attempt to locate the server in- Returns:
- the embedded server found
-
-