Module io.helidon.servicecommon
Class HelidonFeatureSupport
java.lang.Object
io.helidon.webserver.servicecommon.HelidonFeatureSupport
- All Implemented Interfaces:
HttpFeature,ServerLifecycle,FeatureSupport,Supplier<HttpFeature>
- Direct Known Subclasses:
MicrometerFeature,PrometheusSupport
@Deprecated(forRemoval=true,
since="4.4.0")
public abstract class HelidonFeatureSupport
extends Object
implements FeatureSupport
Deprecated, for removal: This API element is subject to removal in a future version.
Common base implementation for service support classes which involve REST endpoints.
This base class takes care of some tasks common to many services, using config and other settings in the builder:
- Setting up the endpoint path (web context) for the service, using settings in the builder and config.
- Providing automatic CORS support (and the ability to control it via config).
Concrete implementations must implement
postSetup(HttpRouting.Builder, HttpRouting.Builder) to do any service-specific routing.
See also the HelidonFeatureSupport.Builder information for possible additional overrides.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelidonFeatureSupport.Builder<B extends HelidonFeatureSupport.Builder<B,T>, T extends HelidonFeatureSupport> Deprecated, for removal: This API element is subject to removal in a future version.Abstract implementation of aBuilderfor the service. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHelidonFeatureSupport(System.Logger logger, HelidonFeatureSupport.Builder<?, ?> builder, String serviceName) Deprecated, for removal: This API element is subject to removal in a future version.Shared initialization for new service support instances.protectedHelidonFeatureSupport(System.Logger logger, RestServiceSettings restServiceSettings, String serviceName) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Web context of this service as configured (may not contain leading slash).context()Deprecated, for removal: This API element is subject to removal in a future version.Web context of this service.protected voidDeprecated, for removal: This API element is subject to removal in a future version.booleanenabled()Deprecated, for removal: This API element is subject to removal in a future version.When a service is not enabled, it can be omitted from registration with server.protected System.Loggerlogger()Deprecated, for removal: This API element is subject to removal in a future version.protected voidpostSetup(HttpRouting.Builder defaultRouting, HttpRouting.Builder featureRouting) Deprecated, for removal: This API element is subject to removal in a future version.This can be used to register services, filters etc.final voidsetup(HttpRouting.Builder defaultRouting, HttpRouting.Builder featureRouting) Deprecated, for removal: This API element is subject to removal in a future version.Configures service endpoint on the provided routing rules.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.webserver.servicecommon.FeatureSupport
service, setupMethods inherited from interface io.helidon.webserver.http.HttpFeature
get, socket, socketRequiredMethods inherited from interface io.helidon.webserver.ServerLifecycle
afterStart, afterStop, beforeStart
-
Constructor Details
-
HelidonFeatureSupport
protected HelidonFeatureSupport(System.Logger logger, HelidonFeatureSupport.Builder<?, ?> builder, String serviceName) Deprecated, for removal: This API element is subject to removal in a future version.Shared initialization for new service support instances.- Parameters:
logger- theLoggerfor the concrete service support instancebuilder- builder for the service support instance.serviceName- name of the service
-
HelidonFeatureSupport
protected HelidonFeatureSupport(System.Logger logger, RestServiceSettings restServiceSettings, String serviceName) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
setup
Deprecated, for removal: This API element is subject to removal in a future version.Configures service endpoint on the provided routing rules. This method just adds the endpoint path (as defaulted or configured). This method is exclusive toFeatureSupport.setup(io.helidon.webserver.http.HttpRouting.Builder)(e.g. you should not use both, as otherwise you would register the endpoint twice)- Specified by:
setupin interfaceFeatureSupport- Parameters:
defaultRouting- default routing rules (also acceptsHttpRouting.BuilderfeatureRouting- actual rules (if different from default) for the service endpoint
-
context
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:FeatureSupportWeb context of this service.- Specified by:
contextin interfaceFeatureSupport- Returns:
- context path to be registered
-
configuredContext
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:FeatureSupportWeb context of this service as configured (may not contain leading slash).- Specified by:
configuredContextin interfaceFeatureSupport- Returns:
- context path exactly as configured
-
enabled
public boolean enabled()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:FeatureSupportWhen a service is not enabled, it can be omitted from registration with server.- Specified by:
enabledin interfaceFeatureSupport- Returns:
truefor enabled services
-
context
Deprecated, for removal: This API element is subject to removal in a future version. -
postSetup
Deprecated, for removal: This API element is subject to removal in a future version.This can be used to register services, filters etc. on either the default rules (usually the main routing of the web server) and the feature routing (may be the same instance). IfFeatureSupport.service()provides an instance, that instance will be correctly registered with the context root on feature routing.- Parameters:
defaultRouting- defaultHttpRulesto be updatedfeatureRouting- actual rules (if different from the default ones) to be updated for the service endpoint
-
logger
Deprecated, for removal: This API element is subject to removal in a future version.
-
cors, or programmatic setup using theio.helidon.webserver.cors.CorsFeatureserver feature; reason for existence of this class was CORS configuration - as this is now not needed, this class will most likely be removed in a future version of Helidon; implement anHttpFeaturedirectly instead