Search in sources :

Example 1 with PublishedPointGroupInitializer

use of com.serotonin.m2m2.rt.PublishedPointGroupInitializer in project ma-core-public by MangoAutomation.

the class PublisherRT method initializePoints.

/**
 * The {@link PublishedPointGroupInitializer} calls
 * {@link RuntimeManager#startPublishedPoint(PublishedPointVO) startPublishedPoint()}
 * which adds the points to the cache in the RTM and initializes them.
 */
private void initializePoints() {
    ExecutorService executorService = Common.getBean(ExecutorService.class);
    // Add the enabled points to the data source.
    List<PublishedPointVO> points = publishedPointDao.getEnabledPublishedPoints(getId());
    // Startup multi threaded
    int pointsPerThread = Common.envProps.getInt("runtime.publishedPoint.startupThreads.pointsPerThread", 1000);
    int startupThreads = Common.envProps.getInt("runtime.publishedPoint.startupThreads", Runtime.getRuntime().availableProcessors());
    PublishedPointGroupInitializer pointInitializer = new PublishedPointGroupInitializer(executorService, startupThreads);
    pointInitializer.initialize(points, pointsPerThread);
}
Also used : ExecutorService(java.util.concurrent.ExecutorService) PublishedPointGroupInitializer(com.serotonin.m2m2.rt.PublishedPointGroupInitializer) PublishedPointVO(com.serotonin.m2m2.vo.publish.PublishedPointVO)

Example 2 with PublishedPointGroupInitializer

use of com.serotonin.m2m2.rt.PublishedPointGroupInitializer in project ma-core-public by infiniteautomation.

the class PublisherRT method initializePoints.

/**
 * The {@link PublishedPointGroupInitializer} calls
 * {@link RuntimeManager#startPublishedPoint(PublishedPointVO) startPublishedPoint()}
 * which adds the points to the cache in the RTM and initializes them.
 */
private void initializePoints() {
    ExecutorService executorService = Common.getBean(ExecutorService.class);
    // Add the enabled points to the data source.
    List<PublishedPointVO> points = publishedPointDao.getEnabledPublishedPoints(getId());
    // Startup multi threaded
    int pointsPerThread = Common.envProps.getInt("runtime.publishedPoint.startupThreads.pointsPerThread", 1000);
    int startupThreads = Common.envProps.getInt("runtime.publishedPoint.startupThreads", Runtime.getRuntime().availableProcessors());
    PublishedPointGroupInitializer pointInitializer = new PublishedPointGroupInitializer(executorService, startupThreads);
    pointInitializer.initialize(points, pointsPerThread);
}
Also used : ExecutorService(java.util.concurrent.ExecutorService) PublishedPointGroupInitializer(com.serotonin.m2m2.rt.PublishedPointGroupInitializer) PublishedPointVO(com.serotonin.m2m2.vo.publish.PublishedPointVO)

Aggregations

PublishedPointGroupInitializer (com.serotonin.m2m2.rt.PublishedPointGroupInitializer)2 PublishedPointVO (com.serotonin.m2m2.vo.publish.PublishedPointVO)2 ExecutorService (java.util.concurrent.ExecutorService)2