Package net.risesoft.api.watch
Class WatchManager
- java.lang.Object
-
- net.risesoft.api.watch.WatchManager
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class WatchManager extends Object implements org.springframework.context.ApplicationContextAware
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description WatchManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
-
-
-
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)
-
getWatchTask
public static Map<String,CheckStatusTask> getWatchTask()
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
closeApplication
public static void closeApplication()
-
-