public interface StartupStep
ApplicationStartup
.
The lifecycle of a StartupStep
goes as follows:
the application startup
and is assigned a unique id
.
StartupStep.Tags
during processing
end()
of the step
Implementations can track the "execution time" or other metrics for steps.
Modifier and Type | Interface and Description |
---|---|
static interface |
StartupStep.Tag
Simple key/value association for storing step metadata.
|
static interface |
StartupStep.Tags
Immutable collection of
StartupStep.Tag . |
Modifier and Type | Method and Description |
---|---|
void |
end()
Record the state of the step and possibly other metrics like execution time.
|
long |
getId()
Return the unique id for this step within the application startup.
|
String |
getName()
Return the name of the startup step.
|
Long |
getParentId()
Return, if available, the id of the parent step.
|
StartupStep.Tags |
getTags()
Return the
StartupStep.Tag collection for this step. |
StartupStep |
tag(String key,
String value)
Add a
StartupStep.Tag to the step. |
StartupStep |
tag(String key,
Supplier<String> value)
Add a
StartupStep.Tag to the step. |
String getName()
A step name describes the current action or phase. This technical name should be "." namespaced and can be reused to describe other instances of similar steps during application startup.
long getId()
@Nullable Long getParentId()
The parent step is the step that was started the most recently when the current step was created.
StartupStep tag(String key, String value)
StartupStep.Tag
to the step.key
- tag keyvalue
- tag valueStartupStep tag(String key, Supplier<String> value)
StartupStep.Tag
to the step.key
- tag keyvalue
- Supplier
for the tag valueStartupStep.Tags getTags()
StartupStep.Tag
collection for this step.void end()
Once ended, changes on the step state are not allowed.