Defines a contract for components that are aware of and can interact with an ApplicationStartup strategy.
An ApplicationStartup provides hooks or strategies to monitor and measure different stages of the application startup lifecycle.
Implementations of ApplicationStartupAware allow the framework (or user code) to inject an ApplicationStartup instance so that components can report or adjust their startup behavior accordingly.
Example
class LoggingStartupAware implements ApplicationStartupAware {
late ApplicationStartup _startup;
@override
ApplicationStartup getApplicationStartup() => _startup;
@override
void setApplicationStartup(ApplicationStartup applicationStartup) {
_startup = applicationStartup;
}
void startComponent() {
final step = _startup.start("Initialize component");
// Perform initialization work...
step.end();
}
}
void main() {
final aware = LoggingStartupAware();
final startup = DefaultApplicationStartup();
aware.setApplicationStartup(startup);
aware.startComponent();
}
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getApplicationStartup(
) → ApplicationStartup - Defines a contract for components that are aware of and can interact with an ApplicationStartup strategy.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setApplicationStartup(
ApplicationStartup applicationStartup) → void - Defines a contract for components that are aware of and can interact with an ApplicationStartup strategy.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited