Package com.academy.utils
Class ApplicationContextProvider
- java.lang.Object
-
- com.academy.utils.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
-
-
Constructor Summary
Constructors Constructor Description ApplicationContextProvider()
-
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 Contextvoid
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
This method will set Spring Application Context.
-
-
-
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 interfaceorg.springframework.context.ApplicationContextAware
- Parameters:
applicationContext
- Spring Application Context
-
-