Code example for XmlBeanFactory

		ClassPathResource res = new ClassPathResource("applicationContext.xml");
		beanFactory = new XmlBeanFactory(res);
	 * Retrieve a Spring bean based on the class that it implements. Where multiple  
	 * beans implement a class, the first will be returned.  
	 * @param cl The type of bean to be retrieved. 
	 * @return The bean, or null if none exists. 
	public static <T extends Object> T getBean(Class<T> cl)
		if (beanFactory == null)
Experience pair programming with AI  Get Codota for Java