ApplicationModule class abstract interface

An interface in Jetleaf that defines a configurable application module.

Application modules encapsulate a set of services, listeners, and processors that can be registered with an ApplicationContext. This provides a modular and extensible way to assemble applications.

Responsibilities

  • Encapsulate related services and components.
  • Register beans/pods, event listeners, and lifecycle processors.
  • Keep application configuration modular and reusable.

Usage

Implementations of ApplicationModule should override configure and register their required components into the provided ApplicationContext.

Example

class SecurityModule implements ApplicationModule {
  @override
  void configure(ApplicationContext context) {
    // Register core services
    context.getPodFactory().registerSingleton('authService', AuthService());

    // Register event listeners
    context.getPodFactory().registerSingleton(
      'securityListener',
      SecurityEventListener(),
    );

    // Register lifecycle processors
    context.addLifecycleProcessor(SecurityLifecycleProcessor());
  }
}

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

configure(ApplicationContext context) → void
Configure the module with the given ApplicationContext.
equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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