public abstract class AbstractScriptProcessor extends AbstractSessionFactoryProcessor
| Modifier and Type | Field and Description |
|---|---|
protected List<PropertyDescriptor> |
descriptors |
protected BlockingQueue<ScriptEngine> |
engineQ |
protected AtomicBoolean |
isInitialized |
protected String[] |
modules |
static PropertyDescriptor |
MODULES |
static Relationship |
REL_FAILURE |
static Relationship |
REL_SUCCESS |
static PropertyDescriptor |
SCRIPT_BODY |
static PropertyDescriptor |
SCRIPT_ENGINE |
static PropertyDescriptor |
SCRIPT_FILE |
protected String |
scriptBody |
protected Map<String,ScriptEngineConfigurator> |
scriptEngineConfiguratorMap |
protected Map<String,ScriptEngineFactory> |
scriptEngineFactoryMap |
protected String |
scriptEngineName |
protected String |
scriptPath |
| Constructor and Description |
|---|
AbstractScriptProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected 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.
|
protected ClassLoader |
createScriptEngineModuleClassLoader(URL[] modules)
Creates a classloader to be used by the selected script engine and the provided script file.
|
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext)
Custom validation for ensuring exactly one of Script File or Script Body is populated
|
protected boolean |
isFile(String path)
Determines whether the given path refers to a valid file
|
void |
setup(int numberOfScriptEngines)
Performs common setup operations when the processor is scheduled to run.
|
protected void |
setupEngines(int numberOfScriptEngines)
Configures the specified script engine.
|
void |
stop() |
getControllerServiceLookup, getIdentifier, getLogger, getRelationships, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, getSupportedPropertyDescriptors, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
public static PropertyDescriptor SCRIPT_ENGINE
public static final PropertyDescriptor SCRIPT_FILE
public static final PropertyDescriptor SCRIPT_BODY
public static final PropertyDescriptor MODULES
protected final Map<String,ScriptEngineConfigurator> scriptEngineConfiguratorMap
protected final AtomicBoolean isInitialized
protected Map<String,ScriptEngineFactory> scriptEngineFactoryMap
protected String scriptEngineName
protected String scriptPath
protected String scriptBody
protected String[] modules
protected List<PropertyDescriptor> descriptors
protected BlockingQueue<ScriptEngine> engineQ
protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractConfigurableComponentvalidationContext - provides a mechanism for obtaining externally
managed values, such as property values and supplies convenience methods
for operating on those valuesprotected void createResources()
protected boolean isFile(String path)
path - a path to a filepublic void setup(int numberOfScriptEngines)
protected void setupEngines(int numberOfScriptEngines)
ScriptEngineConfiguratorprotected ScriptEngine createScriptEngine()
protected ClassLoader createScriptEngineModuleClassLoader(URL[] modules)
modules - An array of URLs to add to the class loader@OnStopped public void stop()
Copyright © 2017 Apache NiFi Project. All rights reserved.