java.lang.Object
io.helidon.webserver.context.ContextFeature
- All Implemented Interfaces:
RuntimeType.Api<io.helidon.webserver.context.ContextFeatureConfig>,NamedService,ServerFeature
public class ContextFeature
extends Object
implements ServerFeature, RuntimeType.Api<io.helidon.webserver.context.ContextFeatureConfig>
Adds
Context support to Helidon WebServer.
When added to the processing, further processing will be executed in a request specific context.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webserver.spi.ServerFeature
ServerFeature.RoutingBuilders, ServerFeature.ServerFeatureContext, ServerFeature.SocketBuilders -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic io.helidon.webserver.context.ContextFeatureConfig.Builderbuilder()Fluent API builder to set up an instance.static ContextFeaturecreate()Create a new context feature with default setup.static ContextFeatureCreate a new context feature with custom setup.static ContextFeaturecreate(io.helidon.webserver.context.ContextFeatureConfig config) Create a new instance from its configuration.static ContextFeatureCreate a new instance customizing its configuration.name()Name of this implementation, as provided inConfiguredProvider.create(Config, String).io.helidon.webserver.context.ContextFeatureConfigThe prototype as it was received when creating this runtime object instance.voidsetup(ServerFeature.ServerFeatureContext featureContext) Set up a server feature.type()Type of this implementation, to distinguish instances of same type, with differentNamedService.name().
-
Field Details
-
WEIGHT
public static final double WEIGHTDefault weight of the feature. It is quite high, as context is used by a lot of other features.- See Also:
-
-
Method Details
-
builder
public static io.helidon.webserver.context.ContextFeatureConfig.Builder builder()Fluent API builder to set up an instance.- Returns:
- a new builder
-
create
Create a new instance from its configuration.- Parameters:
config- configuration- Returns:
- a new feature
-
create
public static ContextFeature create(Consumer<io.helidon.webserver.context.ContextFeatureConfig.Builder> builderConsumer) Create a new instance customizing its configuration.- Parameters:
builderConsumer- consumer of configuration- Returns:
- a new feature
-
create
Create a new context feature with default setup.- Returns:
- a new feature
-
create
Create a new context feature with custom setup.- Parameters:
config- configuration- Returns:
- a new configured feature
-
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
Description copied from interface:NamedServiceName of this implementation, as provided inConfiguredProvider.create(Config, String).- Specified by:
namein interfaceNamedService- Returns:
- name of this service
-
type
Description copied from interface:NamedServiceType of this implementation, to distinguish instances of same type, with differentNamedService.name(). Use for exampleConfiguredProvider.configKey()to define the type.- Specified by:
typein interfaceNamedService- Returns:
- type of this service
-
prototype
public io.helidon.webserver.context.ContextFeatureConfig prototype()Description copied from interface:RuntimeType.ApiThe prototype as it was received when creating this runtime object instance.- Specified by:
prototypein interfaceRuntimeType.Api<io.helidon.webserver.context.ContextFeatureConfig>- Returns:
- prototype object used to create this instance
-