Skip to content

Instantly share code, notes, and snippets.

@tylertreat
Created December 31, 2014 21:31
Show Gist options
  • Select an option

  • Save tylertreat/21cb0c65143ce67c9bb8 to your computer and use it in GitHub Desktop.

Select an option

Save tylertreat/21cb0c65143ce67c9bb8 to your computer and use it in GitHub Desktop.
private int registerClientStubBeans(DefaultListableBeanFactory beanFactory) {
addClasspathDependencies();
List<Bean> clientStubBeans = getClientStubBeans();
int count = 0;
for (Bean bean : clientStubBeans) {
beanFactory.registerBeanDefinition(bean.beanName, bean.beanDefinition);
count++;
}
return count;
}
private static class Bean {
String beanName;
BeanDefinition beanDefinition;
Bean(String name, BeanDefinition definition) {
beanName = name;
beanDefinition = definition;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment