Package api.log.base

Class ContextUtil

java.lang.Object
api.log.base.ContextUtil
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component public class ContextUtil extends Object implements org.springframework.context.ApplicationContextAware
上下文工具
Author:
chenenwei
  • Constructor Details

    • ContextUtil

      public ContextUtil()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      设置ApplicationContext
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Parameters:
      applicationContext - applicationContext
      Throws:
      org.springframework.beans.BeansException - 异常
    • getBean

      public static <T> T getBean(Class<T> beanClass)
      获取bean
      Type Parameters:
      T - 泛型
      Parameters:
      beanClass - beanClass
      Returns:
      bean