isClosed method

  1. @override
bool isClosed()
override

Returns whether this application context has been closed.

A closed context has completed its lifecycle and released all resources. Attempting to use a closed context will typically result in exceptions.

Closed Context Behavior:

  • Pod Access: IllegalStateException when retrieving pods
  • Event Publishing: Events may be ignored or cause exceptions
  • Configuration Access: Environment and configuration may be unavailable
  • Resource State: Database connections, thread pools, etc. are closed

Lifecycle:

final context = MyApplicationContext();
print(context.isClosed()); // false

await context.refresh();
print(context.isClosed()); // false

await context.close();
print(context.isClosed()); // true

Implementation

@override
bool isClosed() => _isClosed;