Package adams.flow.standalone.rats.input
Class Cron
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.standalone.rats.input.AbstractRatInput
-
- adams.flow.standalone.rats.input.AbstractMetaRatInput
-
- adams.flow.standalone.rats.input.Cron
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler,adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.ShallowCopySupporter<AbstractRatInput>,adams.core.SizeOfHandler,adams.core.Stoppable,adams.core.StoppableWithFeedback,RatInput,Serializable
public class Cron extends AbstractMetaRatInput
Uses a cronjob for defining the execution of the base rat input.
For more information on the scheduler format see:
http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-input <adams.flow.standalone.rats.input.RatInput> (property: input) The receiver to wrap. default: adams.flow.standalone.rats.input.DummyInput
-schedule <adams.core.base.CronSchedule> (property: schedule) The schedule for executing the base rat input; format 'SECOND MINUTE HOUR DAYOFMONTH MONTH WEEKDAY [YEAR]'. default: 0 0 1 * * ?
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCron.CronJobEncapsulates a job to run.
-
Field Summary
Fields Modifier and Type Field Description static StringCRONDUMMYthe dummy data to feed into the flow.static StringKEY_OWNERthe key for the owner in the JobExecutionContent.protected adams.core.base.CronSchedulem_Schedulethe cron schedule.protected org.quartz.Schedulerm_Schedulerthe scheduler.-
Fields inherited from class adams.flow.standalone.rats.input.AbstractMetaRatInput
m_Data, m_Input
-
Fields inherited from class adams.flow.standalone.rats.input.AbstractRatInput
m_LoggingPrefix, m_Owner, m_ReceptionInterrupted, m_ReceptionRunning, m_Stopped
-
-
Constructor Summary
Constructors Constructor Description Cron()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcallReceive()Hook method that calls the base-input's receive() method using a cronjob.voiddefineOptions()Adds options to the internal list of options.Classgenerates()Returns the type of data this scheme generates.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.adams.core.base.CronSchedulegetSchedule()Returns the execution schedule.StringglobalInfo()Returns a string describing the object.StringinitReception()Initializes the reception.booleanisReceptionRunning()Returns whether the reception is currently running.protected StringreceiveData()Retrieves data using the base input.StringscheduleTipText()Returns the tip text for this property.voidsetSchedule(adams.core.base.CronSchedule value)Sets the execution schedule.voidstopExecution()Stops the execution.protected voidstopScheduler()Stops the internal cron scheduler, if possible.-
Methods inherited from class adams.flow.standalone.rats.input.AbstractMetaRatInput
doReceive, getInput, hasPendingOutput, initialize, inputTipText, output, postReceive, preReceive, setInput, setOwner, setUp
-
Methods inherited from class adams.flow.standalone.rats.input.AbstractRatInput
canReceive, check, cleanUp, configureLogger, doWait, getAdditionalInformation, getFullName, getOwner, getQueue, getReceptionInterrupted, handleException, interruptReception, isStopped, receive, shallowCopy, shallowCopy, updatePrefix
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
CRONDUMMY
public static final String CRONDUMMY
the dummy data to feed into the flow.- See Also:
- Constant Field Values
-
KEY_OWNER
public static final String KEY_OWNER
the key for the owner in the JobExecutionContent.- See Also:
- Constant Field Values
-
m_Schedule
protected adams.core.base.CronSchedule m_Schedule
the cron schedule.
-
m_Scheduler
protected org.quartz.Scheduler m_Scheduler
the scheduler.
-
-
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 classAbstractMetaRatInput
-
setSchedule
public void setSchedule(adams.core.base.CronSchedule value)
Sets the execution schedule.- Parameters:
value- the schedule
-
getSchedule
public adams.core.base.CronSchedule getSchedule()
Returns the execution schedule.- Returns:
- the schedule
-
scheduleTipText
public String scheduleTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classAbstractMetaRatInput- Returns:
- null if no info available, otherwise short string
-
generates
public Class generates()
Returns the type of data this scheme generates.- Specified by:
generatesin interfaceRatInput- Specified by:
generatesin classAbstractRatInput- Returns:
- the type of data
-
isReceptionRunning
public boolean isReceptionRunning()
Returns whether the reception is currently running.- Specified by:
isReceptionRunningin interfaceRatInput- Overrides:
isReceptionRunningin classAbstractRatInput- Returns:
- true if running
-
receiveData
protected String receiveData()
Retrieves data using the base input.- Returns:
- null if successful, otherwise error message
-
initReception
public String initReception()
Initializes the reception.- Specified by:
initReceptionin interfaceRatInput- Overrides:
initReceptionin classAbstractMetaRatInput- Returns:
- null if successfully initialized, otherwise error message
-
callReceive
protected String callReceive()
Hook method that calls the base-input's receive() method using a cronjob.- Overrides:
callReceivein classAbstractMetaRatInput- Returns:
- null if successful, otherwise error message
-
stopScheduler
protected void stopScheduler()
Stops the internal cron scheduler, if possible.
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceRatInput- Specified by:
stopExecutionin interfaceadams.core.Stoppable- Overrides:
stopExecutionin classAbstractMetaRatInput
-
-