public interface LoadingStatusProvider
Common interface for components that provide health status information.
This interface unifies health checking across different JWT validation components by providing a consistent way to check component health and retrieve detailed status information.
Implementation requirements:
- Implementations must be thread-safe for concurrent access
getLoaderStatus()must be non-blocking and return immediately- Status checks must NOT trigger I/O operations or network requests
Usage example:
LoadingStatusProvider provider = someComponent;
LoaderStatus status = provider.getLoaderStatus();
if (status == LoaderStatus.OK) {
// Component is healthy and ready to use
} else if (status == LoaderStatus.ERROR) {
// Handle error state
} else {
// Handle undefined state
}
- Since:
- 1.0
- Author:
- Oliver Wolff
-
Method Summary
Modifier and TypeMethodDescriptionGets the current status of the loading operation without blocking.default booleanConvenience method to check if the loader status is OK.
-
Method Details
-
getLoaderStatus
Gets the current status of the loading operation without blocking.This method must be non-blocking and return immediately with the current cached status. It must NOT trigger any I/O operations, network requests, or other potentially blocking operations.
The returned status values:
LoaderStatus.OK- Component is operational and healthyLoaderStatus.ERROR- Component encountered an errorLoaderStatus.LOADING- Component is in the process of loading or initializingLoaderStatus.UNDEFINED- Initial state, not yet initialized
Implementation requirements:
- Must be thread-safe for concurrent calls
- Must return immediately without blocking
- Must NOT perform any I/O operations or network requests
- Should return the current cached status from memory
- Required for MicroProfile Health compliance for readiness checks
- In exceptional cases, may return UNDEFINED rather than throwing
- Returns:
- the current status of the loading operation from cache/memory, never
null
-
isLoaderStatusOK
Convenience method to check if the loader status is OK.This method provides a simplified way to check if the component is healthy without directly comparing the status enum.
- Returns:
trueif the component status isLoaderStatus.OK,falseotherwise
-