# setApplicationStartup abstract method

void setApplicationStartup(

1. ApplicationStartup applicationStartup

)

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();
    }

Set the ApplicationStartup strategy to use for this component.

This method is typically called during application context initialization, so that all startup-aware components share the same ApplicationStartup instance provided by the framework.

### Example

    component.setApplicationStartup(DefaultApplicationStartup());

## Implementation

    void setApplicationStartup(ApplicationStartup applicationStartup);