当前位置: 首页>>代码示例>>Java>>正文


Java ScriptSource.isModified方法代码示例

本文整理汇总了Java中org.springframework.scripting.ScriptSource.isModified方法的典型用法代码示例。如果您正苦于以下问题:Java ScriptSource.isModified方法的具体用法?Java ScriptSource.isModified怎么用?Java ScriptSource.isModified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.scripting.ScriptSource的用法示例。


在下文中一共展示了ScriptSource.isModified方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getScriptedObjectType

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
@Override
public Class<?> getScriptedObjectType(ScriptSource scriptSource)
		throws IOException, ScriptCompilationException {

	try {
		synchronized (this.scriptClassMonitor) {
			if (scriptSource.isModified()) {
				// New script content: Let's check whether it evaluates to a Class.
				this.wasModifiedForTypeCheck = true;
				this.scriptClass = BshScriptUtils.determineBshObjectType(
						scriptSource.getScriptAsString(), this.beanClassLoader);
			}
			return this.scriptClass;
		}
	}
	catch (EvalError ex) {
		throw new ScriptCompilationException(scriptSource, ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:BshScriptFactory.java

示例2: getScriptedObjectType

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
public Class<?> getScriptedObjectType(ScriptSource scriptSource) throws IOException, ScriptCompilationException {

        synchronized (this.scriptClassMonitor) {
            if (this.scriptClass == null || scriptSource.isModified()) {
                this.scriptClass = this.groovyClassLoader.parseClass(scriptSource.getScriptAsString());

                if (Script.class.isAssignableFrom(this.scriptClass)) {
                    // A Groovy script, probably creating an instance: let's execute it.
                    Object result = executeScript(this.scriptClass);
                    this.scriptResultClass = (result != null ? result.getClass() : null);
                } else {
                    this.scriptResultClass = this.scriptClass;
                }
            }
            return this.scriptResultClass;
        }
    }
 
开发者ID:Red5,项目名称:red5-server-scripting,代码行数:18,代码来源:GroovyScriptFactory.java

示例3: getScriptedObjectType

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
@Override
public Class<?> getScriptedObjectType(ScriptSource scriptSource)
		throws IOException, ScriptCompilationException {

	synchronized (this.scriptClassMonitor) {
		try {
			if (scriptSource.isModified()) {
				// New script content: Let's check whether it evaluates to a Class.
				this.wasModifiedForTypeCheck = true;
				this.scriptClass = BshScriptUtils.determineBshObjectType(
						scriptSource.getScriptAsString(), this.beanClassLoader);
			}
			return this.scriptClass;
		}
		catch (EvalError ex) {
			this.scriptClass = null;
			throw new ScriptCompilationException(scriptSource, ex);
		}
	}
}
 
开发者ID:txazo,项目名称:spring,代码行数:21,代码来源:BshScriptFactory.java

示例4: getScriptedObjectType

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
public Class<?> getScriptedObjectType(ScriptSource scriptSource)
		throws IOException, ScriptCompilationException {

	try {
		synchronized (this.scriptClassMonitor) {
			if (scriptSource.isModified()) {
				// New script content: Let's check whether it evaluates to a Class.
				this.wasModifiedForTypeCheck = true;
				this.scriptClass = BshScriptUtils.determineBshObjectType(scriptSource.getScriptAsString());
			}
			return this.scriptClass;
		}
	}
	catch (EvalError ex) {
		throw new ScriptCompilationException(scriptSource, ex);
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:18,代码来源:BshScriptFactory.java

示例5: getScriptedObjectType

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
public Class<?> getScriptedObjectType(ScriptSource scriptSource)
		throws IOException, ScriptCompilationException {

	synchronized (this.scriptClassMonitor) {
		if (this.scriptClass == null || scriptSource.isModified()) {
			this.scriptClass = this.groovyClassLoader.parseClass(scriptSource.getScriptAsString());

			if (Script.class.isAssignableFrom(this.scriptClass)) {
				// A Groovy script, probably creating an instance: let's execute it.
				Object result = executeScript(this.scriptClass);
				this.scriptResultClass = (result != null ? result.getClass() : null);
			}
			else {
				this.scriptResultClass = this.scriptClass;
			}
		}
		return this.scriptResultClass;
	}
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:20,代码来源:GroovyScriptFactory.java

示例6: getScriptedObjectType

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
@Override
public Class<?> getScriptedObjectType(ScriptSource scriptSource)
		throws IOException, ScriptCompilationException {

	try {
		synchronized (this.scriptClassMonitor) {
			if (this.scriptClass == null || scriptSource.isModified()) {
				// New script content...
				this.wasModifiedForTypeCheck = true;
				this.scriptClass = getGroovyClassLoader().parseClass(
						scriptSource.getScriptAsString(), scriptSource.suggestedClassName());

				if (Script.class.isAssignableFrom(this.scriptClass)) {
					// A Groovy script, probably creating an instance: let's execute it.
					Object result = executeScript(scriptSource, this.scriptClass);
					this.scriptResultClass = (result != null ? result.getClass() : null);
					this.cachedResult = new CachedResultHolder(result);
				}
				else {
					this.scriptResultClass = this.scriptClass;
				}
			}
			return this.scriptResultClass;
		}
	}
	catch (CompilationFailedException ex) {
		throw new ScriptCompilationException(scriptSource, ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:GroovyScriptFactory.java

示例7: getScriptedObject

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
/**
 * Loads and parses the Groovy script via the GroovyClassLoader.
 * 
 * @see groovy.lang.GroovyClassLoader
 */
public Object getScriptedObject(ScriptSource scriptSource, Class<?>... actualInterfaces) throws IOException, ScriptCompilationException {

    try {
        Class<?> scriptClassToExecute = null;

        synchronized (this.scriptClassMonitor) {
            if (this.scriptClass == null || scriptSource.isModified()) {
                this.scriptClass = this.groovyClassLoader.parseClass(scriptSource.getScriptAsString());

                if (Script.class.isAssignableFrom(this.scriptClass)) {
                    // A Groovy script, probably creating an instance: let's execute it.
                    Object result = executeScript(this.scriptClass);
                    this.scriptResultClass = (result != null ? result.getClass() : null);
                    return result;
                } else {
                    this.scriptResultClass = this.scriptClass;
                }
            }
            scriptClassToExecute = this.scriptClass;
        }

        // Process re-execution outside of the synchronized block.
        return executeScript(scriptClassToExecute);
    } catch (CompilationFailedException ex) {
        throw new ScriptCompilationException("Could not compile Groovy script: " + scriptSource, ex);
    }
}
 
开发者ID:Red5,项目名称:red5-server-scripting,代码行数:33,代码来源:GroovyScriptFactory.java

示例8: getScriptedObjectType

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
@Override
public Class<?> getScriptedObjectType(ScriptSource scriptSource)
		throws IOException, ScriptCompilationException {

	synchronized (this.scriptClassMonitor) {
		try {
			if (this.scriptClass == null || scriptSource.isModified()) {
				// New script content...
				this.wasModifiedForTypeCheck = true;
				this.scriptClass = getGroovyClassLoader().parseClass(
						scriptSource.getScriptAsString(), scriptSource.suggestedClassName());

				if (Script.class.isAssignableFrom(this.scriptClass)) {
					// A Groovy script, probably creating an instance: let's execute it.
					Object result = executeScript(scriptSource, this.scriptClass);
					this.scriptResultClass = (result != null ? result.getClass() : null);
					this.cachedResult = new CachedResultHolder(result);
				}
				else {
					this.scriptResultClass = this.scriptClass;
				}
			}
			return this.scriptResultClass;
		}
		catch (CompilationFailedException ex) {
			this.scriptClass = null;
			this.scriptResultClass = null;
			this.cachedResult = null;
			throw new ScriptCompilationException(scriptSource, ex);
		}
	}
}
 
开发者ID:txazo,项目名称:spring,代码行数:33,代码来源:GroovyScriptFactory.java

示例9: getScriptedObjectType

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
public Class<?> getScriptedObjectType(ScriptSource scriptSource)
		throws IOException, ScriptCompilationException {

	try {
		synchronized (this.scriptClassMonitor) {
			if (this.scriptClass == null || scriptSource.isModified()) {
				// New script content...
				this.wasModifiedForTypeCheck = true;
				this.scriptClass = getGroovyClassLoader().parseClass(
						scriptSource.getScriptAsString(), scriptSource.suggestedClassName());

				if (Script.class.isAssignableFrom(this.scriptClass)) {
					// A Groovy script, probably creating an instance: let's execute it.
					Object result = executeScript(scriptSource, this.scriptClass);
					this.scriptResultClass = (result != null ? result.getClass() : null);
					this.cachedResult = new CachedResultHolder(result);
				}
				else {
					this.scriptResultClass = this.scriptClass;
				}
			}
			return this.scriptResultClass;
		}
	}
	catch (CompilationFailedException ex) {
		throw new ScriptCompilationException(scriptSource, ex);
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:29,代码来源:GroovyScriptFactory.java

示例10: getScriptedObject

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
/**
 * Loads and parses the Groovy script via the GroovyClassLoader.
 * @see groovy.lang.GroovyClassLoader
 */
@SuppressWarnings({ "rawtypes" })
public Object getScriptedObject(ScriptSource scriptSource, Class[] actualInterfaces)
		throws IOException, ScriptCompilationException {

	try {
		Class<?> scriptClassToExecute = null;

		synchronized (this.scriptClassMonitor) {
			if (this.scriptClass == null || scriptSource.isModified()) {
				this.scriptClass = this.groovyClassLoader.parseClass(scriptSource.getScriptAsString());

				if (Script.class.isAssignableFrom(this.scriptClass)) {
					// A Groovy script, probably creating an instance: let's execute it.
					Object result = executeScript(this.scriptClass);
					this.scriptResultClass = (result != null ? result.getClass() : null);
					return result;
				}
				else {
					this.scriptResultClass = this.scriptClass;
				}
			}
			scriptClassToExecute = this.scriptClass;
		}

		// Process re-execution outside of the synchronized block.
		return executeScript(scriptClassToExecute);
	}
	catch (CompilationFailedException ex) {
		throw new ScriptCompilationException(
				"Could not compile Groovy script: " + scriptSource, ex);
	}
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:37,代码来源:GroovyScriptFactory.java

示例11: requiresScriptedObjectRefresh

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
@Override
public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource) {
	return scriptSource.isModified();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:JRubyScriptFactory.java

示例12: requiresScriptedObjectRefresh

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
@Override
public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource) {
	synchronized (this.scriptClassMonitor) {
		return (scriptSource.isModified() || this.wasModifiedForTypeCheck);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:GroovyScriptFactory.java

示例13: requiresScriptedObjectRefresh

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource) {
	return scriptSource.isModified();
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:4,代码来源:JRubyScriptFactory.java

示例14: requiresScriptedObjectRefresh

import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource) {
	synchronized (this.scriptClassMonitor) {
		return (scriptSource.isModified() || this.wasModifiedForTypeCheck);
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:6,代码来源:GroovyScriptFactory.java


注:本文中的org.springframework.scripting.ScriptSource.isModified方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。