Class ApplicationRunStatusProvider
java.lang.Object
com.github.jpmsilva.jsystemd.spring.ApplicationRunStatusProvider
- All Implemented Interfaces:
StatusProvider
Implementation of
StatusProvider that provides information regarding the Spring Boot application startup sequence state. Its state is
meant to be updated by a SpringApplicationRunListener, as the one of the Spring Boot starter does.- Author:
- Joao Silva
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of supported application startup sequence state. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance, which sends the status to systemd on every change of state. -
Method Summary
Modifier and TypeMethodDescriptionvoidUpdates the current application startup sequence state of the application, sending the update to systemd as well.voidstate(ApplicationRunStatusProvider.ApplicationState state, @Nullable Duration timeTaken) Updates the current application startup sequence state of the application, sending the update to systemd as well.status()Exposes status information to send to systemd.
-
Constructor Details
-
ApplicationRunStatusProvider
public ApplicationRunStatusProvider()Creates a new instance, which sends the status to systemd on every change of state.The created instance is not registered as a status provider of
Systemd.instance(): that is up to the caller.
-
-
Method Details
-
status
Description copied from interface:StatusProviderExposes status information to send to systemd.- Specified by:
statusin interfaceStatusProvider- Returns:
- the string message to add to the service status
-
state
Updates the current application startup sequence state of the application, sending the update to systemd as well.- Parameters:
state- the current application startup sequence state
-
state
public void state(ApplicationRunStatusProvider.ApplicationState state, @Nullable Duration timeTaken) Updates the current application startup sequence state of the application, sending the update to systemd as well.- Parameters:
state- the current application startup sequence statetimeTaken- the time taken for the application to reach this state, if known
-