Class SpringBeanFactory

java.lang.Object
io.github.lunasaw.sip.common.utils.SpringBeanFactory
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component public class SpringBeanFactory extends Object implements org.springframework.context.ApplicationContextAware
Author:
luna
  • Constructor Details

    • SpringBeanFactory

      public SpringBeanFactory()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      实现ApplicationContextAware接口的回调方法,设置上下文环境
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • getBean

      public static <T> T getBean(String beanId) throws org.springframework.beans.BeansException
      获取对象 这里重写了bean方法,起主要作用
      Throws:
      org.springframework.beans.BeansException
    • getActiveProfile

      public static String getActiveProfile()
      获取当前环境