Class SystemdProperties
java.lang.Object
com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties
- All Implemented Interfaces:
InitializingBean
@ConfigurationProperties(prefix="systemd")
public class SystemdProperties
extends Object
implements InitializingBean
Properties of the integration with systemd when using Spring Boot, all under
systemd.
systemd.ready-event, when systemd is told that the application is ready;systemd.status-update-period, how often the status is sent to systemd;systemd.watchdog-suppress-warning, whether to log the warnings about the health signalled to the systemd watchdog;systemd.status-providers.<key>.*, each built-inStatusProvider: whether it is enabled, all of them by default except for theGarbageCollectionStatusProviderand theCpuStatusProvider, which are opted into, to keep the status short, and the other settings of those that can be configured.
Invalid values are rejected when the properties are bound, failing the startup of the application with an
InvalidConfigurationPropertyValueException that names the property.
- Author:
- Joao Silva, Christian Lorenz
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTheActuatorHealthStatusProvider, which provides the application health when using Spring Boot Actuator.static classTheAvailabilityStatusProvider, which provides the liveness and readiness of the application.static classTheFileDescriptorStatusProvider, which provides information regarding the open file descriptors.static classTheHikariStatusProvider, which provides information regarding the HikariCP connection pools.static enumThe event on which systemd is told that the application is ready, withSystemd.ready().static classThe built-in status providers, under their keys: each can be enabled or disabled, and some can be configured further.static classTheThreadStatusProvider, which provides information regarding the live threads, and detects deadlocks.static classEnables or disables one status provider. -
Method Summary
Modifier and TypeMethodDescriptionvoidRejects invalid values, naming the property, rather than failing later, or silently ignoring them.Returns when systemd is told that the application is ready.The settings of the built-in status providers.Returns how often the status is sent to systemd.booleanCheck if the warnings logged when the application health is signalled to the systemd watchdog, but in a way that never suppresses the heartbeat, are suppressed.voidsetReadyEvent(SystemdProperties.ReadyEvent readyEvent) Sets when systemd is told that the application is ready.voidsetStatusUpdatePeriod(Duration statusUpdatePeriod) Sets how often the status is sent to systemd.voidsetWatchdogSuppressWarning(boolean watchdogSuppressWarning) Suppress the warnings logged when the application health is signalled to the systemd watchdog, but in a way that never suppresses the heartbeat.
-
Method Details
-
getReadyEvent
Returns when systemd is told that the application is ready.- Returns:
- the event on which the application is ready
-
setReadyEvent
Sets when systemd is told that the application is ready.- Parameters:
readyEvent- the event on which the application is ready
-
getStatusUpdatePeriod
Returns how often the status is sent to systemd.- Returns:
- the period of the status updates
- See Also:
-
setStatusUpdatePeriod
Sets how often the status is sent to systemd.- Parameters:
statusUpdatePeriod- the period of the status updates
-
isWatchdogSuppressWarning
public boolean isWatchdogSuppressWarning()Check if the warnings logged when the application health is signalled to the systemd watchdog, but in a way that never suppresses the heartbeat, are suppressed.- Returns:
trueif the warnings are suppressed
-
setWatchdogSuppressWarning
public void setWatchdogSuppressWarning(boolean watchdogSuppressWarning) Suppress the warnings logged when the application health is signalled to the systemd watchdog, but in a way that never suppresses the heartbeat.- Parameters:
watchdogSuppressWarning-trueto suppress the warnings
-
getStatusProviders
The settings of the built-in status providers.- Returns:
- the settings of the status providers
-
afterPropertiesSet
public void afterPropertiesSet()Rejects invalid values, naming the property, rather than failing later, or silently ignoring them.- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
InvalidConfigurationPropertyValueException- if any value is invalid
-