Class WatchManager

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    public class WatchManager
    extends Object
    implements org.springframework.context.ApplicationContextAware
    • Field Detail

      • LOGGER

        public static final org.slf4j.Logger LOGGER
    • Constructor Detail

      • WatchManager

        public WatchManager()
    • Method Detail

      • removeTask

        public static void removeTask​(String instanceId,
                                      CheckStatusTask checkStatusTask)
        删除任务
        Parameters:
        instanceId -
        checkStatusTask -
      • onRefresh

        @Scheduled(fixedDelayString="${beta.service.watch.refreshTime:60000}",
                   initialDelayString="${beta.service.watch.refreshTime:60000}")
        public void onRefresh()
        查询后加载定时任务 监控 60 秒一次
      • hasTask

        public static boolean hasTask​(CheckStatusTask task,
                                      String instanceId)
        确保任务唯一性
        Parameters:
        task - 任务
        instanceId - 实例 id
        Returns:
      • addTask

        public void addTask​(String instanceId)
      • get

        public static boolean get​(String id)
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • closeApplication

        public static void closeApplication()