mirror of https://gitee.com/stylefeng/roses
【resource】设置resource监听器的顺序
parent
43cd3574c1
commit
fa93ce97b1
|
@ -23,4 +23,9 @@ public interface ScannerConstants {
|
|||
*/
|
||||
String RESOURCE_CACHE_KEY = "GUNS_RESOURCE_CACHES";
|
||||
|
||||
/**
|
||||
* 资源汇报的监听器的顺序
|
||||
*/
|
||||
Integer REPORT_RESOURCE_LISTENER_SORT = 200;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package cn.stylefeng.roses.kernel.resource.scanner;
|
|||
|
||||
import cn.stylefeng.roses.kernel.resource.api.ResourceCollectorApi;
|
||||
import cn.stylefeng.roses.kernel.resource.api.ResourceReportApi;
|
||||
import cn.stylefeng.roses.kernel.resource.api.constants.ScannerConstants;
|
||||
import cn.stylefeng.roses.kernel.resource.api.holder.InitScanFlagHolder;
|
||||
import cn.stylefeng.roses.kernel.resource.api.pojo.resource.ReportResourceParam;
|
||||
import cn.stylefeng.roses.kernel.resource.api.pojo.resource.ResourceDefinition;
|
||||
|
@ -11,6 +12,7 @@ import org.springframework.boot.context.event.ApplicationReadyEvent;
|
|||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.core.Ordered;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -21,7 +23,7 @@ import java.util.Map;
|
|||
* @date 2020/10/19 22:27
|
||||
*/
|
||||
@Slf4j
|
||||
public class ResourceReportListener implements ApplicationListener<ApplicationReadyEvent> {
|
||||
public class ResourceReportListener implements ApplicationListener<ApplicationReadyEvent>, Ordered {
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationReadyEvent event) {
|
||||
|
@ -55,4 +57,9 @@ public class ResourceReportListener implements ApplicationListener<ApplicationRe
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return ScannerConstants.REPORT_RESOURCE_LISTENER_SORT;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue