public static class GroovyEngine.EngineClassLoader
extends GroovyClassLoader
Custom class loader for dynamically loaded Groovy classes. Extends GroovyClassLoader with cache purging capabilities.
| Fields inherited from class | Fields |
|---|---|
class GroovyClassLoader |
classCache, sourceCache |
| Constructor and description |
|---|
EngineClassLoader()Constructs a new EngineClassLoader. |
EngineClassLoader(CompilerConfiguration configuration)Constructs an EngineClassLoader with the given compiler configuration and the current thread's context class loader as parent. |
EngineClassLoader(ClassLoader parent)Constructs an EngineClassLoader with the given parent class loader and CompilerConfiguration.DEFAULT. |
EngineClassLoader(ClassLoader parent, CompilerConfiguration configuration)Constructs an EngineClassLoader with the given parent class loader and compiler configuration. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Package[] |
getPackages()Returns all packages loaded by this class loader. |
|
public void |
purgeClassCache(String regex)Purges cached classes matching the given regex pattern. |
|
public void |
purgeClassCache()Purges all dynamically generated script classes from the cache. |
| Methods inherited from class | Name |
|---|---|
class 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 |
Constructs a new EngineClassLoader.
Constructs an EngineClassLoader with the given compiler configuration and the current thread's context class loader as parent.
configuration - compiler configuration, or null for the defaultConstructs an EngineClassLoader with the given parent class loader and CompilerConfiguration.DEFAULT. Use EngineClassLoader(ClassLoader, CompilerConfiguration) to supply an engine's configuration, so that the engine adopts this loader rather than wrapping it.
parent - the parent class loaderConstructs an EngineClassLoader with the given parent class loader and compiler configuration.
parent - the parent class loaderconfiguration - compiler configuration, or null for the defaultReturns all packages loaded by this class loader.
Purges cached classes matching the given regex pattern.
regex - the pattern to match class namesPurges all dynamically generated script classes from the cache.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.