Class ScriptRuntime
java.lang.Object
de.luckymcdev.foundryengine.script.common.runtime.ScriptRuntime
What happens to one bundle while the engine runs. Owns the compiled classes,
the live entrypoint instances, the status and the failures. Nothing here is persisted.
Entrypoint construction, onLoad and onUnload all run under the policy's timeout.
Loading an environment twice is a no-op; use unload() and recompile to reload.
-
Constructor Summary
ConstructorsConstructorDescriptionScriptRuntime(ScriptDefinition definition, SandboxPolicy policy, ScriptErrorReporter reporter) -
Method Summary
Modifier and TypeMethodDescriptionvoidattach(CompiledBundle result) voidfailures()load(ScriptEnv env, Predicate<ScriptSource> enabled) voidvoidrecordCompileCrash(Throwable cause) status()voidunload()Calls onUnload (reverse load order), then drops the classes and closes the class loader.
-
Constructor Details
-
ScriptRuntime
public ScriptRuntime(ScriptDefinition definition, SandboxPolicy policy, ScriptErrorReporter reporter)
-
-
Method Details
-
definition
-
status
-
failures
-
loadedEnvs
-
clearFailures
public void clearFailures() -
markCompiling
public void markCompiling() -
attach
-
recordCompileCrash
-
load
-
unload
public void unload()Calls onUnload (reverse load order), then drops the classes and closes the class loader.
-