Class JSRScriptEngineAdapter

  • All Implemented Interfaces:
    ScriptEngine

    public final class JSRScriptEngineAdapter
    extends Object
    implements ScriptEngine
    Adapter design pattern implementation. Adapts provided ScriptEngine representing JSR-223 script engine to the ScriptEngine interface. This adapter is universal for all scripting language implementations supporting JSR-223 specification.

    It is important to bear in mind that this implementation is not thread-safe, that is, ScriptEngine being adapted can not be shared between multiple threads. Bindings from scraper's DynamicScopeContext are copied directly to the ScriptEngine. This is performance trade-off, since currently creation of brand new ScriptContext instances each time script is evaluated is quite expensive.

    Since:
    2.1.0-SNAPSHOT
    Version:
    %I%, %G%
    Author:
    Piotr Dyraga
    See Also:
    ScriptEngine