Package net.cnri.util.javascript.nashorn
Class JavaScriptEnvironment
- java.lang.Object
-
- net.cnri.util.javascript.nashorn.JavaScriptEnvironment
-
public class JavaScriptEnvironment extends java.lang.ObjectA provider ofJavaScriptRunnerobjects. This implementation uses a single pool of global objects which are re-used, so assumes that non-concurrent pollution of the global environment is not an issue.
-
-
Constructor Summary
Constructors Constructor Description JavaScriptEnvironment(RequireLookup requireLookup)JavaScriptEnvironment(RequireLookup requireLookup, java.lang.ClassLoader classLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()Clears the cache of compiled scripts, as well as the global pool to eliminate each module cache.JavaScriptRunnergetRunner(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler, java.lang.Object logger)ScriptEngineAndCompilationCachegetScriptEngineAndCompilationCache()voidrecycle(JavaScriptRunner runner)voidrecycleDiscardingScriptContext(JavaScriptRunner runner)voidsetMaxPoolSize(int maxPoolSize)voidshutdown()voidwarmUp()
-
-
-
Constructor Detail
-
JavaScriptEnvironment
public JavaScriptEnvironment(RequireLookup requireLookup)
-
JavaScriptEnvironment
public JavaScriptEnvironment(RequireLookup requireLookup, java.lang.ClassLoader classLoader)
-
-
Method Detail
-
getScriptEngineAndCompilationCache
public ScriptEngineAndCompilationCache getScriptEngineAndCompilationCache()
-
setMaxPoolSize
public void setMaxPoolSize(int maxPoolSize)
-
clearCache
public void clearCache()
Clears the cache of compiled scripts, as well as the global pool to eliminate each module cache.
-
getRunner
public JavaScriptRunner getRunner(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler, java.lang.Object logger)
-
recycle
public void recycle(JavaScriptRunner runner)
-
recycleDiscardingScriptContext
public void recycleDiscardingScriptContext(JavaScriptRunner runner)
-
warmUp
public void warmUp()
-
shutdown
public void shutdown()
-
-