Depending on which vendor virtual machine you are using, you can do this using JNDI or a vendor-specific API (in this case, Sun / Oracle). Check out this post that describes both.
I'm currently looking for a way to do the same on OpenJDK and post details if I find anything.
EDIT: It seems that classes are also available on OpenJDK, interesting ...
source
share