Class LimitsFeature
java.lang.Object
io.helidon.webserver.concurrency.limits.LimitsFeature
- All Implemented Interfaces:
RuntimeType.Api<LimitsFeatureConfig>
,NamedService
,Weighted
,ServerFeature
,Comparable<Weighted>
public class LimitsFeature
extends Object
implements ServerFeature, Weighted, RuntimeType.Api<LimitsFeatureConfig>
Server feature that adds limits as filters.
When using this feature, the limits operation is enforced within a filter, i.e. after the request is accepted. This means it is used only for HTTP requests.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webserver.spi.ServerFeature
ServerFeature.RoutingBuilders, ServerFeature.ServerFeatureContext, ServerFeature.SocketBuilders
-
Field Summary
Fields inherited from interface io.helidon.common.Weighted
DEFAULT_WEIGHT
-
Method Summary
Modifier and TypeMethodDescriptionstatic LimitsFeatureConfig.Builder
builder()
Fluent API builder to set up an instance.static LimitsFeature
create()
Create a new limits feature with default setup, but enabled.static LimitsFeature
Create a new context feature with custom setup.static LimitsFeature
create
(LimitsFeatureConfig config) Create a new instance from its configuration.static LimitsFeature
create
(Consumer<LimitsFeatureConfig.Builder> builderConsumer) Create a new instance customizing its configuration.name()
Name of this implementation, as provided inConfiguredProvider.create(Config, String)
.The prototype as it was received when creating this runtime object instance.void
setup
(ServerFeature.ServerFeatureContext featureContext) Set up a server feature.type()
Type of this implementation, to distinguish instances of same type, with differentNamedService.name()
.double
weight()
Weight of this class (maybe because it is defined dynamically, so it cannot be defined by an annotation).
-
Field Details
-
WEIGHT
public static final double WEIGHTDefault weight of this feature. It is the first feature to be registered (above context and access log).Context: 1100
Access Log: 1000
This feature: 2000.0
- See Also:
-
-
Method Details
-
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
Create a new instance customizing its configuration.- Parameters:
builderConsumer
- consumer of configuration- Returns:
- a new feature
-
create
Create a new limits feature with default setup, but enabled.- 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: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
-
weight
public double weight()Description copied from interface:Weighted
Weight of this class (maybe because it is defined dynamically, so it cannot be defined by an annotation). If not dynamic, you can use theWeight
annotation rather than implementing this interface as long as it is supported by the library using thisWeighted
. -
prototype
Description copied from interface:RuntimeType.Api
The prototype as it was received when creating this runtime object instance.- Specified by:
prototype
in interfaceRuntimeType.Api<LimitsFeatureConfig>
- Returns:
- prototype object used to create this instance
-