1、上下文内存加载
@Component
public class AppcationStartXXXXLisenter implements ApplicationRunner{
//重写内存加载命令链方式,存储到内存
@Override
public void run(ApplicationArguments args) throws Exception {
}
}
2、发布、订阅模式[spring 观察者模式]应用
2.1、申明发布和监听事件的载体对象,例如XXXEvent
/**
* 关于督办的事件实体类
*/
@Data
public class SuperviseEvent extends ApplicationEvent {
private SuperviseEventModel superviseEventModel;
public SuperviseEvent(Object source, SuperviseEventModel superviseEventModel) {
super(source);
this.superviseEventModel=superviseEventModel;
}
}
2.2、应用方发布推送事件载体对象
@Autowired
ApplicationEventPublisher applicationEventPublisher;
applicationEventPublisher
.publishEvent(new