JPPF Issue Tracker
Please log in to bookmark issues
CLOSED  Feature request JPPF-546  -  Use ScriptScriptDefinition objects wherever JSR 223 compliant scripts are used
Posted Sep 10, 2018 - updated Sep 17, 2018
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Feature request
  • Status
  • Assigned to
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
  • Owned by
    Not owned by anyone
  • Category
  • Resolution
  • Priority
  • 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.