springboot 手动注册bean实例
@Autowired
ApplicationContext applicationContext;
private void registerSingletonBean(String beanName, Object singletonObject) {
ConfigurableApplicationContext configurableApplicationContext = (ConfigurableApplicationContext) applicationContext;
DefaultListableBeanFactory defaultListableBeanFactory = (DefaultListableBeanFactory) configurableApplicationContext.getAutowireCapableBeanFactory();
defaultListableBeanFactory.registerSingleton(beanName, singletonObject);
}