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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for convenient way to createJerseySupport. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe request scoped span context qualifier that can be injected into a Jersey resource. -
Method Summary
Modifier and TypeMethodDescriptionstatic JerseySupport.Builderbuilder()CreatesJerseySupportbuilder based on default emptyResourceConfig.static JerseySupport.Builderbuilder(Application application) CreatesJerseySupportbuilder based on a passed application.voidclose()Close this integration with Jersey.static JerseySupportcreate(Application application) CreatesJerseySupportbased on the providedJAX-RS Application.voidupdate(Routing.Rules routingRules) UpdatesRouting.Ruleswithhandlersrepresenting 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:ServiceUpdatesRouting.Ruleswithhandlersrepresenting this service. -
close
public void close()Close this integration with Jersey. Once closed, this instance is no longer usable. -
create
CreatesJerseySupportbased 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
CreatesJerseySupportbuilder based on default emptyResourceConfig.Every component must be registered on this builder by calling any of
registermethods. 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
CreatesJerseySupportbuilder based on a passed application.The application might be extended by calling any of
registermethods. 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
-