Class HealthCheckService
- java.lang.Object
-
- fish.payara.microprofile.healthcheck.HealthCheckService
-
- All Implemented Interfaces:
fish.payara.monitoring.collect.MonitoringDataSource
,fish.payara.monitoring.collect.MonitoringWatchSource
,EventListener
,ConfigListener
@Service(name="healthcheck-service") @RunLevel(10) public class HealthCheckService extends Object implements EventListener, ConfigListener, fish.payara.monitoring.collect.MonitoringDataSource, fish.payara.monitoring.collect.MonitoringWatchSource
Service that handles the registration, execution, and response of MicroProfile HealthChecks.- Author:
- Andrew Pielage
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.api.event.EventListener
EventListener.Event<T>
-
-
Constructor Summary
Constructors Constructor Description HealthCheckService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnprocessedChangeEvents
changed(PropertyChangeEvent[] events)
Notification that @Configured objects that were injected have changedvoid
collect(fish.payara.monitoring.collect.MonitoringDataCollector collector)
void
collect(fish.payara.monitoring.collect.MonitoringWatchCollector collector)
void
event(EventListener.Event<?> event)
Process a Glassfish/Payara eventboolean
isEnabled()
boolean
isSecurityEnabled()
void
performHealthChecks(jakarta.servlet.http.HttpServletResponse response, HealthCheckType type, String enablePrettyPrint)
Execute the call method of every registered HealthCheck and generate the response.void
postConstruct()
void
registerClassLoader(String appName, ClassLoader classloader)
Register a ClassLoader for an application.void
registerHealthCheck(String healthCheckName, org.eclipse.microprofile.health.HealthCheck healthCheck, HealthCheckType type)
Register a HealthCheck to the Set of HealthChecks to execute when performHealthChecks is called.void
unregisterHealthCheck(String appName)
-
-
-
Method Detail
-
postConstruct
@PostConstruct public void postConstruct()
-
collect
public void collect(fish.payara.monitoring.collect.MonitoringDataCollector collector)
- Specified by:
collect
in interfacefish.payara.monitoring.collect.MonitoringDataSource
-
collect
public void collect(fish.payara.monitoring.collect.MonitoringWatchCollector collector)
- Specified by:
collect
in interfacefish.payara.monitoring.collect.MonitoringWatchSource
-
event
public void event(EventListener.Event<?> event)
Description copied from interface:EventListener
Process a Glassfish/Payara event- Specified by:
event
in interfaceEventListener
-
isEnabled
public boolean isEnabled()
-
isSecurityEnabled
public boolean isSecurityEnabled()
-
registerHealthCheck
public void registerHealthCheck(String healthCheckName, org.eclipse.microprofile.health.HealthCheck healthCheck, HealthCheckType type)
Register a HealthCheck to the Set of HealthChecks to execute when performHealthChecks is called.- Parameters:
healthCheckName
- The name of the HealthCheckhealthCheck
- The HealthCheck to register
-
unregisterHealthCheck
public void unregisterHealthCheck(String appName)
-
registerClassLoader
public void registerClassLoader(String appName, ClassLoader classloader)
Register a ClassLoader for an application.- Parameters:
appName
- The name of the application being deployedclassloader
-
-
performHealthChecks
public void performHealthChecks(jakarta.servlet.http.HttpServletResponse response, HealthCheckType type, String enablePrettyPrint) throws IOException
Execute the call method of every registered HealthCheck and generate the response.- Parameters:
response
- The response to returntype
- the type of health check- Throws:
IOException
- If there's an issue writing the response
-
changed
public UnprocessedChangeEvents changed(PropertyChangeEvent[] events)
Description copied from interface:ConfigListener
Notification that @Configured objects that were injected have changed- Specified by:
changed
in interfaceConfigListener
- Parameters:
events
- list of changes- Returns:
- the list of unprocessed events (requiring a restart) or null if all reconfiguration was processed successfully
-
-