
import org.springframework.context.*;
import java.util.*;
public class MyListener implements ApplicationListener
{
public static void main(String[] args) throws Exception
{
long sttime,endtime;
public void onApplicationEvent(ApplicationEvent ae)
{
if(ae.toString().indexOf("ContextRefreshed")!=-1)
{
System.out.println("App ctx started at"+new java.util.Date());
sttime=System.currentTimeMillies();
}//if
if(ae.toString().indexOf("Context stopped")!=-1)
{
System.out.println("App ctx stpped at"+new java.util.Date());
endtime=System.currentTimeMillies();
System.out.println("Appctx is in running mod for"+(endtime-sttime)+"ms");
}//if
}//method
}//main
}//class
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.