public void setActiveBeanFactory(Class forBean) {
if (beanFactories == null) {
throw new IllegalStateException("No bean factory available");
}
AutoBeanFactory factory = beanFactories.get(forBean);
if (factory == null) {
throw new IllegalStateException("No bean factory available");
}
activeBeanFactory = factory;
activeBeanClass = forBean;