Package io.helidon.microprofile.server
Class JaxRsApplication.Builder
- java.lang.Object
-
- io.helidon.microprofile.server.JaxRsApplication.Builder
-
- Enclosing class:
- JaxRsApplication
public static class JaxRsApplication.Builder extends Object
Fluent API builder to createJaxRsApplication
instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JaxRsApplication.Builder
application(Class<? extends Application> appClass)
Set the JAX-RS application class that forms this instance.JaxRsApplication.Builder
application(Application app)
Set the JAX-RS application that forms this instance.JaxRsApplication.Builder
applicationClass(Class<? extends Application> applicationClass)
Configure an application class without inspecting it for annotations and without creating a config from it.JaxRsApplication.Builder
appName(String name)
Configure an explicit application name.JaxRsApplication
build()
Create a new instance based on this builder.JaxRsApplication.Builder
config(ResourceConfig config)
Set resource configuration that forms this application.JaxRsApplication.Builder
contextRoot(String contextRoot)
Configure an explicit context root for this application.JaxRsApplication.Builder
executorService(ExecutorService executorService)
Configure an executor service to be used for this application.JaxRsApplication.Builder
routingName(String routingName)
Configure a routing name.JaxRsApplication.Builder
routingNameRequired(boolean routingNameRequired)
In case theJaxRsApplication.routingName()
is configured to a non-default name, you can control with this property whether the name is required (and boot would fail if such a named port is not configured), or default routing is used when the named one is missing.
-
-
-
Method Detail
-
contextRoot
public JaxRsApplication.Builder contextRoot(String contextRoot)
Configure an explicit context root for this application.- Parameters:
contextRoot
- context root to expose this application on, defaults to "/"- Returns:
- updated builder instance
-
config
public JaxRsApplication.Builder config(ResourceConfig config)
Set resource configuration that forms this application. This will replace the current application (if any) with the specified config.- Parameters:
config
- Jersey resource config to use- Returns:
- updated builder instance
- See Also:
application(Application)
,application(Class)
-
application
public JaxRsApplication.Builder application(Application app)
Set the JAX-RS application that forms this instance. This will replace the current application (if any) with the specified application.- Parameters:
app
- JAX-RS application instance- Returns:
- updated builder instance
- See Also:
application(Class)
,config(ResourceConfig)
-
application
public JaxRsApplication.Builder application(Class<? extends Application> appClass)
Set the JAX-RS application class that forms this instance. This will replace the current application (if any) with the specified application.- Parameters:
appClass
- JAX-RS application class- Returns:
- updated builder instance
- See Also:
application(Application)
,config(ResourceConfig)
-
appName
public JaxRsApplication.Builder appName(String name)
Configure an explicit application name.- Parameters:
name
- name to use for this application, mostly for troubleshooting purposes- Returns:
- updated builder instance
-
executorService
public JaxRsApplication.Builder executorService(ExecutorService executorService)
Configure an executor service to be used for this application. Executor services can be shared between applications. If none is defined, server default will be used.- Parameters:
executorService
- executor service to use with this application- Returns:
- updated builder instance
-
routingName
public JaxRsApplication.Builder routingName(String routingName)
Configure a routing name. This tells us this application should bind to a named port of the web server. To reset routing name to default, configure theRoutingName.DEFAULT_NAME
.- Parameters:
routingName
- name to use- Returns:
- updated builder instance
-
routingNameRequired
public JaxRsApplication.Builder routingNameRequired(boolean routingNameRequired)
In case theJaxRsApplication.routingName()
is configured to a non-default name, you can control with this property whether the name is required (and boot would fail if such a named port is not configured), or default routing is used when the named one is missing.- Parameters:
routingNameRequired
- set totrue
if the named routing must be configured on web server, set tofalse
to use default routing if the named routing is missing- Returns:
- updated builder instance
-
build
public JaxRsApplication build()
Create a new instance based on this builder.- Returns:
- application ready to be registered with
Server.Builder.addApplication(JaxRsApplication)
-
applicationClass
public JaxRsApplication.Builder applicationClass(Class<? extends Application> applicationClass)
Configure an application class without inspecting it for annotations and without creating a config from it.- Parameters:
applicationClass
- class to use- Returns:
- updated builer instance
-
-