1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.battery.business.runtime;
 
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.battery.business.service.ITestDataReceptionService;
 
/**
 * 按固定周期触发数据接收,由业务服务按测试接收状态和采样来源保存成功观测。
 *
 * <p>它不限定 profile:真实来源的接收路径必须在任何启动方式下都运行。
 */
@Component
public class TestDataReceptionScheduler
{
    private final ITestDataReceptionService reception;
 
    public TestDataReceptionScheduler(ITestDataReceptionService reception) { this.reception = reception; }
 
    /** 每秒触发一次数据接收,由业务服务保存成功观测;只推进请求和保存,不向设备发送控制命令。 */
    @Scheduled(fixedDelay = 1000)
    public void capture() { reception.captureReceivedData(); }
}