ModuleScanProcessor implements ApplicationListener<ContextRefreshedEvent> { @Override public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) { logger.debug("开始扫描模块"); Map<String, Object> beans = contextRefreshedEvent.getApplicationContext().getBeansWithAnnotation(Module.class); List<com.carl.wolf.core.bean.Module> modules = new ArrayList<>(); for (Object value : beans.values()) { try { if (scanStrategy.support(value)) { modules.add(scanStrategy.process(value)); } } catch (ModuleScanException e) { logger.error("模块扫描异常", e); } } }  @Override void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent);  }
@Test public void onApplicationEvent() throws Exception { }