Class JRubyClassLoader

All Implemented Interfaces:
Closeable, AutoCloseable, ClassDefiningClassLoader
Direct Known Subclasses:
SelfFirstJRubyClassLoader

public class JRubyClassLoader extends ClassDefiningJRubyClassLoader
this classloader will be populated dynamically in the following ways:
  • JRuby.runtime.jruby_class_loader.add_url( java.net.URL.new( "file:my.jar" )
  • $CLASSPATH << 'path/to/class/or/resources'
  • require 'some.jar'
  • load 'some.jar'
  • so it is the classloader for ALL the jars used by gems. and this classlaoder is "implicit" part of the $LOAD_PATH of the jruby runtime all ruby resources inside any of the added jars will be found via require and load
    • Field Details

      • LOG

        private static final Logger LOG
      • unloader

        private Runnable unloader
      • tempDir

        private static volatile File tempDir
      • cachedJarPaths

        private final Map<String,URL> cachedJarPaths
      • TEMP_DIR_PREFIX

        private static final String TEMP_DIR_PREFIX
        See Also:
      • tempDirName

        private static String tempDirName
    • Constructor Details

      • JRubyClassLoader

        public JRubyClassLoader(ClassLoader parent)
    • Method Details

      • addURL

        public void addURL(URL url)
        Overrides:
        addURL in class URLClassLoader
      • getTempDir

        private static File getTempDir()
      • tempDirName

        private static String tempDirName()
      • tempDir

        private static String tempDir()
      • close

        public void close()
        Called when the parent runtime is torn down.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Overrides:
        close in class URLClassLoader
      • terminateJarIndexCacheEntries

        protected void terminateJarIndexCacheEntries()
      • getJDBCDriverUnloader

        @Deprecated public Runnable getJDBCDriverUnloader()
        Deprecated.