Search in sources :

Example 1 with ContentStoreGroovyResourceLoader

use of org.craftercms.engine.util.groovy.ContentStoreGroovyResourceLoader in project engine by craftercms.

the class GroovyScriptFactoryTest method createGroovyClassLoader.

private GroovyClassLoader createGroovyClassLoader() {
    ContentStoreGroovyResourceLoader resourceLoader = new ContentStoreGroovyResourceLoader(SiteContext.getCurrent(), "/classes");
    GroovyClassLoader classLoader = new GroovyClassLoader(getClass().getClassLoader());
    classLoader.setResourceLoader(resourceLoader);
    return classLoader;
}
Also used : GroovyClassLoader(groovy.lang.GroovyClassLoader) ContentStoreGroovyResourceLoader(org.craftercms.engine.util.groovy.ContentStoreGroovyResourceLoader)

Example 2 with ContentStoreGroovyResourceLoader

use of org.craftercms.engine.util.groovy.ContentStoreGroovyResourceLoader in project engine by craftercms.

the class SiteContextFactory method getClassLoader.

protected URLClassLoader getClassLoader(SiteContext siteContext) {
    ContentStoreGroovyResourceLoader resourceLoader = new ContentStoreGroovyResourceLoader(siteContext, groovyClassesPath);
    GroovyClassLoader classLoader = new GroovyClassLoader(getClass().getClassLoader());
    classLoader.setResourceLoader(resourceLoader);
    return classLoader;
}
Also used : GroovyClassLoader(groovy.lang.GroovyClassLoader) ContentStoreGroovyResourceLoader(org.craftercms.engine.util.groovy.ContentStoreGroovyResourceLoader)

Aggregations

GroovyClassLoader (groovy.lang.GroovyClassLoader)2 ContentStoreGroovyResourceLoader (org.craftercms.engine.util.groovy.ContentStoreGroovyResourceLoader)2