Now I dont want to modify jboss's source code hence I am looking for a way to do this without modifying the jboss libraries. I was going through http://java.dzone.com/articles/jboss-microcontainer-classloading and I feel it is possible to load encrypted classes into jboss by creating custom ClassLoaderPolicy. I tried a lot to do this, but I am not able to get it working.
Imo, this is the right way to do it.
What's the issue -- to not be able to make it work?
Or you can start-up AS with agent, in where you register ClassFileTransformer.
Also, I know I added ClassFileTransformer per ClassLoader, just dunno if this already made it into AS5.1.