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.
The module does not need any stereotype or configuration annotation, in order to be discovered. The usage of these annotations on the module, is not considered.
Responsibilities
- Encapsulate related services and components.
- Register 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());
}
}
- Mixed-in types
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) → Future< void> - Configure the module with the given ApplicationContext.
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode, andtoString.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