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-in StatusProvider: whether it is enabled, all of them by default except for the GarbageCollectionStatusProvider and the CpuStatusProvider, 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
  • Method Details

    • getReadyEvent

      public SystemdProperties.ReadyEvent getReadyEvent()
      Returns when systemd is told that the application is ready.
      Returns:
      the event on which the application is ready
    • setReadyEvent

      public void setReadyEvent(SystemdProperties.ReadyEvent readyEvent)
      Sets when systemd is told that the application is ready.
      Parameters:
      readyEvent - the event on which the application is ready
    • getStatusUpdatePeriod

      public Duration getStatusUpdatePeriod()
      Returns how often the status is sent to systemd.
      Returns:
      the period of the status updates
      See Also:
    • setStatusUpdatePeriod

      public void setStatusUpdatePeriod(Duration statusUpdatePeriod)
      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:
      true if 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 - true to suppress the warnings
    • getStatusProviders

      public SystemdProperties.StatusProviders 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:
      afterPropertiesSet in interface InitializingBean
      Throws:
      InvalidConfigurationPropertyValueException - if any value is invalid