Class PluginClassLoader

    • Constructor Detail

      • PluginClassLoader

        public PluginClassLoader​(URL[] urls,
                                 ClassLoader parent)
        PluginClassLoader is exetend form URLClassLoader , and the constructor has not overide the super constroctor , but has done some stuff to find out jar fils inside /lib director
        Parameters:
        urls - URL
        parent - parent classloader ClassLoader
    • Method Detail

      • findClass

        protected Class findClass​(String name)
                           throws ClassNotFoundException
        Overrides:
        findClass in class URLClassLoader
        Parameters:
        name - String Name of the file to be loaded
        Returns:
        Class return a class object if it found else will return null or a ClassNotFoundException

        This method has been overridden in the following way 1. It calls the super class and checks to see whether the class is there If the class is found then return it, else if super return ClassNotfoundException 2. Check whether the entry corresponding to the class name exists in one of jar files in /lib director 3. If it is there get the byte array out of that and create a Class object out of that by calling "defineClass()" , if it succeeds then return that else 4. Throw a ClassNotFoundException

        Throws:
        ClassNotFoundException