This moves the locking mechanism added in #4402 to the inheritors of AbstractScriptModuleHandler
to synchronize execution context access as well.
This fixes the problem thathttps://github.com/openhab/openhab-addons/pull/17510 worked around by using Thread.sleep.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
* New translations addons.properties (Hungarian)
* New translations scriptprofile.properties (Hungarian)
* New translations systemprofiles.properties (Hungarian)
* New translations chart.properties (Hungarian)
* New translations voice.properties (Hungarian)
* New translations magic.properties (Hungarian)
* New translations jsr223.properties (Hungarian)
* New translations defaultsystemchannels.properties (Danish)
* Script action: Allow script to be empty
* Short evaluate to reasonable defaults when script is empty
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* Script profile: Separate toHandlerScript for commands and states
This allows much more fine-grained control for the script profile.
E.g. it is now possible to mimic the behaviour of the `system:follow` profile, but apply a script transformation to the forwarded state.
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Abstract classes should not have public constructors.
Constructors of abstract classes can only be called in constructors of their subclasses.
So there is no point in making them public.
The protected modifier should be enough.
Signed-off-by: Wouter Born <github@maindrain.net>
Removes redundant modifiers from the code.
These modifiers redeclare the default modifiers that apply to interfaces, enums etc.
Signed-off-by: Wouter Born <github@maindrain.net>
Using 'UID' is confusing as method parameter because it can be mistaken for some kind of constant while reading code.
Signed-off-by: Wouter Born <github@maindrain.net>
Simplifies the code by using List.of, List.copyOf etc. where possible which results in less code and imports.
Signed-off-by: Wouter Born <github@maindrain.net>
Stream.toList was introduced in Java 16 and creates an unmodifiable List so it can be used to simplify code whenever the List is not expected to be modified.
Signed-off-by: Wouter Born <github@maindrain.net>
Core part of https://github.com/openhab/openhab-webui/issues/1921.
With UI-support for scenes & scripts, the texts (labels, descriptions etc.) for rule-based actions should be updated to mention scenes & scripts as well.
This improves the UI experience.
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* New translations scriptprofile.properties (Hungarian)
* New translations validation.properties (Hungarian)
* New translations automation.properties (Hungarian)
* New translations lsp.properties (German)
* New translations persistence.properties (German)
* New translations audio.properties (Romanian)
* New translations addons.properties (Romanian)
* New translations i18n.properties (Romanian)
* New translations network.properties (Romanian)
* New translations marketplace.properties (Romanian)
* New translations validation.properties (Finnish)
* New translations scriptprofile.properties (French)
* New translations scriptprofile.properties (Slovenian)
* New translations validation.properties (Hebrew)
* New translations validation.properties (Polish)
* New translations validation.properties (Slovenian)
* New translations hli.properties (French)
* New translations hli.properties (Polish)
* New translations automation.properties (Hebrew)
* New translations automation.properties (Polish)
* Add a ScriptEngineFactory bundle tracker
The `ScriptEngingeFactoryBundleTracker` tracks all bundles that provide `ScriptEngineFcatory` capabilities and sets a `ReadyMarker` if all of them are activated.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* Add dynamic scripting language transformation service
This replaced SCRIPT transformation with one specific to each language
e.g. JS, RB, GROOVY, etc.
Co-authored-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
* New translations scriptprofile.properties (Italian)
* New translations messages.properties (German)
* New translations scriptprofile.properties (German)
* New translations scriptprofile.properties (Hebrew)
* New translations scriptprofile.properties (Polish)
* New translations automation.properties (Hebrew)
* New translations validation.properties (German)
* New translations validation.properties (Hebrew)
* New translations scriptprofile.properties (German)
* New translations scriptprofile.properties (Finnish)
* New translations scriptprofile.properties (Hebrew)
* New translations scriptprofile.properties (Polish)