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 default java.lang.StringgetBaseVariableName()java.lang.StringgetDescription()TgetExtensionObject(org.apache.logging.log4j.Logger logger, com.codahale.metrics.MetricRegistry metricRegistry, javax.script.ScriptContext scriptContext)default booleanisAutoLoading()If auto loading is true, then the extension will be injected into every scenario sandbox.
-
Method Details
-
getDescription
java.lang.String getDescription()- Returns:
- a brief description of this extension.
-
getExtensionObject
T getExtensionObject(org.apache.logging.log4j.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 internallymetricRegistry- The main metric registry, in case the extension wants to track metrics internallyscriptContext- 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
default 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
-