类 SpringUtils

java.lang.Object
top.tangyh.basic.utils.SpringUtils

public final class SpringUtils extends Object
Spring工具类
作者:
zuihou
  • 方法详细资料

    • getInstance

      public static SpringUtils getInstance()
      单例Holder模式: 优点:将懒加载和线程安全完美结合的一种方式(无锁)。(推荐)
      返回:
      实实例
    • getApplicationContext

      public static org.springframework.context.ApplicationContext getApplicationContext()
    • setApplicationContext

      public static void setApplicationContext(org.springframework.context.ApplicationContext ctx)
    • getBean

      public static Object getBean(String name)
    • getBean

      public static <T> T getBean(String name, Class<T> type)
    • getBean

      public static <T> T getBean(Class<T> type)
    • getBeansOfType

      public static <T> Map<String,T> getBeansOfType(Class<T> type)
    • publishEvent

      public static org.springframework.context.ApplicationContext publishEvent(Object event)