Pregunta de entrevista de Synechron

How to call a function before a Spring boot application finished? Spring boot shutdown callback