JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
feature_request_small.png
CLOSED  Feature request JPPF-546  -  Use ScriptScriptDefinition objects wherever JSR 223 compliant scripts are used
Posted Sep 10, 2018 - updated Sep 17, 2018
action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Feature request
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Core
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Targetted for
    icon_milestones.png JPPF 6.0
Issue description
Many JPPF classes use JSR 223-compliant scripts to perform their functionality:
  • scripted tasks
  • scripted execution policies
  • scripted node selectors
  • scripted job selectors
  • scripted validation function in ClassPathElementImpl
We propose to introduce a new class ScriptDefinition which groups the attributes needed to execute the scripts:
  • language: the scripting language, e.g. "javascript", "groovy"
  • script: the actual script content as text
  • bindings: an optional set of variable bindings made available to the script
  • reusableId: an optional identifier for the script which allows reusing the compiled form of the script so as to avoid uncessary recompilation of the script
One of the objectives is to simplify the code that uses scripts, in particular so as to hide the internal mechanism to cache and pool the scripting engines and reusable compiled scripts. A longer-term objective (targetting JPPF v6.1) is to expose the ScriptDefinition class wherever scripts are used in the public APIs. This will simplify the exposed APIs while increasing flexibility and add consistency with regards to scripting.