public final class MgnlGroovyClassLoader
extends groovy.lang.GroovyClassLoader
GroovyClassLoader
and internally uses MgnlGroovyResourceLoader
.isSourceNewer(URL, Class)
,
MgnlGroovyClassLoader.AddDefaultImportOperation
,
MgnlGroovyClassLoader.PackageAndClassNameConsistencyOperation
Constructor and Description |
---|
MgnlGroovyClassLoader() |
MgnlGroovyClassLoader(info.magnolia.context.Context context)
Deprecated.
since 2.4.4 please use
MgnlGroovyClassLoader() instead. |
MgnlGroovyClassLoader(HierarchyManagerProvider hmp)
Deprecated.
since 2.4.3 please use
MgnlGroovyClassLoader() instead. |
Modifier and Type | Method and Description |
---|---|
protected org.codehaus.groovy.control.CompilationUnit |
createCompilationUnit(org.codehaus.groovy.control.CompilerConfiguration config,
CodeSource codeSource) |
protected boolean |
isSourceNewer(URL source,
Class cls)
Source newer in our case means that the groovy source
representing a certain class in the scripts repository is more recent than that of
the corresponding class currently loaded in this classloader (i.e.
|
static String |
resolveScriptNameFromSource(String source)
Utility method to resolve the script or class name from source.
|
void |
verify(String source,
boolean enforceCompileChecks,
String path)
Checks that the given source compiles correctly and, in case of a script which has to act as a
class, that some consistency constraints imposed by our classloading mechanism are enforced.
|
addClasspath, addURL, clearCache, createCollector, defineClass, defineClass, generateScriptName, getClassCacheEntry, getClassPath, getLoadedClasses, getPermissions, getResourceLoader, getTimeStamp, isRecompilable, isShouldRecompile, loadClass, loadClass, loadClass, loadClass, parseClass, parseClass, parseClass, parseClass, parseClass, parseClass, recompile, removeClassCacheEntry, setClassCacheEntry, setResourceLoader, setShouldRecompile
close, definePackage, findClass, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public MgnlGroovyClassLoader()
@Deprecated public MgnlGroovyClassLoader(info.magnolia.context.Context context)
MgnlGroovyClassLoader()
instead.@Deprecated public MgnlGroovyClassLoader(HierarchyManagerProvider hmp)
MgnlGroovyClassLoader()
instead.protected org.codehaus.groovy.control.CompilationUnit createCompilationUnit(org.codehaus.groovy.control.CompilerConfiguration config, CodeSource codeSource)
createCompilationUnit
in class groovy.lang.GroovyClassLoader
protected boolean isSourceNewer(URL source, Class cls) throws IOException
isSourceNewer
in class groovy.lang.GroovyClassLoader
IOException
public final void verify(String source, boolean enforceCompileChecks, String path) throws org.codehaus.groovy.control.CompilationFailedException
CompilationFailedException
in case of compilation failure.
For the applied constraints, see MgnlGroovyClassLoader.PackageAndClassNameConsistencyOperation
.source
- String the Groovy sourceenforceCompileChecks
- boolean if true
enforce additional compile time checkspath
- String the path to the script in the repository. The substring after the last '/' is assumed to be
the script name itself. Will be ignored if enforceCompileChecks is false
. Cannot be
null
if enforceCompileChecks is true
.org.codehaus.groovy.control.CompilationFailedException
Copyright © 2017 Magnolia International Ltd.. All rights reserved.