Class ApplicationContextProvider

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

    @Component("applicationContextProvider")
    public class ApplicationContextProvider
    extends java.lang.Object
    implements org.springframework.context.ApplicationContextAware
    Returns Spring ApplicationContext from any point of application
    Author:
    Ruslan Nazirov
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.springframework.context.ApplicationContext getApplicationContext()
      This method will return Spring Application Context
      void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
      This method will set Spring Application Context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ApplicationContextProvider

        public ApplicationContextProvider()
    • Method Detail

      • getApplicationContext

        public static org.springframework.context.ApplicationContext getApplicationContext()
        This method will return Spring Application Context
        Returns:
        Spring Application Context
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
        This method will set Spring Application Context. It will be automatically executed by Spring Framework.
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Parameters:
        applicationContext - Spring Application Context