Provide a way to determine if a context is in the process of being closed #33058
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
In order to tackle spring-projects/spring-boot#41002, we think we need a way to determine if the application context is in the process of being closed. We cannot use
isActive()
asactive
isn't set tofalse
until close processing has completed. Theclosed
flag inAbstractApplicationContext
looks like it contains the state that we want to be able to see, but there's no accessor for it.It looks like we might be able to listen for a
ContextClosedEvent
and store some state to note that a particular context is in the process of being closed. We'd prefer not to use this approach for a couple of reasons:The text was updated successfully, but these errors were encountered: