java.lang.Object
io.helidon.webserver.RequestScopeFeature
- All Implemented Interfaces:
io.helidon.common.config.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 RequestScopeFeatureCreate a request scope feature for Helidon declarative.name()voidsetup(ServerFeature.ServerFeatureContext featureContext) Set up a server feature.type()
-
Method Details
-
create
public static RequestScopeFeature create(Supplier<io.helidon.service.registry.Scopes> scopes, boolean enabled) 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:ServerFeatureSet 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:
setupin interfaceServerFeature- Parameters:
featureContext- to access builders of webserver, listeners, and routing
-
name
- Specified by:
namein interfaceio.helidon.common.config.NamedService
-
type
- Specified by:
typein interfaceio.helidon.common.config.NamedService
-