Class ApplicationContextHelper

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    @Component
    public class ApplicationContextHelper
    extends Object
    implements org.springframework.context.ApplicationContextAware
    ApplicationContextHelper
    Author:
    Frank Zhang
    • Constructor Detail

      • ApplicationContextHelper

        public ApplicationContextHelper()
    • Method Detail

      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • getBean

        public static <T> T getBean​(Class<T> targetClz)
      • getBean

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

        public static <T> T getBean​(Class<T> requiredType,
                                    Object... params)
      • getApplicationContext

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