return getBean(name, null);
}
public Object getBean(String name, Class requiredType) throws BeansException {
Object bean = beans.get(name);
if (bean == null) {
throw new NoSuchBeanDefinitionException(name);
}
if (requiredType != null && !requiredType.isInstance(bean)) {
throw new BeanNotOfRequiredTypeException(name, requiredType, bean.getClass());
}
return bean;