...
|
...
|
@@ -6,14 +6,18 @@ import com.monitor.cmdb.service.IMObjectInfoService; |
|
|
import com.monitor.cmdb.service.ITypeInfoService;
|
|
|
import com.monitor.middleware.rabbitmq.constant.InterVar;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by yoho on 2016/6/21.
|
|
|
*/
|
|
|
public class MoScanTask implements Runnable{
|
|
|
public class MoScanTask {
|
|
|
|
|
|
@Autowired
|
|
|
IMObjectInfoService moService;
|
...
|
...
|
@@ -21,8 +25,14 @@ public class MoScanTask implements Runnable{ |
|
|
@Autowired
|
|
|
ITypeInfoService typeService;
|
|
|
|
|
|
MoScanTask()
|
|
|
{
|
|
|
int i=0;
|
|
|
i++;
|
|
|
System.out.println("123");
|
|
|
}
|
|
|
//自动发现rabbit监控对象
|
|
|
@Scheduled(cron = "0/1 0 0 * * ? *")
|
|
|
@Scheduled(cron = "0/1 * * * * ? *")
|
|
|
public void doTask() {
|
|
|
List<MObjectInfo> mObjectInfoList = moService.queryMObjectsInfo();
|
|
|
|
...
|
...
|
@@ -38,8 +48,4 @@ public class MoScanTask implements Runnable{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void run() {
|
|
|
doTask();
|
|
|
}
|
|
|
} |
...
|
...
|
|