Class CurrentBeforeParentClassLoader

  • All Implemented Interfaces:
    Closeable, AutoCloseable
    Direct Known Subclasses:
    ASURLClassLoader

    public class CurrentBeforeParentClassLoader
    extends URLClassLoader
    As the name suggests, loads classes via current class loader ahead of parent class loader by default, classes are loaded from the parent ClassLoader first, thus this class is needed to allow overriding App Server's Modules / JAR files by placing them into <domain_dir>/lib or EAR lib directory
    Author:
    lprimak
    • Field Detail

      • currentBeforeParentEnabled

        protected boolean currentBeforeParentEnabled
      • PARENT_CLASSLOADER_DELEGATE_PROPERTY

        public static final String PARENT_CLASSLOADER_DELEGATE_PROPERTY
        See Also:
        Constant Field Values
    • Constructor Detail

      • CurrentBeforeParentClassLoader

        public CurrentBeforeParentClassLoader​(URL[] urls,
                                              ClassLoader parent)
      • CurrentBeforeParentClassLoader

        public CurrentBeforeParentClassLoader​(URL[] urls)
    • Method Detail

      • isWhiteListed

        protected boolean isWhiteListed​(String className)
        support for extreme class loading
        Parameters:
        className -
        Returns:
        true if white-listed
      • isWhitelistEnabled

        protected boolean isWhitelistEnabled()
        Returns:
        true if extreme classloading is enabled
      • enableCurrentBeforeParent

        public final void enableCurrentBeforeParent()
        enable current-first behavior conditional upon PARENT_CLASSLOADER_DELEGATE_PROPERTY system property being turned on
      • enableCurrentBeforeParentUnconditional

        public final void enableCurrentBeforeParentUnconditional()
        enable current-first behavior unconditionally, regardless of system property used by application configuration parser, so if application developer uses the config xml element, they presumably want the behavior regardless of the system property settings
      • disableCurrentBeforeParent

        public final void disableCurrentBeforeParent()
        disable functionality