Package org.glassfish.jersey.test
Class DeploymentContext.Builder
- java.lang.Object
-
- org.glassfish.jersey.test.DeploymentContext.Builder
-
- Direct Known Subclasses:
ServletDeploymentContext.Builder
- Enclosing class:
- DeploymentContext
public static class DeploymentContext.Builder extends Object
Deployment context builder for building a basic application deployment context for the JAX-RS / Jersey application defined by the associatedApplication
class or instance.If properties of the builder are not modified, default values will be utilized:
- Default value for the context path is an empty string
After
build()
has been invoked, the state of the builder will be reset to default values and another context for the associated JAX-RS / Jersey application can be prepared and built.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
Create new deployment context builder instance not explicitly bound to the JAX-RS / Jersey application class.protected
Builder(Application app)
Create new deployment context builder instance and bind it to the JAX-RS / Jersey application instance.protected
Builder(Class<? extends Application> appClass)
Create new deployment context builder instance and bind it to the JAX-RS / Jersey application class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeploymentContext
build()
Build a new application deployment context configured by the current state of this application deployment context builder.DeploymentContext.Builder
contextPath(String contextPath)
Set the application deployment context path.protected void
reset()
Reset the application deployment context builder values to defaults.DeploymentContext.Builder
ssl(SSLContext sslContext, SSLParameters sslParameters)
Set the application ssl properties.
-
-
-
Constructor Detail
-
Builder
protected Builder()
Create new deployment context builder instance not explicitly bound to the JAX-RS / Jersey application class.The constructor is provided to support different subclass initialization scenarios.
-
Builder
protected Builder(Application app)
Create new deployment context builder instance and bind it to the JAX-RS / Jersey application instance.- Parameters:
app
- JAX-RS / Jersey application instance.
-
Builder
protected Builder(Class<? extends Application> appClass)
Create new deployment context builder instance and bind it to the JAX-RS / Jersey application class.- Parameters:
appClass
- JAX-RS / Jersey application class.
-
-
Method Detail
-
contextPath
public DeploymentContext.Builder contextPath(String contextPath)
Set the application deployment context path.- Parameters:
contextPath
- application context path.- Returns:
- this application deployment context builder.
- Throws:
NullPointerException
- ifcontextPath
isnull
.
-
ssl
public DeploymentContext.Builder ssl(SSLContext sslContext, SSLParameters sslParameters)
Set the application ssl properties.- Parameters:
sslContext
- application ssl context.sslParameters
- application ssl parameters- Returns:
- this application deployment context builder.
- Throws:
NullPointerException
- ifsslContext
isnull
.
-
build
public DeploymentContext build()
Build a new application deployment context configured by the current state of this application deployment context builder.- Returns:
- this application deployment context builder.
-
reset
protected void reset()
Reset the application deployment context builder values to defaults. Note that the builder still remains bound to the same JAX-RS / Jersey application instance.
-
-