Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package pkg; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextStartedEvent; /** * * @author ICBC */ public class ContextStartEventHandler implements ApplicationListener<ContextStartedEvent> { // if a bean implements the ApplicationListener, // every time an ApplicationEvent gets published // to the ApplicationContext, // that bean is notified. public void onApplicationEvent(ContextStartedEvent event) { System.out.println("ContextStartedEvent Received"); } }