Package es.kukenan.smartfi.context
Class SpringContext
java.lang.Object
es.kukenan.smartfi.context.SpringContext
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class SpringContext
extends Object
implements org.springframework.context.ApplicationContextAware
Component to obtain the spring application context for classes without spring context.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.springframework.context.ApplicationContextSpring application context bean. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.context.ApplicationContextGet Spring application context.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Set Spring application context for this application.
-
Field Details
-
context
@Autowired private static org.springframework.context.ApplicationContext contextSpring application context bean.
-
-
Constructor Details
-
SpringContext
public SpringContext()
-
-
Method Details
-
getApplicationContext
public static org.springframework.context.ApplicationContext getApplicationContext()Get Spring application context.- Returns:
- Spring application context for this application.
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException Set Spring application context for this application.- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Parameters:
applicationContext- Spring app context.- Throws:
org.springframework.beans.BeansException- if is not able to find the bean.
-