@SuppressWarnings("unchecked")
	public static <T> List<T> getBeanByType(Class<T> clazz, ApplicationContext context) {
		Assert.notNull(context);
		Assert.notNull(clazz);
		
		//Spring3.0后才支持 <T> T getBean(Class<T> requiredType) throws BeansException;
		//为了兼容以前版本，故如下
		String[] names = context.getBeanNamesForType(clazz);
		
		if (null == names || names.length == 0) {
			return null;
		}
		
		List<T> beans = new ArrayList<T>();
		
		for (String name : names) {
			beans.add((T)context.getBean(name));
		}
		
		return beans;
	}