Pergunta de entrevista da empresa Synechron

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