Class JavaSECMPInitializer.TempEntityLoader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    JavaSECMPInitializer

    public static class JavaSECMPInitializer.TempEntityLoader
    extends java.net.URLClassLoader
    This class loader is provided at initialization time to allow us to temporarily load domain classes so we can examine them for annotations. After they are loaded we will throw this class loader away. Transformers can then be registered on the real class loader to allow weaving to occur. It selectively loads classes based on the list of classnames it is instantiated with. Classes not on that list are allowed to be loaded by the parent.
    • Constructor Summary

      Constructors 
      Constructor Description
      TempEntityLoader​(java.net.URL[] urls, java.lang.ClassLoader parent, java.util.Collection classNames)  
      TempEntityLoader​(java.net.URL[] urls, java.lang.ClassLoader parent, java.util.Collection classNames, boolean shouldOverrideLoadClassForCollectionMembers)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Enumeration<java.net.URL> getResources​(java.lang.String name)  
      protected java.lang.Class loadClass​(java.lang.String name, boolean resolve)  
      protected boolean shouldOverrideLoadClass​(java.lang.String name)  
      • Methods inherited from class java.net.URLClassLoader

        addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
      • Methods inherited from class java.security.SecureClassLoader

        defineClass, defineClass
      • Methods inherited from class java.lang.ClassLoader

        clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TempEntityLoader

        public TempEntityLoader​(java.net.URL[] urls,
                                java.lang.ClassLoader parent,
                                java.util.Collection classNames,
                                boolean shouldOverrideLoadClassForCollectionMembers)
      • TempEntityLoader

        public TempEntityLoader​(java.net.URL[] urls,
                                java.lang.ClassLoader parent,
                                java.util.Collection classNames)
    • Method Detail

      • getResources

        public java.util.Enumeration<java.net.URL> getResources​(java.lang.String name)
                                                         throws java.io.IOException
        Overrides:
        getResources in class java.lang.ClassLoader
        Throws:
        java.io.IOException
      • shouldOverrideLoadClass

        protected boolean shouldOverrideLoadClass​(java.lang.String name)
      • loadClass

        protected java.lang.Class loadClass​(java.lang.String name,
                                            boolean resolve)
                                     throws java.lang.ClassNotFoundException
        Overrides:
        loadClass in class java.lang.ClassLoader
        Throws:
        java.lang.ClassNotFoundException