public <T> T execute(final String methodName, final Class<T> clazz, final boolean failOnError,
                         final Object... args) {
        return lock.tryLock(() -> {
            try {
                LOGGER.trace("Beginning to execute script [{}]", this);
                return compiledScript != null
                    ? ScriptingUtils.executeGroovyScript(compiledScript, methodName, args, clazz, failOnError)
                    : null;
            } finally {
                LOGGER.trace("Completed script execution [{}]", this);
            }
        });
    }
Execute.

@param <T>         the type parameter
@param methodName  the method name
@param clazz       the clazz
@param failOnError the fail on error
@param args        the args
@return the t
core/cas-server-core-scripting/src/main/java/org/apereo/cas/util/scripting/WatchableGroovyScriptResource.java