/** * Sensors Analytics Bean * @author Feng */ @Component public class SensorsAnalyticsBean { /*** * 从 Sensors Analytics 获取的数据接收的 URL */ private static String serverUrl; @Value("${sensor.url}") private void setServerUrl(String url) { serverUrl = url; } /*** * 初始化 SensorsAnalytics * @return */ @Bean public SensorsAnalytics sensorsAnalytics() { return new SensorsAnalytics( new SensorsAnalytics.DebugConsumer(serverUrl, true)); } }