Yes, getting the class name with an exception is a plausible solution, but I'm looking for something more elegant.
String className = new Exception().getStackTrace()[1].getClassName();
This will be used primarily for logging purposes and to ensure that cache keywords are specific to the component / calling class.
source
share