see #15229 - move Main* termination methods to lifecycle SPI + new class MainTermination
Main*
MainTermination