java.lang.Object
io.helidon.webserver.RequestScopeFeature
- All Implemented Interfaces:
NamedService
,ServerFeature
A feature that adds request scope support to Helidon declarative.
This feature is not enabled by default, as request scope adds a certain amount of overhead to performance. It should only be enabled when you want injection of request scoped services outside of entry points. In general, we do not recommend such an approach, as it leaks communication protocol details into your business logic. Nevertheless it is supported, as this approach is sometimes used.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webserver.spi.ServerFeature
ServerFeature.RoutingBuilders, ServerFeature.ServerFeatureContext, ServerFeature.SocketBuilders
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequestScopeFeature
Create a request scope feature for Helidon declarative.name()
Name of this implementation, as provided inConfiguredProvider.create(Config, String)
.void
setup
(ServerFeature.ServerFeatureContext featureContext) Set up a server feature.type()
Type of this implementation, to distinguish instances of same type, with differentNamedService.name()
.
-
Method Details
-
create
Create a request scope feature for Helidon declarative. This feature is not useful when running Helidon imperative.- Parameters:
scopes
- scopes (injected from service registry) to create the request scope when neededenabled
- whether this feature should be enabled- Returns:
- a new request scope feature to be added to the web server
-
setup
Description copied from interface:ServerFeature
Set up a server feature. Server features can modify server configuration, right before the server is created. To access listener configuration, or routing, a list of all listeners is provided.- Specified by:
setup
in interfaceServerFeature
- Parameters:
featureContext
- to access builders of webserver, listeners, and routing
-
name
Description copied from interface:NamedService
Name of this implementation, as provided inConfiguredProvider.create(Config, String)
.- Specified by:
name
in interfaceNamedService
- Returns:
- name of this service
-
type
Description copied from interface:NamedService
Type of this implementation, to distinguish instances of same type, with differentNamedService.name()
. Use for exampleConfiguredProvider.configKey()
to define the type.- Specified by:
type
in interfaceNamedService
- Returns:
- type of this service
-