Showing
1 changed file
with
16 additions
and
0 deletions
1 | package com.monitor.middleware.zookeeper; | 1 | package com.monitor.middleware.zookeeper; |
2 | 2 | ||
3 | +import org.slf4j.Logger; | ||
4 | +import org.slf4j.LoggerFactory; | ||
5 | +import org.springframework.scheduling.annotation.Scheduled; | ||
6 | +import org.springframework.stereotype.Component; | ||
7 | + | ||
3 | /** | 8 | /** |
4 | * Created by yoho on 2016/6/21. | 9 | * Created by yoho on 2016/6/21. |
5 | */ | 10 | */ |
6 | @Component | 11 | @Component |
7 | public class ZookeeperMonitorTask { | 12 | public class ZookeeperMonitorTask { |
8 | 13 | ||
14 | + Logger log = LoggerFactory.getLogger(ZookeeperMonitorTask.class); | ||
15 | + | ||
16 | + | ||
17 | + @Scheduled(fixedRate=10000) | ||
18 | + public void run() { | ||
19 | + log.info("task start..."); | ||
20 | + System.out.println("************************************************************"); | ||
21 | + log.info("task end..."); | ||
22 | + | ||
23 | + } | ||
24 | + | ||
9 | } | 25 | } |
-
Please register or login to post a comment