use of com.serotonin.m2m2.rt.DataPointGroupInitializer in project ma-core-public by infiniteautomation.
the class DataSourceRT method initializePoints.
/**
* The {@link DataPointGroupInitializer} calls
* {@link RuntimeManager#startDataPoint(DataPointWithEventDetectors, List) startDataPoint()}
* which adds the data points to the cache in the RTM and initializes them.
*/
private void initializePoints() {
DataPointDao dataPointDao = Common.getBean(DataPointDao.class);
ExecutorService executorService = Common.getBean(ExecutorService.class);
PointValueCache pointValueCache = Common.getBean(PointValueCache.class);
// Add the enabled points to the data source.
List<DataPointWithEventDetectors> dataSourcePoints = dataPointDao.getDataPointsForDataSourceStart(getId());
// Startup multi threaded
int pointsPerThread = Common.envProps.getInt("runtime.datapoint.startupThreads.pointsPerThread", 1000);
int startupThreads = Common.envProps.getInt("runtime.datapoint.startupThreads", Runtime.getRuntime().availableProcessors());
DataPointGroupInitializer pointInitializer = new DataPointGroupInitializer(executorService, startupThreads, pointValueCache);
pointInitializer.initialize(dataSourcePoints, pointsPerThread);
// Signal to the data source that all points are added.
initialized();
}
Aggregations