factory = (BeanFactory) ReflectionUtils.newInstance(factoryClass);
// put the created factory in our factory map
factoryCache.put(factoryName, factory);
}
Object result = factory.createBean(directive.getSrcObject(), directive.getSrcClass(), beanId);
log.debug("Bean instance created with custom factory -->\n Bean Type: {}\n Factory Name: {}",
result.getClass().getName(), factoryName);
if (!classToCreate.isAssignableFrom(result.getClass())) {