Class Scripted
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.standalone.rats.generator.AbstractRatGenerator
-
- adams.flow.standalone.rats.generator.AbstractScriptedRatGenerator
-
- adams.flow.standalone.rats.generator.Scripted
-
- All Implemented Interfaces:
adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.scripting.FileBasedScripting,adams.core.scripting.FileBasedScriptingWithOptions,adams.core.SizeOfHandler,Serializable
public class Scripted extends AbstractScriptedRatGenerator
A rat generator that uses any scripting handler for generating the rat actor(s) with a script located in the specified file.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-log <adams.flow.core.CallableActorReference> (property: log) The name of the callable log actor to use (logging disabled if actor not found). default: unknown
-send-error-queue <adams.flow.control.StorageName> (property: sendErrorQueue) The name of the (optional) queue in internal storage to feed with send errors. default: senderrors
-show-in-control <boolean> (property: showInControl) If enabled, the generated Rat will be displayed in the adams.flow.standalone.RatControl control panel. default: false
-script <adams.core.io.PlaceholderFile> (property: scriptFile) The script file to load and execute. default: ${CWD}-options <adams.core.base.BaseText> (property: scriptOptions) The options for the script; must consist of 'key=value' pairs separated by blanks; the value of 'key' can be accessed via the 'getAdditionalOptions ().getXYZ("key")' method in the script actor. default:-handler <adams.core.scripting.AbstractScriptingHandler> (property: handler) The handler to use for scripting. default: adams.core.scripting.Dummy
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractRatGeneratorm_GeneratorObjectthe loaded script object.protected adams.core.scripting.AbstractScriptingHandlerm_Handlerthe scripting handler to use.-
Fields inherited from class adams.flow.standalone.rats.generator.AbstractScriptedRatGenerator
m_ScriptFile, m_ScriptObject, m_ScriptOptions
-
Fields inherited from class adams.flow.standalone.rats.generator.AbstractRatGenerator
m_Log, m_SendErrorQueue, m_ShowInControl
-
-
Constructor Summary
Constructors Constructor Description Scripted()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheck()Hook method for checks.protected StringcheckScriptObject()Checks the script object.voiddefineOptions()Adds options to the internal list of options.voiddestroy()Frees up memory in a "destructive" non-reversible way.protected Rat[]doGenerate()Generates the actual setups.adams.core.scripting.AbstractScriptingHandlergetHandler()Gets the handler to use for scripting.StringglobalInfo()Returns a string describing the object.StringhandlerTipText()Returns the tip text for this property.protected StringloadScriptObject()Loads the scripts object and sets its options.StringscriptOptionsTipText()Returns the tip text for this property.voidsetHandler(adams.core.scripting.AbstractScriptingHandler value)Sets the handler to use for scripting.-
Methods inherited from class adams.flow.standalone.rats.generator.AbstractScriptedRatGenerator
getScriptFile, getScriptOptions, initScriptObject, reset, scriptFileTipText, setScriptFile, setScriptOptions
-
Methods inherited from class adams.flow.standalone.rats.generator.AbstractRatGenerator
generate, getLog, getSendErrorQueue, getShowInControl, logTipText, sendErrorQueueTipText, setLog, setSendErrorQueue, setShowInControl, showInControlTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_GeneratorObject
protected transient AbstractRatGenerator m_GeneratorObject
the loaded script object.
-
m_Handler
protected adams.core.scripting.AbstractScriptingHandler m_Handler
the scripting handler to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classAbstractScriptedRatGenerator
-
scriptOptionsTipText
public String scriptOptionsTipText()
Returns the tip text for this property.- Specified by:
scriptOptionsTipTextin interfaceadams.core.scripting.FileBasedScriptingWithOptions- Overrides:
scriptOptionsTipTextin classAbstractScriptedRatGenerator- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setHandler
public void setHandler(adams.core.scripting.AbstractScriptingHandler value)
Sets the handler to use for scripting.- Parameters:
value- the handler
-
getHandler
public adams.core.scripting.AbstractScriptingHandler getHandler()
Gets the handler to use for scripting.- Returns:
- the handler
-
handlerTipText
public String handlerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
loadScriptObject
protected String loadScriptObject()
Loads the scripts object and sets its options.- Specified by:
loadScriptObjectin classAbstractScriptedRatGenerator- Returns:
- null if OK, otherwise the error message
-
checkScriptObject
protected String checkScriptObject()
Checks the script object.- Specified by:
checkScriptObjectin classAbstractScriptedRatGenerator- Returns:
- null if OK, otherwise the error message
-
check
protected void check()
Hook method for checks.- Overrides:
checkin classAbstractScriptedRatGenerator
-
doGenerate
protected Rat[] doGenerate()
Generates the actual setups.- Specified by:
doGeneratein classAbstractRatGenerator- Returns:
- the generated setups
-
destroy
public void destroy()
Frees up memory in a "destructive" non-reversible way.- Specified by:
destroyin interfaceadams.core.Destroyable- Overrides:
destroyin classAbstractScriptedRatGenerator
-
-