# JetApplication class final

Main entry point for JetLeaf framework applications.

The JetApplication class provides a convenient way to bootstrap and launch JetLeaf applications from a main() method. It handles application context creation, environment setup, banner display, and application lifecycle management.

### Key Features:

- Application Bootstrapping: Creates and configures the application context
- Environment Setup: Configures property sources and profiles
- Lifecycle Management: Handles startup, shutdown, and event publishing
- Banner Display: Shows application banner during startup
- Exception Handling: Comprehensive exception reporting and handling
- Profile Management: Active profile detection and configuration
- Command Line Support: Command line argument parsing and integration

### Basic Usage:

    void main(List<String> args) {
      JetApplication.run(MyApplication, args);
    }

    @Configuration
    @ComponentScan
    class MyApplication {
      // Application configuration
    }

### Advanced Configuration:

    void main(List<String> args) async {
      final app = JetApplication(MyApplication);

      // Custom configuration
      app.setBannerMode(BannerMode.CONSOLE);
      app.setAdditionalProfiles({'production'});
      app.setAllowCircularReferences(true);

      // Add custom initializers
      app.addInitializer((context) {
        // Custom context initialization
      });

      // Launch application
      final context = await app.create(args, null);
    }

### Application Lifecycle:

1. Detection: Detect runtime environment and application type
2. Bootstrap: Create bootstrap context and register components
3. Environment Setup: Configure property sources and profiles
4. Context Creation: Build and configure application context
5. Refresh: Initialize pods and publish application events
6. Runners: Execute application and command line runners
7. Ready: Application is fully operational

### Property Sources (in order of precedence):

1. Command line arguments (`--name=value`)
2. DVM system properties (`System.getProperty()`)
3. OS environment variables
4. Application-specific property files
5. Default properties

See also:

- ConfigurableApplicationContext for the application context interface
- `ApplicationRunner` for custom application initialization logic
- `CommandLineRunner` for command line specific initialization
- ApplicationEvent for application lifecycle events

## Constructors

JetApplication.new(Object _primarySource)
  Main entry point for JetLeaf framework applications.

## Properties

hashCode → int
  The hash code for this object.
  no setter inherited
runtimeType → Type
  A representation of the runtime type of the object.
  no setter inherited

## Methods

addBootstrapRegistryInitializer(BootstrapRegistryInitializer initializer) → void
  Adds a single bootstrap registry initializer.
addBootstrapRegistryInitializers(List<BootstrapRegistryInitializer> initializers) → void
  Adds multiple bootstrap registry initializers.
addConversionService(bool addConversionService) → void
  Whether a conversion service should be added to the environment.
addExceptionReporter(ExceptionReporter reporter) → void
  Adds an exception reporter to the list of exception reporters.
addExitCodeExceptionHandler(ExitCodeExceptionHandler handler) → void
  Adds an exit code exception handler to the list of exit code exception handlers.
addInitializer(ApplicationContextInitializer<ConfigurableApplicationContext> initializer) → void
  Adds a single application context initializer.
addInitializers(List<ApplicationContextInitializer<ConfigurableApplicationContext>> initializers) → void
  Adds multiple application context initializers.
addListeners(List<ApplicationEventListener<ApplicationEvent>> listeners) → void
  Adds multiple application event listeners.
create(List<String> args, RuntimeProvider? provider) → Future<ConfigurableApplicationContext?>
  Creates and initializes the application context.
getAddCommandLineProperties() → bool
  Gets whether command line property parsing is enabled.
getAddConversionService() → bool
  Gets whether conversion service registration is enabled.
getAdditionalProfiles() → Set<String>
  Gets the additional active profiles.
getAllowCircularReferences() → bool
  Gets whether circular references are allowed.
getAllowPodDefinitionOverriding() → bool
  Gets whether pod definition overriding is allowed.
getApplicationType() → ApplicationType
  Gets the application type.
getBannerMode() → BannerMode
  Gets the banner display mode.
getBootstrapRegistryInitializers() → List<BootstrapRegistryInitializer>
  Gets the bootstrap registry initializers.
getConversionService() → ConfigurableConversionService
  Gets the conversion service.
getDefaultProperties() → Map<String, Object>
  Gets the default properties.
getEnvironmentPrefix() → String
  Gets the environment property prefix.
getExceptionReporters() → List<ExceptionReporter>
  Returns the list of exception reporters.
getExitCodeExceptionHandlers() → List<ExitCodeExceptionHandler>
  Returns the list of exit code exception handlers.
getInitializers() → List<ApplicationContextInitializer<ConfigurableApplicationContext>>
  Gets the application context initializers.
getKeepAlive() → bool
  Gets whether the application should stay alive after startup.
getLazyInitialization() → bool
  Gets whether lazy initialization is enabled.
getListeners() → List<ApplicationEventListener<ApplicationEvent>>
  Gets the application event listeners.
getLoggingListener() → LoggingListener?
  Returns the logging listener.
getLogStartupInfo() → bool
  Gets whether startup information logging is enabled.
getMainClass() → Class<Object>
  Gets the main application class.
getPodNameGenerator() → PodNameGenerator?
  Gets the pod name generator.
getRegisterShutdownHook() → bool
  Gets whether shutdown hook registration is enabled.
getStartup() → ApplicationStartup
  Gets the application startup tracker.
noSuchMethod(Invocation invocation) → dynamic
  Invoked when a nonexistent method or property is accessed.
  inherited
setAddCommandLineProperties(bool addCommandLineProperties) → void
  Sets whether command line property parsing is enabled.
setAdditionalProfiles(Set<String> profiles) → void
  Sets the additional active profiles.
setAllowCircularReferences(bool allowCircularReferences) → void
  Sets whether circular references are allowed.
setAllowPodDefinitionOverriding(bool allowDefinitionOverriding) → void
  Sets whether pod definition overriding is allowed.
setApplicationStartup(ApplicationStartup? applicationStartup) → void
  Sets the application startup tracker.
setApplicationType(ApplicationType webApplicationType) → void
  Sets the application type explicitly.
setBannerMode(BannerMode bannerMode) → void
  Sets the banner display mode.
setBootstrapRegistryInitializers(List<BootstrapRegistryInitializer> initializers) → void
  Sets the bootstrap registry initializers.
setConversionService(ConfigurableConversionService conversionService) → void
  Sets the conversion service.
setDefaultProperties(Map<String, String> defaultProperties) → void
  Sets the default properties.
setEnvironmentPrefix(String environmentPrefix) → void
  Sets the environment property prefix.
setInitializers(List<ApplicationContextInitializer<ConfigurableApplicationContext>> initializers) → void
  Sets the application context initializers.
setKeepAlive(bool keepAlive) → void
  Sets whether the application should stay alive after startup.
setLazyInitialization(bool lazyInitialization) → void
  Sets whether lazy initialization is enabled.
setListeners(List<ApplicationEventListener<ApplicationEvent>> listeners) → void
  Sets the application event listeners.
setLoggingListener(LoggingListener listener) → void
  Adds a logging listener to the list of logging listeners.
setLogStartupInfo(bool logStartupInfo) → void
  Sets whether startup information logging is enabled.
setPodNameGenerator(PodNameGenerator? podNameGenerator) → void
  Sets the pod name generator.
setRegisterShutdownHook(bool registerShutdownHook) → void
  Sets whether shutdown hook registration is enabled.
toString() → String
  A string representation of this object.
  inherited

## Operators

operator ==(Object other) → bool
  The equality operator.
  inherited

## Static Properties

BANNER_LOCATION → String
  Property name used for banner location.
  final
BANNER_TEXT → String
  Property name used for banner text.
  final
JETLEAF_APPLICATION_PID → String
  Property name used to override application PID.
  final
JETLEAF_APPLICATION_TYPE → String
  Property name used to override application type.
  final
JETLEAF_APPLICATION_VERSION → String
  Property name used to override application version.
  final
JETLEAF_VERSION → String
  Property name used to override JetLeaf version.
  final
LAZY_INITIALIZATION → String
  Property name used to override lazy initialization.
  final

## Static Methods

close(ApplicationContext context) → void
  Closes the application context and releases resources.
exit(ApplicationContext context, List<ExitCodeGenerator> exitCodeGenerators) → Future<int>
  Gracefully exits the application with the appropriate exit code.
getShutdownHandler() → ApplicationShutdownHandler
  Gets the global application shutdown handler.
run(Object primarySource, List<String> args, [RuntimeProvider? provider]) → Future<ConfigurableApplicationContext?>
  Convenience method for running an application with a single primary source.
runSources(Object primarySource, List<Object> primarySources, List<String> args, [RuntimeProvider? provider]) → Future<ConfigurableApplicationContext?>
  Convenience method for running an application with multiple primary sources.
useHook(ApplicationHook hook, Runnable action) → void
  Executes an action with a specific application hook.
useThrowableHook<T>(ApplicationHook hook, ThrowingSupplier<T> action) → T
  Executes a throwable action with a specific application hook.