// Path: xm-lep-api/src/main/java/com/icthh/xm/lep/api/ContextsHolder.java
// public interface ContextsHolder {
// 
//     /**
//      * Return context instance by scope name.
//      *
//      * @param scope context scope name, this name is unique across all
//      *              scopes in one {@link ContextsHolder} instance
//      * @return context instance
//      * @see ContextScopes
//      */
//     ScopedContext getContext(String scope);
// 
// }
// 
// Path: xm-lep-api/src/main/java/com/icthh/xm/lep/api/LepManagerService.java
// public interface LepManagerService extends ContextsHolder {
// 
//     ExtensionService getExtensionService();
// 
//     LepResourceService getResourceService();
// 
// }


import com.icthh.xm.lep.api.ContextsHolder;
import com.icthh.xm.lep.api.LepManagerService;
import groovy.util.GroovyScriptEngine;
import groovy.util.ResourceConnector;
import java.util.Objects;
        GroovyScriptEngine engine = this.groovyScriptEngine;
        if (engine == null) {
            synchronized (this) {
                engine = this.groovyScriptEngine;
                if (engine == null) {
                    this.groovyScriptEngine = engine = buildGroovyScriptEngine(managerService);
                }
            }
        }

        return engine;
    }

    private GroovyScriptEngine buildGroovyScriptEngine(LepManagerService managerService) {
        final ClassLoader parentClassLoader = getParentClassLoader();
        final ResourceConnector rc = buildResourceConnector(managerService);

        GroovyScriptEngine engine = (parentClassLoader == null)
            ? new GroovyScriptEngine(rc)
            : new GroovyScriptEngine(rc, parentClassLoader);

        initGroovyScriptEngine(engine, managerService);
        return engine;
    }

    protected ClassLoader getParentClassLoader() {
        return null;
    }

    protected void initGroovyScriptEngine(GroovyScriptEngine engine,
// Path: xm-lep-api/src/main/java/com/icthh/xm/lep/api/ContextsHolder.java
// public interface ContextsHolder {
// 
//     /**
//      * Return context instance by scope name.
//      *
//      * @param scope context scope name, this name is unique across all
//      *              scopes in one {@link ContextsHolder} instance
//      * @return context instance
//      * @see ContextScopes
//      */
//     ScopedContext getContext(String scope);
// 
// }
// 
// Path: xm-lep-api/src/main/java/com/icthh/xm/lep/api/LepManagerService.java
// public interface LepManagerService extends ContextsHolder {
// 
//     ExtensionService getExtensionService();
// 
//     LepResourceService getResourceService();
// 
// }


// Path: xm-lep-groovy/src/main/java/com/icthh/xm/lep/groovy/LazyGroovyScriptEngineProviderStrategy.java
import com.icthh.xm.lep.api.ContextsHolder;
import com.icthh.xm.lep.api.LepManagerService;
import groovy.util.GroovyScriptEngine;
import groovy.util.ResourceConnector;
import java.util.Objects;

        GroovyScriptEngine engine = this.groovyScriptEngine;
        if (engine == null) {
            synchronized (this) {
                engine = this.groovyScriptEngine;
                if (engine == null) {
                    this.groovyScriptEngine = engine = buildGroovyScriptEngine(managerService);
                }
            }
        }

        return engine;
    }

    private GroovyScriptEngine buildGroovyScriptEngine(LepManagerService managerService) {
        final ClassLoader parentClassLoader = getParentClassLoader();
        final ResourceConnector rc = buildResourceConnector(managerService);

        GroovyScriptEngine engine = (parentClassLoader == null)
            ? new GroovyScriptEngine(rc)
            : new GroovyScriptEngine(rc, parentClassLoader);

        initGroovyScriptEngine(engine, managerService);
        return engine;
    }

    protected ClassLoader getParentClassLoader() {
        return null;
    }

    protected void initGroovyScriptEngine(GroovyScriptEngine engine,
                                          ContextsHolder contextsHolder) {