public class ScriptingComponentHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
private List<PropertyDescriptor> |
descriptors |
private List<AllowableValue> |
engineAllowableValues |
BlockingQueue<ScriptEngine> |
engineQ |
AtomicBoolean |
isInitialized |
private String[] |
modules |
PropertyDescriptor |
SCRIPT_ENGINE |
private String |
scriptBody |
Map<String,ScriptEngineConfigurator> |
scriptEngineConfiguratorMap |
Map<String,ScriptEngineFactory> |
scriptEngineFactoryMap |
private String |
scriptEngineName |
private String |
scriptPath |
| Constructor and Description |
|---|
ScriptingComponentHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
createResources()
This method creates all resources needed for the script processor to function, such as script engines,
script file reloader threads, etc.
|
protected ScriptEngine |
createScriptEngine()
Provides a ScriptEngine corresponding to the currently selected script engine name.
|
Collection<ValidationResult> |
customValidate(ValidationContext validationContext)
Custom validation for ensuring exactly one of Script File or Script Body is populated
|
List<PropertyDescriptor> |
getDescriptors() |
String[] |
getModules() |
String |
getScriptBody() |
List<AllowableValue> |
getScriptEngineAllowableValues() |
String |
getScriptEngineName() |
String |
getScriptPath() |
static boolean |
isFile(String path)
Determines whether the given path refers to a valid file
|
void |
setDescriptors(List<PropertyDescriptor> descriptors) |
void |
setModules(String[] modules) |
void |
setScriptBody(String scriptBody) |
void |
setScriptEngineName(String scriptEngineName) |
void |
setScriptPath(String scriptPath) |
void |
setup(int numberOfScriptEngines,
ComponentLog log)
Performs common setup operations when the processor is scheduled to run.
|
protected void |
setupEngines(int numberOfScriptEngines,
ComponentLog log)
Configures the specified script engine.
|
void |
setupVariables(PropertyContext context) |
void |
stop() |
public PropertyDescriptor SCRIPT_ENGINE
public final Map<String,ScriptEngineConfigurator> scriptEngineConfiguratorMap
public final AtomicBoolean isInitialized
public Map<String,ScriptEngineFactory> scriptEngineFactoryMap
private String scriptEngineName
private String scriptPath
private String scriptBody
private String[] modules
private List<PropertyDescriptor> descriptors
private List<AllowableValue> engineAllowableValues
public BlockingQueue<ScriptEngine> engineQ
public String getScriptEngineName()
public void setScriptEngineName(String scriptEngineName)
public String getScriptPath()
public void setScriptPath(String scriptPath)
public String getScriptBody()
public void setScriptBody(String scriptBody)
public String[] getModules()
public void setModules(String[] modules)
public List<PropertyDescriptor> getDescriptors()
public List<AllowableValue> getScriptEngineAllowableValues()
public void setDescriptors(List<PropertyDescriptor> descriptors)
public Collection<ValidationResult> customValidate(ValidationContext validationContext)
validationContext - provides a mechanism for obtaining externally
managed values, such as property values and supplies convenience methods
for operating on those valuespublic void createResources()
public static boolean isFile(String path)
path - a path to a filepublic void setup(int numberOfScriptEngines,
ComponentLog log)
numberOfScriptEngines - number of engines to setupprotected void setupEngines(int numberOfScriptEngines,
ComponentLog log)
numberOfScriptEngines - number of engines to setupScriptEngineConfiguratorpublic void setupVariables(PropertyContext context)
protected ScriptEngine createScriptEngine()
public void stop()
Copyright © 2021 Apache NiFi Project. All rights reserved.