When we start any java app then first all the classes within rt.jar gets loaded & then the app starts working as its been designed for and at the end the ShutDownHook class gets invoked for wrapping up the stuff before we exit. I was wondering is there any way with which we restrict any class within rt.jar from getting loaded so they wont get used on the developed app. One shortcoming i foresee with it is in case wherever that class being used within rt.jar will also gets failed. Is there any other way to achieve this !!
Apart we know that if we enable CDS (class data sharing) on different java apps deployed on same machine will cut down the loading time of all apps & even saves the memory on account that all of them using/sharing the same memory space for loading common startup libraries. Can we include custom class within the CDS territory in order to achieve inter JVM data sharing (I know for inter JVM data sharing there are other options too but would like to explore this option in particular)!!