main library JetLeaf
π JetLeaf Framework
The main entry point for the JetLeaf ecosystem. This library aggregates the core modules, utilities, and packages required to bootstrap and run a JetLeaf application. It provides access to context management, configuration, logging, environment handling, dependency injection, type conversion, interception, messaging, and shutdown handling.
π Key Features
- Application Bootstrapping:
JetLeafApplicationandJetApplicationmanage lifecycle, startup, and shutdown. - Context Management: Core and bootstrap contexts with factories, environment parsing, and property sources.
- Dependency Injection: Pod factories, post-processors, and type filtering.
- Logging & Monitoring: Logging listeners, startup logging, and configurable logging properties.
- Exception Handling: Application-level exception handlers and reporters.
- Environment & Configuration: Parsing and management of environment properties, Dart config files, and runtime listeners.
- Lifecycle & Listeners: Run listeners and lifecycle management hooks.
- Shutdown Handling: Hooks and handlers for graceful application shutdown.
- Messaging & Interception: Core interceptable mechanisms and message sources.
- Conversion Utilities: Integration with JetLeaf Convert for type conversions.
π― Intended Usage
import 'package:jetleaf/jetleaf.dart';
void main(List<String> args) {
JetApplication.run(Application(), args);
}
This provides a unified entry point to all essential JetLeaf features, making it easy to build, configure, and run modular Dart applications.
Classes
- ApplicationContextFactory
- A factory for creating JetLeaf application context and environment instances.
- ApplicationExceptionHandler
- A global, thread-safe handler for uncaught exceptions in JetLeaf applications.
- ApplicationHook
-
A hook interface for integrating with the lifecycle of a
Application. - ApplicationImportSelector
- π« Default ImportSelector implementation for JetLeaf.
- ApplicationInfoPropertySource
-
A MapPropertySource that exposes JetLeaf application metadata such as
version and process ID (
pid) to the environment system. - ApplicationLoggingListener
- JetLeaf's application-level LoggingListener implementation.
- ApplicationRunListener
- A listener for JetLeaf application lifecycle events during startup.
- ApplicationRunListeners
- Coordinates the execution of multiple ApplicationRunListener instances during the JetLeaf application lifecycle.
- ApplicationRunner
- A runner that receives parsed ApplicationArguments.
- ApplicationShutdownHandler
- Represents a registry of shutdown actions (tasks) that are executed when the application is in the process of shutting down.
- ApplicationShutdownHandlerHook
-
The
ApplicationShutdownHandlerHookis responsible for managing the graceful shutdown of a JetLeaf application, ensuring that all registered ConfigurableApplicationContext instances and shutdown handlers are executed in a predictable and safe order when the Dart process exits or receives a termination signal. - ApplicationTypeFilter
- A Jetleaf-specific TypeFilter implementation that determines whether a given class qualifies as an auto-configuration candidate.
- Banner
- A contract for printing a custom application banner during JetLeaf startup.
- BootstrapContext
- A context used during JetLeaf's bootstrapping phase for accessing and managing lazily-created instances by their reflected Class types.
- BootstrapContextClosedEvent
- An ApplicationEvent published when the BootstrapContext is closed, typically just before or during the early phase of starting a full ConfigurableApplicationContext.
-
BootstrapInstanceSupplier<
T> - A supplier that can create instances based on a BootstrapContext, with optional scoping support.
- BootstrapRegistry
- A registry interface for bootstrapping components during early phases of application startup.
- BootstrapRegistryInitializer
- Strategy interface used to programmatically register bootstrap instances into a BootstrapRegistry before the application context is refreshed.
- CommandLineRunner
- A runner that receives raw command-line arguments.
- ConfigurableBootstrapContext
- A configurable bootstrap context that acts as both a BootstrapRegistry and a BootstrapContext.
- DartConfigParser
- DartConfigParser - improved to accept any constructor/static factory that produces a JetProperty (heuristic-based), not only JetProperty.custom.
- DartEnvironmentParser
- Environment parser for .dart configuration files.
- DefaultApplicationContextFactory
- The default implementation of ApplicationContextFactory in JetLeaf.
- DefaultApplicationHook
- Default implementation of ApplicationHook in JetLeaf.
- DefaultBanner
- A fallback Banner implementation that attempts to load a custom banner from the application environment, but defaults to another banner if none is found.
- DefaultBootstrapContext
- The default implementation of ConfigurableBootstrapContext in JetLeaf.
- DefaultPropertiesPropertySource
- A specialized MapPropertySource representing a default set of properties that can be added to or merged with an existing Environment.
- EnableAutoConfiguration
- Core framework annotations for Jet
- EnvEnvironmentParser
- Environment parser for .env configuration files.
- EnvironmentListener
- A listener that prepares and configures the application environment.
- EnvironmentParser
- Base interface for parsing configuration files into environment data.
- ExceptionHandler
- Responsible for handling exceptions thrown during the application lifecycle (startup or runtime) in JetLeaf applications.
- JetApplication
- Main entry point for JetLeaf framework applications.
- JetLeafApplication
- A meta-annotation in Jetleaf used to bootstrap and configure the root application class.
- JetLeafBanner
- A Banner implementation that displays a simple text-based banner with the JetLeaf logo and version information.
- JetLeafConfigParser
- Parser for JetLeaf configuration files with strict validation.
- JetLeafVersion
- A utility class for retrieving the current version of the JetLeaf framework.
- JetLoggingProperty
- Defines all Jet framework logging-related configuration keys.
- JsonEnvironmentParser
- Environment parser for JSON configuration files.
- LifecycleRunListener
- A reflection-driven JetLeaf ApplicationRunListener that automatically discovers and invokes lifecycle-annotated methods across all loaded types.
- PropertiesEnvironmentParser
- Environment parser for .properties configuration files.
- PropertySourceOrderingPodFactoryPostProcessor
- π Post-processor that reorders property sources for optimal resolution.
- Runner
- Base contract for application runners in JetLeaf.
- StartupLogger
- Logs application startup events in a structured and user-friendly format.
- YamlEnvironmentParser
- Environment parser for YAML configuration files.
Enums
- BannerMode
- An enumeration of possible values for configuring the Banner.
Extensions
-
ThrowingConsumerX
on ThrowingConsumer<
T> - Extension methods for ThrowingConsumer providing safe execution.
Typedefs
-
ThrowingConsumer<
T> = void Function(T value) - A consumer function that can throw exceptions.
Exceptions / Errors
- JetLeafException
- A RuntimeException thrown when the application context is considered "abandoned" during startup or shutdown.