# JetApplication constructor

JetApplication(

1. Object _primarySource

)

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

Creates a new JetApplication instance with the specified primary source.

`primarySource` the primary source object, typically the main application class `primarySources` additional primary sources for component scanning

Example:

    final app = JetApplication(MyApp);
    // or with additional sources
    final app = JetApplication(MyApp, {Config1, Config2});

## Implementation

    JetApplication(this._primarySource) {
      _applicationContextFactory = DefaultApplicationContextFactory();
      _applicationStartup = DefaultApplicationStartup();
      _applicationHook.set(DefaultApplicationHook([], _applicationStartup));
    }