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 create JaxRsApplication instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • 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

      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

      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:
    • 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 the RoutingName.DEFAULT_NAME.
      Parameters:
      routingName - name to use
      Returns:
      updated builder instance
    • routingNameRequired

      public JaxRsApplication.Builder routingNameRequired(boolean routingNameRequired)
      In case the JaxRsApplication.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 to true if the named routing must be configured on web server, set to false 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