public class TypeOneTask extends BaseBackgroundRunnable
timeIntervalProperty just to demonstrate how to have
additional property of type TimeInterval and another one called parsedIntergerProperty. This is
just to demonstrate how to use this infrastructure for parsing of non-trivial properties. Lets say that you want to
support some string property that should be parsed into integer but you would like to support an arbitrary number
of spaces between digits (say value "5 6 1" should be parsed to integer 561). The idea is that for any non-trivially
parsed property in your class there will be a String type property and a real type property (in our case
TimeInterval and Integer) that will hold a value after the String type property counterpart is
successfully parsed. The String value properties should be initialized from configuration values.| Constructor and Description |
|---|
TypeOneTask() |
| Modifier and Type | Method and Description |
|---|---|
TimeInterval |
getExecutionTimeInterval() |
java.lang.String |
getExecutionTimeIntervalStr() |
java.lang.Integer |
getParsedIntegerProperty() |
java.lang.String |
getParsedIntegerPropertyStr() |
TimeInterval |
getTaskExecutionInterval() |
TimeInterval |
getTimeIntervalProperty() |
java.lang.String |
getTimeIntervalPropertyStr() |
protected void |
initParamsForSpecificImplementation()
A hook method to be implemented by user extensions of this class.
|
void |
run() |
void |
setExecutionTimeInterval(TimeInterval executionTimeInterval) |
void |
setExecutionTimeIntervalStr(java.lang.String executionTimeIntervalStr) |
void |
setParamValue(TimeInterval value,
java.lang.String property)
This method is a general setter method for all properties that hold
TimeInterval value. |
void |
setParsedIntegerProperty(java.lang.Integer parsedIntegerProperty) |
void |
setParsedIntegerPropertyStr(java.lang.String parsedIntegerPropertyStr) |
void |
setTimeIntervalProperty(TimeInterval timeIntervalProperty) |
void |
setTimeIntervalPropertyStr(java.lang.String timeIntervalPropertyStr) |
initParams, initTimeIntervalParam, isInitialized, setInitializedinitprotected void initParamsForSpecificImplementation()
BaseBackgroundRunnablecom.mgnt.lifecycle.management.backgroundrunner.exampleinitParamsForSpecificImplementation in class BaseBackgroundRunnablepublic TimeInterval getTaskExecutionInterval()
TimeInterval that specifies how often the Task should be runpublic void setParamValue(TimeInterval value, java.lang.String property)
BackgroundRunnableTimeInterval value. It should be
implemented by user defined class implementing this interface. See source code for classes
TypeOneTask and
TypeTwoTask where one provide complex example
in which there are other properties besides Task Execution Interval and second that demonstrates a minimalistic
implementationvalue - TimeInterval value for the propertyproperty - name of the property to be setpublic void run()
public java.lang.String getExecutionTimeIntervalStr()
public void setExecutionTimeIntervalStr(java.lang.String executionTimeIntervalStr)
public TimeInterval getExecutionTimeInterval()
public void setExecutionTimeInterval(TimeInterval executionTimeInterval)
public java.lang.String getTimeIntervalPropertyStr()
public void setTimeIntervalPropertyStr(java.lang.String timeIntervalPropertyStr)
public TimeInterval getTimeIntervalProperty()
public void setTimeIntervalProperty(TimeInterval timeIntervalProperty)
public java.lang.String getParsedIntegerPropertyStr()
public void setParsedIntegerPropertyStr(java.lang.String parsedIntegerPropertyStr)
public java.lang.Integer getParsedIntegerProperty()
public void setParsedIntegerProperty(java.lang.Integer parsedIntegerProperty)