User defined Class Loader - restrict loading classes based on package structure
posted 5 years ago
In our web application, we are having 3 layers (Ex: UI (java only used for rendering) with Controller, Service and DAO) and each layer having difference package structure. we planned to take the packages and classes from each layers into each jar file and distribute into different servers.
But, as of now we are developing with single JDK for all layers and all classes loaded in single JVM only. My need and question is: we need a No Class Definition found exception while UI layer class is constructed in service layer, we should throw No class definition found run time exception.
I feel it is possible by using Class Loders but can any one please help me to understand with some examples.