ContextClosedEvent class

Event published when an ApplicationContext is closed.

This indicates that the application context is shutting down, and all managed pods should release resources, stop background tasks, or perform any necessary cleanup before termination.

This event is typically fired at the end of the application lifecycle, right before the context is destroyed.


Example:

class MyShutdownListener implements ApplicationListener<ContextClosedEvent> {
  @override
  void onApplicationEvent(ContextClosedEvent event) {
    print("Shutting down context: ${event.getSource()}");
  }
}

Registered ApplicationEventListeners can listen for this event to trigger disposal or teardown logic.

Inheritance

Constructors

ContextClosedEvent(ApplicationContext source)
Event published when an ApplicationContext is closed.
ContextClosedEvent.withClock(ApplicationContext source, DateTime clock())
Event published when an ApplicationContext is closed.

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, and toString.
inherited
getApplicationContext() ApplicationContext
Returns the ApplicationContext that triggered this event.
inherited
getPackageName() String
Represents an abstraction for identifying the package that an object, resource, or service belongs to.
getSource() ApplicationContext
Returns the ApplicationContext that published this event.
inherited
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