Class JDK12Hooks

java.lang.Object
org.apache.commons.discovery.jdk.JDKHooks
org.apache.commons.discovery.jdk.JDK12Hooks

public class JDK12Hooks extends JDKHooks
JDK 1.2 Style Hooks implementation.
  • Field Details

    • log

      private static org.apache.commons.logging.Log log
      Logger
    • systemClassLoader

      private static final ClassLoader systemClassLoader
  • Constructor Details

    • JDK12Hooks

      public JDK12Hooks()
  • Method Details

    • setLog

      @Deprecated public static void setLog(org.apache.commons.logging.Log _log)
      Deprecated.
      This method is not thread-safe
      Sets the Log for this class.
      Parameters:
      _log - This class Log
    • getSystemProperty

      public String getSystemProperty(String propName)
      Get the system property
      Specified by:
      getSystemProperty in class JDKHooks
      Parameters:
      propName - name of the property
      Returns:
      value of the property
    • getThreadContextClassLoader

      public ClassLoader getThreadContextClassLoader()
      The thread context class loader is available for JDK 1.2 or later, if certain security conditions are met.
      Specified by:
      getThreadContextClassLoader in class JDKHooks
      Returns:
      The thread context class loader, if available. Otherwise return null.
    • getSystemClassLoader

      public ClassLoader getSystemClassLoader()
      The system class loader is available for JDK 1.2 or later, if certain security conditions are met.
      Specified by:
      getSystemClassLoader in class JDKHooks
      Returns:
      The system class loader, if available. Otherwise return null.
    • getResources

      public Enumeration<URL> getResources(ClassLoader loader, String resourceName) throws IOException
      Resolve resource with given names and make them available in the returned iterator.
      Specified by:
      getResources in class JDKHooks
      Parameters:
      loader - The class loader used to resolve resources
      resourceName - The resource name to resolve
      Returns:
      The iterator over the URL resolved resources
      Throws:
      IOException - if any error occurs while loading the resource
    • getResourcesFromUrl

      private static Enumeration<URL> getResourcesFromUrl(URL first, Enumeration<URL> rest)
      Enumerates resources URL.
      Parameters:
      first - The first URL in the enumeration sequence
      rest - The URL enumeration
      Returns:
      A new resources URL enumeration
    • findSystemClassLoader

      private static ClassLoader findSystemClassLoader()
      Find the System ClassLoader.
      Returns:
      The System ClassLoader