@@ -0,0 +1,1329 @@
+package com.pinganfu.owl;%0A%0Aimport java.util.Map;%0A%0Aimport org.springframework.context.ApplicationContext;%0Aimport org.springframework.context.ApplicationContextAware;%0A%0A/**%0A * @author yangxin%0A */%0Apublic class SpringContextHolder implements ApplicationContextAware %7B%0A  private static ApplicationContext applicationContext;%0A%0A  public void setApplicationContext(ApplicationContext applicationContext) %7B%0A    SpringContextHolder.applicationContext = applicationContext;%0A  %7D%0A%0A  public static ApplicationContext getApplicationContext() %7B%0A    checkApplicationContext();%0A    return applicationContext;%0A  %7D%0A%0A  @SuppressWarnings(%22unchecked%22)%0A  public static %3CT%3E T getBean(String name) %7B%0A    checkApplicationContext();%0A    return (T) applicationContext.getBean(name);%0A  %7D%0A%0A  @SuppressWarnings(%22unchecked%22)%0A  public static %3CT%3E T getBean(Class%3CT%3E clazz) %7B%0A    checkApplicationContext();%0A    @SuppressWarnings(%22rawtypes%22)%0A    Map beanMaps = applicationContext.getBeansOfType(clazz);%0A    if (beanMaps != null && !beanMaps.isEmpty()) %7B%0A      return (T) beanMaps.values().iterator().next();%0A    %7D else %7B%0A      return null;%0A    %7D%0A  %7D%0A%0A  private static void checkApplicationContext() %7B%0A    if (applicationContext == null) %7B%0A      throw new IllegalStateException(%0A          %22SpringContextHolder is not injected in applicationContext.xml%22);%0A    %7D%0A  %7D%0A%0A%7D%0A

add another SpringContextHoder