|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.serotonin.m2m2.module.ModuleElementDefinition
com.serotonin.m2m2.module.DataSourceDefinition
public abstract class DataSourceDefinition
A data source is the means by which m2m2 gets values into a data point, and writes set point values back to source equipment (if possible). m2m2's primary object is a data point. There are many common attributes of points, such as data type, engineering units, logging, etc. But points differ in how they get their values, and these differences are encapsulated in a "point locator". For example, a Modbus point locator consists of a slave id, register range, offset, etc. An HTTP retriever point consists of a regular expression that extracts data from a web page. The data source is (in this sense, but not literally) the container for the point locators, and has appropriate attributes. Data points, locators, and data sources (and other concepts as well) are split into VO (value object) and RT (runtime) objects. The VO represents the configuration of the object, i.e. what is saved to the database. The RT is the code (usually a thread or scheduled process) that does the actual work of connecting or listening or whatever is appropriate for the given protocol. When you are editing a data source, you are changing the attributes of the VO. When you start the data source, you are providing a VO to an RT, and then running the RT. DWR is how m2m2 realizes AJAX. More information is available here: http://directwebremoting.org/dwr/index.html. When creating a data source for m2m2, the following components are required:
DataSourceVO
PointLocatorVO
DataSourceRT
PollingDataSource
and EventDataSource
PointLocatorRT
DataSourceEditDwr
Nested Class Summary | |
---|---|
static class |
DataSourceDefinition.StartPriority
The available start priorities for data sources. |
Constructor Summary | |
---|---|
DataSourceDefinition()
|
Method Summary | |
---|---|
com.serotonin.m2m2.vo.dataSource.DataSourceVO<?> |
baseCreateDataSourceVO()
Used by m2m2 core code to create a new data source instance as required. |
protected abstract com.serotonin.m2m2.vo.dataSource.DataSourceVO<?> |
createDataSourceVO()
Create and return an instance of the data source. |
abstract java.lang.String |
getDataSourceTypeName()
An internal identifier for this type of data source. |
abstract java.lang.String |
getDescriptionKey()
A reference to a human readable and translatable brief description of the data source. |
abstract java.lang.Class<?> |
getDwrClass()
The class of the DWR with which the data source editing page communicates. |
abstract java.lang.String |
getEditPagePath()
The path to the data source editing page relative to the module. |
DataSourceDefinition.StartPriority |
getStartPriority()
Override this method as required. |
void |
uninstall()
If the module is uninstalled, delete any data sources of this type. |
Methods inherited from class com.serotonin.m2m2.module.ModuleElementDefinition |
---|
getModule, initialize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSourceDefinition()
Method Detail |
---|
public final com.serotonin.m2m2.vo.dataSource.DataSourceVO<?> baseCreateDataSourceVO()
public abstract java.lang.String getDataSourceTypeName()
public abstract java.lang.String getDescriptionKey()
protected abstract com.serotonin.m2m2.vo.dataSource.DataSourceVO<?> createDataSourceVO()
public abstract java.lang.String getEditPagePath()
public abstract java.lang.Class<?> getDwrClass()
DataSourceEditDwr
.
public DataSourceDefinition.StartPriority getStartPriority()
DataSourceDefinition.StartPriority
value.public void uninstall()
uninstall
in class ModuleElementDefinition
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |