接口定义
public interface AccountStatusCheckChain {
void next(Long userId);
}
使用Spring自带的方法
Map<String, AccountStatusCheckChain> beans = applicationContext.getBeansOfType(AccountStatusCheckChain.class);
beans.forEach((beanName, bean) -> {
// 执行实现类的方法
bean.next(1L);
});