ApplicationContextEvent class abstract
A base class for all events that are published within the context of an ApplicationContext.
This class is an extension of ApplicationEvent that ensures the source of the event is always an ApplicationContext. It is intended to be subclassed for specific types of application context lifecycle events such as context refresh, close, or start.
Example:
class ContextRefreshedEvent extends ApplicationContextEvent {
ContextRefreshedEvent(ApplicationContext source) : super(source);
}
void handle(ContextRefreshedEvent event) {
final context = event.getSource();
print("Application context refreshed: $context");
}
This abstraction allows for strongly typed event listeners specific to the lifecycle of the JetLeaf application context.
- Inheritance
-
- Object
- EventObject
- ApplicationEvent
- ApplicationContextEvent
- Implementers
Constructors
- ApplicationContextEvent(ApplicationContext source)
-
A base class for all events that are published within the context of an ApplicationContext.
const
- ApplicationContextEvent.withClock(ApplicationContext source, DateTime clock())
- A base class for all events that are published within the context of an ApplicationContext.
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
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode
, andtoString
.inherited -
getApplicationContext(
) → ApplicationContext - Returns the ApplicationContext that triggered this event.
-
getPackageName(
) → String -
Represents an abstraction for identifying the package that an object,
resource, or service belongs to.
inherited
-
getSource(
) → ApplicationContext -
Returns the ApplicationContext that published this event.
override
-
getTimestamp(
) → DateTime -
Returns the timestamp of the event.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toStringOptions(
) → ToStringOptions -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited