本文整理汇总了Java中javax.script.ScriptEngineFactory.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Java ScriptEngineFactory.getParameter方法的具体用法?Java ScriptEngineFactory.getParameter怎么用?Java ScriptEngineFactory.getParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.script.ScriptEngineFactory
的用法示例。
在下文中一共展示了ScriptEngineFactory.getParameter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSafeMultiThread
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
/**
* Si el scriptEngine es seguro en entornos de multithread
*
* @return
*/
private boolean isSafeMultiThread() {
ScriptEngineFactory scriptEngineFactory = scriptEngine.getFactory();
String threading = (String) scriptEngineFactory.getParameter("THREADING");
if (threading == null) {
return false;
} else if (threading.equals("MULTITHREADED")) {
return true;
} else if (threading.equals("THREAD-ISOLATED")) {
return true;
} else if (threading.equals("STATELESS")) {
return true;
} else {
//No sabemos nada sobre el tipo de multithread.
//debe ser una propiedad nueva de Java.
return false;
}
}
示例2: getAvailableLanguages
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
public static Set<String> getAvailableLanguages(Project project) {
final List<ScriptEngineFactory> engineFactories = new ScriptEngineManager(composeUserClassLoader(project)).getEngineFactories();
if (engineFactories != null) {
final Set<String> availableNames = new TreeSet<String>();
for (ScriptEngineFactory factory : engineFactories) {
final String engineName = (String)factory.getParameter(ScriptEngine.NAME);
availableNames.add(engineName);
}
return availableNames;
}
return null;
}
示例3: getAvailableLanguages
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
private static Set<String> getAvailableLanguages(Project project) {
final List<ScriptEngineFactory> engineFactories = new ScriptEngineManager(composeUserClassLoader(project)).getEngineFactories();
if (engineFactories != null) {
final Set<String> availableNames = new TreeSet<String>();
for (ScriptEngineFactory factory : engineFactories) {
final String engineName = (String)factory.getParameter(ScriptEngine.NAME);
availableNames.add(engineName);
}
return availableNames;
}
return null;
}
示例4: isThreadSafe
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
@Override
public boolean isThreadSafe(String key, ScriptEngine instance) {
final ScriptEngineFactory factory = instance.getFactory();
final Object threadingAbility = factory.getParameter("THREADING");
return threadingAbility != null && ("THREAD-ISOLATED".equals(threadingAbility) || "STATELESS".equals(threadingAbility));
}
示例5: isThreadSafe
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
@Override
public boolean isThreadSafe(Tuple<ScriptEngine, String> key, ScriptEvaluator instance) {
final ScriptEngineFactory factory = key.first.getFactory();
final Object threadingAbility = factory.getParameter("THREADING");
return threadingAbility != null && ("THREAD-ISOLATED".equals(threadingAbility) || "STATELESS".equals(threadingAbility));
}