类 WatchManager

  • 所有已实现的接口:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    public class WatchManager
    extends Object
    implements org.springframework.context.ApplicationContextAware
    • 字段详细资料

      • LOGGER

        public static final org.slf4j.Logger LOGGER
    • 构造器详细资料

      • WatchManager

        public WatchManager()
    • 方法详细资料

      • removeTask

        public static void removeTask​(String instanceId,
                                      CheckStatusTask checkStatusTask)
        删除任务
        参数:
        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)
        确保任务唯一性
        参数:
        task - 任务
        instanceId - 实例 id
        返回:
      • 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
        指定者:
        setApplicationContext 在接口中 org.springframework.context.ApplicationContextAware
        抛出:
        org.springframework.beans.BeansException
      • closeApplication

        public static void closeApplication()