Class PluginClassLoader

java.lang.Object
java.lang.ClassLoader
ucar.unidata.util.PluginClassLoader

public class PluginClassLoader extends ClassLoader
Class PluginClassLoader. Loads plugin classes
Version:
$Revision: 1.54 $
Author:
IDV Development Team
  • Field Details

  • Constructor Details

    • PluginClassLoader

      public PluginClassLoader(String jarFilePath, ClassLoader parent) throws IOException
      ctor
      Parameters:
      jarFilePath - Where the jar file is
      parent - parent
      Throws:
      IOException - On badness
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • handleError

      protected void handleError(String msg, Throwable exc)
    • closeJar

      public void closeJar()
      Close the jar file
    • getEntryNames

      public List getEntryNames()
      Get the list of (String) names of the non-class files in the jar
      Returns:
      List of jar entries
    • checkClass

      protected void checkClass(Class c) throws Exception
      Throws:
      Exception
    • loadClass

      public Class loadClass(String name) throws ClassNotFoundException
      Overwrite base class method to load in a class by name
      Overrides:
      loadClass in class ClassLoader
      Parameters:
      name - class name
      Returns:
      The class
      Throws:
      ClassNotFoundException - On badness
    • getClassFromPlugin

      public Class getClassFromPlugin(String name)
      Check if this class is one we loaded from a plugin
      Returns:
      the class or null
    • defineResource

      protected String defineResource(JarEntry jarEntry)
      Associate the resource name with the jar entry
      Parameters:
      jarEntry - THe entry
    • getResource

      public URL getResource(String resource)
      Open the resource as a URL
      Overrides:
      getResource in class ClassLoader
      Parameters:
      resource - The resource
      Returns:
      The URL
    • getResourceAsStream

      public InputStream getResourceAsStream(String resource)
      Open the resource as a istream if we have it
      Overrides:
      getResourceAsStream in class ClassLoader
      Parameters:
      resource - The resource
      Returns:
      The istream