public interface ScriptRegistry extends SourceUnitObserver
Modifier and Type | Method and Description |
---|---|
void |
addScriptListener(ScriptName name,
ScriptListener hook) |
void |
deleteScriptListener(ScriptName name,
ScriptListener hook) |
ScriptEngine |
getEngineByName(String shortName)
Looks up and creates a
ScriptEngine for a given name. |
ClassLoader |
getRegistryLevelScriptClassLoader() |
Set<ScriptName> |
listScripts()
Lists all
ScriptName s available in the registry. |
void |
setRegistryLevelScriptClassLoader(ClassLoader registryLevelScriptClassLoader) |
ScriptEntry |
takeScript(JsonValue script)
Takes a
ScriptEntry from this ScriptRegistry . |
ScriptEntry |
takeScript(ScriptName name)
Takes a
ScriptEntry from this ScriptRegistry . |
addSourceUnit, removeSourceUnit
ScriptEngine getEngineByName(String shortName)
ScriptEngine
for a given name. The
algorithm first searches for a ScriptEngineFactory
that has
been registered as a handler for the specified name using the
registerEngineName
method. ScriptEngineFactory
instances stored by the constructor for
one with the specified name. If a ScriptEngineFactory
is
found by either method, it is used to create instance of
ScriptEngine
.shortName
- The short name of the ScriptEngine
implementation. returned by the getNames
method
of its ScriptEngineFactory
.ScriptEngine
created by the factory located in the
search. Returns null if no such factory was found. The
ScriptEngineManager
sets its own
globalScope
Bindings
as the
GLOBAL_SCOPE
Bindings
of the newly
created ScriptEngine
.NullPointerException
- if shortName is null.Set<ScriptName> listScripts()
ScriptName
s available in the registry.ScriptEntry takeScript(JsonValue script) throws ScriptException
ScriptEntry
from this ScriptRegistry
.script
- The identifier of the ScriptEntry
.ScriptEntry
instance.NullPointerException
- if script is null.JsonValueException
IllegalArgumentException
ScriptException
ScriptEntry takeScript(ScriptName name) throws ScriptException
ScriptEntry
from this ScriptRegistry
.name
- The identifier of the ScriptEntry
.ScriptEntry
instance.NullPointerException
- if script is null.ScriptException
void addScriptListener(ScriptName name, ScriptListener hook)
void deleteScriptListener(ScriptName name, ScriptListener hook)
ClassLoader getRegistryLevelScriptClassLoader()
void setRegistryLevelScriptClassLoader(ClassLoader registryLevelScriptClassLoader)
Copyright © 2025 Open Identity Platform Community. All rights reserved.