Class HealthCheckService

  • All Implemented Interfaces:
    fish.payara.monitoring.collect.MonitoringDataSource, EventListener, ConfigListener

    @Service(name="healthcheck-core")
    @RunLevel(10)
    public class HealthCheckService
    extends Object
    implements EventListener, ConfigListener, fish.payara.monitoring.collect.MonitoringDataSource
    Since:
    4.1.1.161
    Author:
    steve
    • Constructor Detail

      • HealthCheckService

        public HealthCheckService()
    • Method Detail

      • collect

        public void collect​(fish.payara.monitoring.collect.MonitoringDataCollector rootCollector)
        Specified by:
        collect in interface fish.payara.monitoring.collect.MonitoringDataSource
      • bootstrapHealthCheck

        public void bootstrapHealthCheck()
        Starts the healthcheck service. This will also bootstrap any relevant notifiers.
      • bootstrapNotifierList

        public void bootstrapNotifierList()
        Starts all notifiers that have been enable with the healthcheck service.
      • isEnabled

        public boolean isEnabled()
        Returns:
        Whether the healthcheck service is enabled
      • setEnabled

        public void setEnabled​(Boolean enabled)
        Sets whether the healthcheck service is enabled.
        Parameters:
        enabled - If this is true, then the healcheck service will be started. If it is already enabled then healthcheck will be restarted.
      • reboot

        public void reboot()
        Restartes the healthcheck service and gets the configuration for it
      • shutdownHealthCheck

        public void shutdownHealthCheck()
        Gracefully shuts down the healthcheck service
      • isHistoricalTraceEnabled

        public boolean isHistoricalTraceEnabled()
        Returns true if historic healthchecks are stored
        Returns:
      • setHistoricalTraceEnabled

        public void setHistoricalTraceEnabled​(boolean historicalTraceEnabled)
        Sets whether historic healthchecks are stored
        Parameters:
        historicalTraceEnabled -
      • getHistoricalTraceStoreSize

        public Integer getHistoricalTraceStoreSize()
        Gets the number of healthchecks to be stored. This may be greater than 0 even if isHistoricalTraceEnabled() returns false as this can be set independently
        Returns:
      • setHistoricalTraceStoreSize

        public void setHistoricalTraceStoreSize​(Integer historicalTraceStoreSize)
        Sets the amount of historic healthchecks to store
        Parameters:
        historicalTraceStoreSize -
      • setHistoricalTraceStoreTimeout

        public void setHistoricalTraceStoreTimeout​(long historicalTraceStoreTimeout)
        Sets the length in seconds to keep historic healthchecks, ones older than this will be discarded.
        Parameters:
        historicalTraceStoreTimeout - if this is > 500 then 500 will be used as the limit.
        See Also:
        NotificationService
      • getEnabledNotifiers

        public Set<String> getEnabledNotifiers()
        Gets a list of all notifiers enabled the healthcheck service.
        Returns:
      • changed

        public UnprocessedChangeEvents changed​(PropertyChangeEvent[] events)
        Description copied from interface: ConfigListener
        Notification that @Configured objects that were injected have changed
        Specified by:
        changed in interface ConfigListener
        Parameters:
        events - list of changes
        Returns:
        the list of unprocessed events (requiring a restart) or null if all reconfiguration was processed successfully