java.lang.Object
io.helidon.webserver.jersey.JerseySupport
- All Implemented Interfaces:
Service
The Jersey Support integrates Jersey (JAX-RS RI) into the Web Server.
To enable Jersey for a given path, do
WebServer.create(Routing.builder()
.register("/jersey",
JerseySupport.builder()
.register(JerseyExampleResource.class)
.build())
.build());
In such case the registered JerseySupport
instance gets associated with the Web Server
and handles all requests made to /jersey
context root.
Note that due to a blocking IO approach, each request handling is forwarded to a dedicated thread pool which can be configured by one of the JerseySupport constructor.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder for convenient way to createJerseySupport
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The request scoped span context qualifier that can be injected into a Jersey resource. -
Method Summary
Modifier and TypeMethodDescriptionstatic JerseySupport.Builder
builder()
CreatesJerseySupport
builder based on default emptyResourceConfig
.static JerseySupport.Builder
builder
(Application application) CreatesJerseySupport
builder based on a passed application.void
close()
Close this integration with Jersey.static JerseySupport
create
(Application application) CreatesJerseySupport
based on the providedJAX-RS Application
.void
update
(Routing.Rules routingRules) UpdatesRouting.Rules
withhandlers
representing this service.
-
Field Details
-
REQUEST_SPAN_CONTEXT
The request scoped span context qualifier that can be injected into a Jersey resource.@Inject@Named(JerseySupport.REQUEST_SPAN_CONTEXT) private SpanContext spanContext;
- See Also:
-
-
Method Details
-
update
Description copied from interface:Service
UpdatesRouting.Rules
withhandlers
representing this service. -
close
public void close()Close this integration with Jersey. Once closed, this instance is no longer usable. -
create
CreatesJerseySupport
based on the providedJAX-RS Application
.WebServer.create(Routing.builder() .register("/jersey", JerseySupport.create(new ResourceConfig(JerseyExampleResource.class))) .build());
- Parameters:
application
- the JAX-RS application to create this instance based on- Returns:
- the Jersey Support instance
- See Also:
-
builder
CreatesJerseySupport
builder based on default emptyResourceConfig
.Every component must be registered on this builder by calling any of
register
methods. Properties can be set by the builder methodJerseySupport.Builder.property(String, Object)
.Build WebServer
:WebServer.create(Routing.builder() .register("/jersey", JerseySupport.builder() .register(JerseyExampleResource.class) .build()) .build());
- Returns:
- this
- See Also:
-
builder
CreatesJerseySupport
builder based on a passed application.The application might be extended by calling any of
register
methods. Properties can be set by the application, the builder methodJerseySupport.Builder.property(String, Object)
.Build WebServer
:WebServer.create(Routing.builder() .register("/jersey", JerseySupport.builder() .register(JerseyExampleResource.class) .build()) .build());
- Parameters:
application
- a base application- Returns:
- this
-