// 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;
package com.icthh.xm.lep.groovy;



/**
 * The {@link LazyGroovyScriptEngineProviderStrategy} class.
 */
public class LazyGroovyScriptEngineProviderStrategy implements GroovyScriptEngineProviderStrategy {

    private final ScriptNameLepResourceKeyMapper resourceKeyMapper;

    private volatile GroovyScriptEngine groovyScriptEngine;

    public LazyGroovyScriptEngineProviderStrategy(ScriptNameLepResourceKeyMapper resourceKeyMapper) {
        this.resourceKeyMapper = Objects.requireNonNull(resourceKeyMapper, "resourceKeyMapper can't be null");
    }

    /**
     * Strategy: build new instance on first call.
     *
     * @param managerService LEP manager service
     * @return GroovyScriptEngine instance
     */
    @Override
// 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;

package com.icthh.xm.lep.groovy;



/**
 * The {@link LazyGroovyScriptEngineProviderStrategy} class.
 */
public class LazyGroovyScriptEngineProviderStrategy implements GroovyScriptEngineProviderStrategy {

    private final ScriptNameLepResourceKeyMapper resourceKeyMapper;

    private volatile GroovyScriptEngine groovyScriptEngine;

    public LazyGroovyScriptEngineProviderStrategy(ScriptNameLepResourceKeyMapper resourceKeyMapper) {
        this.resourceKeyMapper = Objects.requireNonNull(resourceKeyMapper, "resourceKeyMapper can't be null");
    }

    /**
     * Strategy: build new instance on first call.
     *
     * @param managerService LEP manager service
     * @return GroovyScriptEngine instance
     */
    @Override
    public GroovyScriptEngine getEngine(LepManagerService managerService) {