本文整理汇总了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);
}
}
示例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;
}
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例11: requiresScriptedObjectRefresh
import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
@Override
public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource) {
return scriptSource.isModified();
}
示例12: requiresScriptedObjectRefresh
import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
@Override
public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource) {
synchronized (this.scriptClassMonitor) {
return (scriptSource.isModified() || this.wasModifiedForTypeCheck);
}
}
示例13: requiresScriptedObjectRefresh
import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource) {
return scriptSource.isModified();
}
示例14: requiresScriptedObjectRefresh
import org.springframework.scripting.ScriptSource; //导入方法依赖的package包/类
public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource) {
synchronized (this.scriptClassMonitor) {
return (scriptSource.isModified() || this.wasModifiedForTypeCheck);
}
}