|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader java.security.SecureClassLoader java.net.URLClassLoader groovy.lang.GroovyClassLoader info.magnolia.module.groovy.support.classes.MgnlGroovyClassLoader
public final class MgnlGroovyClassLoader
Magnolia class loader which extends GroovyClassLoader
and internally uses
MgnlGroovyResourceLoader
.
isSourceNewer(URL, Class)
,
MgnlGroovyClassLoader.AddDefaultImportOperation
,
MgnlGroovyClassLoader.PackageAndClassNameConsistencyOperation
Nested Class Summary |
---|
Nested classes/interfaces inherited from class groovy.lang.GroovyClassLoader |
---|
groovy.lang.GroovyClassLoader.ClassCollector, groovy.lang.GroovyClassLoader.InnerLoader |
Field Summary |
---|
Fields inherited from class groovy.lang.GroovyClassLoader |
---|
classCache, sourceCache |
Constructor Summary | |
---|---|
MgnlGroovyClassLoader(HierarchyManagerProvider hmp)
|
Method Summary | |
---|---|
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. |
void |
verify(String source,
boolean enforceCompileChecks,
String mgnlPath)
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. |
Methods inherited from class groovy.lang.GroovyClassLoader |
---|
addClasspath, addURL, clearCache, createCollector, defineClass, defineClass, defineClass, defineClass, expandClassPath, generateScriptName, getClassCacheEntry, getClassPath, getLoadedClasses, getPermissions, getResourceLoader, getTimeStamp, isRecompilable, isShouldRecompile, loadClass, loadClass, loadClass, parseClass, parseClass, parseClass, parseClass, parseClass, parseClass, parseClass, recompile, removeClassCacheEntry, setClassCacheEntry, setResourceLoader, setShouldRecompile |
Methods inherited from class java.net.URLClassLoader |
---|
definePackage, findClass, findResource, findResources, getURLs, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
---|
defineClass, defineClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MgnlGroovyClassLoader(HierarchyManagerProvider hmp)
hmp
- HierarchyManagerProvider
- it must not be nullMethod Detail |
---|
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 mgnlPath) throws org.codehaus.groovy.control.CompilationFailedException
CompilationFailedException
in case of compilation failure.
For the applied constraints, see PackageAndClassNameConsistencyOperation
source
- - String the Groovy sourceenforceCompileChecks
- - boolean if true
enforce additional compile time checksmgnlPath
- - 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |