Package com.linecorp.armeria.spring
Class AbstractArmeriaAutoConfiguration
java.lang.Object
com.linecorp.armeria.spring.AbstractArmeriaAutoConfiguration
- Direct Known Subclasses:
ArmeriaAutoConfiguration
Abstract class for implementing ArmeriaAutoConfiguration.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionarmeriaServer
(ArmeriaSettings armeriaSettings, InternalServices internalService, Optional<MeterRegistry> meterRegistry, Optional<List<MetricCollectingServiceConfigurator>> metricCollectingServiceConfigurators, Optional<MeterIdPrefixFunction> meterIdPrefixFunction, Optional<List<ArmeriaServerConfigurator>> armeriaServerConfigurators, Optional<List<Consumer<ServerBuilder>>> armeriaServerBuilderConsumers, Optional<List<DependencyInjector>> dependencyInjectors, BeanFactory beanFactory) Creates a startedServer
bean.WrapServer
withSmartLifecycle
.gracefulShutdownServerConfigurator
(String shutdown, Duration duration) A user can configure aServer
by providing anArmeriaServerConfigurator
bean.internalServices
(ArmeriaSettings settings, Optional<MeterRegistry> meterRegistry, Optional<List<HealthChecker>> healthCheckers, Optional<List<HealthCheckServiceConfigurator>> healthCheckServiceConfigurators, Optional<List<DocServiceConfigurator>> docServiceConfigurators, @Nullable Integer managementServerPort, @Nullable InetAddress managementServerAddress, boolean enableManagementServerSsl) Creates internal services that should not be exposed to the external network such asDocService
,PrometheusExpositionService
andHealthCheckService
.
-
Constructor Details
-
AbstractArmeriaAutoConfiguration
public AbstractArmeriaAutoConfiguration()
-
-
Method Details
-
armeriaServer
@Bean @ConditionalOnMissingBean(Server.class) public Server armeriaServer(ArmeriaSettings armeriaSettings, InternalServices internalService, Optional<MeterRegistry> meterRegistry, Optional<List<MetricCollectingServiceConfigurator>> metricCollectingServiceConfigurators, Optional<MeterIdPrefixFunction> meterIdPrefixFunction, Optional<List<ArmeriaServerConfigurator>> armeriaServerConfigurators, Optional<List<Consumer<ServerBuilder>>> armeriaServerBuilderConsumers, Optional<List<DependencyInjector>> dependencyInjectors, BeanFactory beanFactory) Creates a startedServer
bean. -
armeriaServerGracefulShutdownLifecycle
@Bean @ConditionalOnMissingBean(ArmeriaServerSmartLifecycle.class) public SmartLifecycle armeriaServerGracefulShutdownLifecycle(Server server) WrapServer
withSmartLifecycle
. -
internalServices
@Bean public InternalServices internalServices(ArmeriaSettings settings, Optional<MeterRegistry> meterRegistry, Optional<List<HealthChecker>> healthCheckers, Optional<List<HealthCheckServiceConfigurator>> healthCheckServiceConfigurators, Optional<List<DocServiceConfigurator>> docServiceConfigurators, @Value("${management.server.port:#{null}}") @Nullable @Nullable Integer managementServerPort, @Value("${management.server.address:#{null}}") @Nullable @Nullable InetAddress managementServerAddress, @Value("${management.server.ssl.enabled:#{false}}") boolean enableManagementServerSsl) Creates internal services that should not be exposed to the external network such asDocService
,PrometheusExpositionService
andHealthCheckService
.Note that if a service path is either
null
or empty, the associated service will not be initiated. For example,ArmeriaSettings.getHealthCheckPath()
isnull
,HealthCheckService
will not be created automatically. -
gracefulShutdownServerConfigurator
@Bean @ConditionalOnProperty("server.shutdown") public ArmeriaServerConfigurator gracefulShutdownServerConfigurator(@Value("${server.shutdown}") String shutdown, @Value("${spring.lifecycle.timeout-per-shutdown-phase:30s}") Duration duration) A user can configure aServer
by providing anArmeriaServerConfigurator
bean.
-