We need to introduce new SPI that integrators implement and that will allow us to delegate class creation to them as opposed to current state where we just ask for proper ClassLoader.
Current approach requires us to crack open CL's defineClass() methods which won't really work on JDK 12. Integrators can provide their own privileged CLs which won't have these problems.
The idea is to introduce a new interface WeldClassDefiner (name is just a suggestion) which would have several methods with same signature as seen on CL. Namely we need two variations of defineClass() plus loadClass(). With that in place, ProxyServives could have a getClassDefiner() method returning the implementation. This approach will likely be requires on JDK 12.
On WFLY side, the implementation will leverage ClassDefiner which is part of jboss-modules.