mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-11 05:41:52 +01:00
Provide Script Names to Script Engines (#1885)
Signed-off-by: Brian O'Connell <broconne@gmail.com>
This commit is contained in:
parent
b0b6848e04
commit
89796e79c0
@ -56,6 +56,8 @@ import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Deactivate;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
|
||||
/**
|
||||
* The {@link ScriptFileWatcher} watches the jsr223 directory for files. If a new/modified file is detected, the script
|
||||
* is read and passed to the {@link ScriptEngineManager}.
|
||||
@ -209,6 +211,7 @@ public class ScriptFileWatcher extends AbstractWatchService implements ReadyTrac
|
||||
ScriptEngineContainer container = manager.createScriptEngine(scriptType, scriptIdentifier);
|
||||
|
||||
if (container != null) {
|
||||
container.getScriptEngine().put(ScriptEngine.FILENAME, fileName);
|
||||
manager.loadScript(container.getIdentifier(), reader,
|
||||
dependency -> dependencyTracker.addLibForScript(scriptIdentifier, dependency));
|
||||
loaded.add(url);
|
||||
|
Loading…
Reference in New Issue
Block a user