Interface ScriptingPluginInfo<T>


  • public interface ScriptingPluginInfo<T>
    Any implementation of a SandboxExtension that is found in the runtime can be automatically loaded into the scenario scripting sandbox. The descriptor type is used to flag the object type of the actual instance to be used as the extension point.

    Each scenario gets its own instance of an object from this SandboxPlugin

    • Method Summary

      Modifier and Type Method Description
      java.lang.String getBaseVariableName()  
      java.lang.String getDescription()  
      T getExtensionObject​(org.slf4j.Logger logger, com.codahale.metrics.MetricRegistry metricRegistry, javax.script.ScriptContext scriptContext)  
      default boolean isAutoLoading()
      If auto loading is true, then the extension will be injected into every scenario sandbox.
    • Method Detail

      • getDescription

        java.lang.String getDescription()
        Returns:
        a brief description of this extension.
      • getExtensionObject

        T getExtensionObject​(org.slf4j.Logger logger,
                             com.codahale.metrics.MetricRegistry metricRegistry,
                             javax.script.ScriptContext scriptContext)
        Parameters:
        logger - A logger named for the extension, in case the extension wants to log internally
        metricRegistry - The main metric registry, in case the extension wants to track metrics internally
        scriptContext - The scripting context object, useful for interacting with the sandbox directly
        Returns:
        a new instance of an extension. The extension is given a logger if it desires.
      • getBaseVariableName

        java.lang.String getBaseVariableName()
        Returns:
        a simple name at the root of the variable namespace to anchor this extension.
      • isAutoLoading

        default boolean isAutoLoading()
        If auto loading is true, then the extension will be injected into every scenario sandbox. If it is false, then the runtime may offer the user the extension via some mechanism.
        Returns:
        whether or not to auto inject this extension into each new scenario