- All Superinterfaces:
ServerLifecycle
,Supplier<HttpFeature>
- All Known Subinterfaces:
FeatureSupport
- All Known Implementing Classes:
AccessLogRoutingFeature
,DisabledObserverFeature
,HelidonFeatureSupport
,MicrometerFeature
,OidcFeature
,PrometheusSupport
,SecurityHttpFeature
Can be registered with
HttpRouting.Builder.addFeature(java.util.function.Supplier)
.
Encapsulates a set of endpoints, services and/or filters.
Feature is similar to HttpService
but gives more freedom in setup.
Main difference is that a feature can add Filters
and it cannot be
registered on a path (that is left to the discretion of the feature developer).
Features are not registered immediately - each feature can define a Weight
or implement
Weighted
to order features according to their weight. Higher weighted features are registered first.
This is to allow ordering of features in a meaningful way (e.g. Context should be first, Tracing second, Security third etc.).
-
Method Summary
Modifier and TypeMethodDescriptiondefault HttpFeature
get()
void
setup
(HttpRouting.Builder routing) Method to set up a feature.default String
socket()
Name of the listener socket this feature should be registered on, for automatically discovered features.default boolean
Whether the socket defined insocket()
must be present for this feature, or it can be exposed on default socket.Methods inherited from interface io.helidon.webserver.ServerLifecycle
afterStop, beforeStart
-
Method Details
-
get
- Specified by:
get
in interfaceSupplier<HttpFeature>
-
setup
Method to set up a feature.- Parameters:
routing
- routing builder
-
socket
Name of the listener socket this feature should be registered on, for automatically discovered features.- Returns:
- name of the listener this service should be bound to
-
socketRequired
default boolean socketRequired()Whether the socket defined insocket()
must be present for this feature, or it can be exposed on default socket.- Returns:
true
if this feature must be exposed on the named socket,false
by default
-