java.lang.Object
io.helidon.webserver.observe.ObserveFeature
- All Implemented Interfaces:
RuntimeType.Api<ObserveFeatureConfig>
,NamedService
,Weighted
,ServerFeature
,Comparable<Weighted>
public class ObserveFeature
extends Object
implements ServerFeature, Weighted, RuntimeType.Api<ObserveFeatureConfig>
Support for all observe providers that are available (or configured).
-
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 ObserveFeatureConfig.Builder
builder()
A new builder to customize observe support.static ObserveFeature
create()
Create a new support with default configuration and a list of providers discovered byServiceLoader
.static ObserveFeature
Create a new support with custom configuration.static ObserveFeature
create
(ObserveFeatureConfig config) Create a new observe feature based on its configuration.static ObserveFeature
Create a new support with default configuration and an explicit list of observers.static ObserveFeature
create
(Consumer<ObserveFeatureConfig.Builder> consumer) Create a new observe feature customizing its configuration.static ObserveFeature
Create a new support with default configuration and an explicit list of observers.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).
-
Method Details
-
builder
A new builder to customize observe support.- Returns:
- a new builder
-
create
Create a new observe feature customizing its configuration.- Parameters:
consumer
- configuration consumer- Returns:
- a new observe feature
-
create
Create a new observe feature based on its configuration.- Parameters:
config
- configuration- Returns:
- a new observe feature
-
just
Create a new support with default configuration and an explicit list of observers. This will NOT use providers discovered byServiceLoader
.- Parameters:
observers
- observer to use- Returns:
- a new observe support
-
create
Create a new support with default configuration and an explicit list of observers. This will use providers discovered byServiceLoader
.- Parameters:
observers
- observer to use- Returns:
- a new observe support
-
create
Create a new support with default configuration and a list of providers discovered byServiceLoader
.- Returns:
- a new observe support
-
create
Create a new support with custom configuration.- Parameters:
config
- configuration to read observe config from- Returns:
- a new observe support
-
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<ObserveFeatureConfig>
- Returns:
- prototype object used to create this instance
-
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
-
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
-
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
.
-