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 UnprocessedChangeEventschanged(PropertyChangeEvent[] events)Notification that @Configured objects that were injected have changedvoidcollect(fish.payara.monitoring.collect.MonitoringDataCollector collector)voidcollect(fish.payara.monitoring.collect.MonitoringWatchCollector collector)voidevent(EventListener.Event<?> event)Process a Glassfish/Payara eventbooleanisEnabled()booleanisSecurityEnabled()voidperformHealthChecks(jakarta.servlet.http.HttpServletResponse response, HealthCheckType type, String enablePrettyPrint)Execute the call method of every registered HealthCheck and generate the response.voidpostConstruct()voidregisterClassLoader(String appName, ClassLoader classloader)Register a ClassLoader for an application.voidregisterHealthCheck(String healthCheckName, org.eclipse.microprofile.health.HealthCheck healthCheck, HealthCheckType type)Register a HealthCheck to the Set of HealthChecks to execute when performHealthChecks is called.voidunregisterHealthCheck(String appName)
-
-
-
Method Detail
-
postConstruct
@PostConstruct public void postConstruct()
-
collect
public void collect(fish.payara.monitoring.collect.MonitoringDataCollector collector)
- Specified by:
collectin interfacefish.payara.monitoring.collect.MonitoringDataSource
-
collect
public void collect(fish.payara.monitoring.collect.MonitoringWatchCollector collector)
- Specified by:
collectin interfacefish.payara.monitoring.collect.MonitoringWatchSource
-
event
public void event(EventListener.Event<?> event)
Description copied from interface:EventListenerProcess a Glassfish/Payara event- Specified by:
eventin 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 IOExceptionExecute 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:ConfigListenerNotification that @Configured objects that were injected have changed- Specified by:
changedin interfaceConfigListener- Parameters:
events- list of changes- Returns:
- the list of unprocessed events (requiring a restart) or null if all reconfiguration was processed successfully
-
-