Class AbstractTrigger
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.control.flowrestart.trigger.AbstractTrigger
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
Cron
,FileMonitor
,MetaCron
,MonitorItself
,MultiTrigger
,Null
public abstract class AbstractTrigger extends AbstractOptionHandler implements QuickInfoSupporter
Ancestor for restart triggers.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected TriggerHandler
m_TriggerHandler
the restart handler to notify.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractTrigger()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
check(Flow flow)
Performs checks before starting the trigger.protected abstract String
doStart(Flow flow)
Starts the trigger.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.TriggerHandler
getTriggerHandler()
Returns the trigger handler.void
setTriggerHandler(TriggerHandler value)
Sets the trigger handler to use.String
start(Flow flow)
Starts the trigger.abstract String
stop()
Stops the trigger.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_TriggerHandler
protected TriggerHandler m_TriggerHandler
the restart handler to notify.
-
-
Method Detail
-
setTriggerHandler
public void setTriggerHandler(TriggerHandler value)
Sets the trigger handler to use.- Parameters:
value
- the handler to use
-
getTriggerHandler
public TriggerHandler getTriggerHandler()
Returns the trigger handler.- Returns:
- the handler
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
check
protected String check(Flow flow)
Performs checks before starting the trigger.- Parameters:
flow
- the flow to check- Returns:
- null if successfully checked, otherwise error message
-
doStart
protected abstract String doStart(Flow flow)
Starts the trigger.- Parameters:
flow
- the flow to handle- Returns:
- null if successfully started, otherwise error message
-
start
public String start(Flow flow)
Starts the trigger.- Parameters:
flow
- the flow to handle- Returns:
- null if successfully started, otherwise error message
-
stop
public abstract String stop()
Stops the trigger.- Returns:
- null if successfully stopped, otherwise error message
-
-