Issue #30538 introduced a package-private hook mechanism for SpringApplication. We now need to make a version of this API public. Looking again at the implementation, it's quite similar to the existing public SpringApplicationRunListener API so we can probably reuse some of that.