Package org.apache.groovy.groovysh.jline

# Class GroovyEngine.EngineClassLoader

java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
groovy.lang.GroovyClassLoader
org.apache.groovy.groovysh.jline.GroovyEngine.EngineClassLoader

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Enclosing class:
  GroovyEngine

public static class GroovyEngine.EngineClassLoader extends GroovyClassLoader
Custom class loader for dynamically loaded Groovy classes. Extends GroovyClassLoader with cache purging capabilities.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class groovy.lang.GroovyClassLoader

  `GroovyClassLoader.ClassCollector, GroovyClassLoader.InnerLoader`

- ## Field Summary

  ### Fields inherited from class groovy.lang.GroovyClassLoader

  `classCache, sourceCache`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EngineClassLoader()`
  Constructs a new EngineClassLoader.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Package[]`
  `getPackages()`
  Returns all packages loaded by this class loader.
  `void`
  `purgeClassCache()`
  Purges all dynamically generated script classes from the cache.
  `void`
  `purgeClassCache(String regex)`
  Purges cached classes matching the given regex pattern.

  ### Methods inherited from class groovy.lang.GroovyClassLoader

  `addClasspath, addURL, clearCache, close, createCollector, createCompilationUnit, defineClass, defineClass, genEncodingString, generateScriptName, getClassCacheEntry, getClassPath, getLoadedClasses, getPermissions, getResourceLoader, getTimeStamp, hasCompatibleConfiguration, isRecompilable, isShouldRecompile, isSourceNewer, loadClass, loadClass, loadClass, loadClass, parseClass, parseClass, parseClass, parseClass, parseClass, parseClass, recompile, removeClassCacheEntry, setClassCacheEntry, setResourceLoader, setShouldRecompile`

  ### Methods inherited from class java.net.URLClassLoader

  `definePackage, findClass, findResource, findResources, 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, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, 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 Details

  - ### EngineClassLoader

    public EngineClassLoader()
    Constructs a new EngineClassLoader.

- ## Method Details

  - ### getPackages

    public Package[] getPackages()
    Returns all packages loaded by this class loader.
    Overrides:
      `getPackages` in class `ClassLoader`
    Returns:
      array of packages

  - ### purgeClassCache

    public void purgeClassCache(String regex)
    Purges cached classes matching the given regex pattern.
    Parameters:
      `regex` - the pattern to match class names

  - ### purgeClassCache

    public void purgeClassCache()
    Purges all dynamically generated script classes from the cache.