类 WatchManager
- java.lang.Object
-
- net.risesoft.api.watch.WatchManager
-
- 所有已实现的接口:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class WatchManager extends Object implements org.springframework.context.ApplicationContextAware
-
-
字段概要
字段 修饰符和类型 字段 说明 static org.slf4j.LoggerLOGGER
-
构造器概要
构造器 构造器 说明 WatchManager()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddTask(String instanceId)static voidcloseApplication()static booleanget(String id)static Map<String,CheckStatusTask>getWatchTask()static booleanhasTask(CheckStatusTask task, String instanceId)确保任务唯一性voidonRefresh()查询后加载定时任务 监控 60 秒一次static voidremoveTask(String instanceId, CheckStatusTask checkStatusTask)删除任务voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
-
-
方法详细资料
-
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)
-
getWatchTask
public static Map<String,CheckStatusTask> getWatchTask()
-
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()
-
-