How do I keep track when class is loaded and destroyed in jvm? Is there any callback method that is exposed by the jvm?
You can use static block to detect class loading but you can not detect class unloading. In java all classes loaded through the system classloader will never be unloaded and all classes loaded through other classloaders will be unloaded only when the classloader is unloaded.
static{
//execute when the class will be loaded
}