https://bz.apache.org/bugzilla/show_bug.cgi?id=57681

--- Comment #15 from Huxing Zhang <huxing.zh...@gmail.com> ---
To make StandardClassLoader parallel capable, we can simply add JRECompact to
the Bootstrap class loader's class path, and then apply the static
initialization of WebappClassLoaderBase's to it.
If we don't want to JreCompat to be in the Bootstrap ClassLoader's class path,
I think adding the following code should work for StandardClassLoader:

public class StandardClassLoader {
    ...
    static {
        try {
            // parallel class loading capable
            final Method registerParallel =
                   
ClassLoader.class.getDeclaredMethod("registerAsParallelCapable");
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    registerParallel.setAccessible(true);
                    return null;
                }
            });
            registerParallel.invoke(null);
        } catch (NoSuchMethodException e) {
            // expect java 6 or lower
        } catch (Exception e) {
            // ignore
        }
    }
    ...
}

If there is anything else I can help, please feel free to let me know.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to