Package com.isomorphic.spring

# Class SpringApplicationContextProvider

java.lang.Object
com.isomorphic.spring.SpringApplicationContextProvider

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

@Component public class SpringApplicationContextProvider extends Object implements org.springframework.context.ApplicationContextAware
This singleton provides access to spring application context anywhere it is required, with no ServletContext or any other object required. To use this mechanism you must first register this class as a Spring bean in your Spring configuration file like so:

     <bean id="springApplicationContextProvider" class="com.isomorphic.spring.SpringApplicationContextProvider" />

You can then obtain a reference to the ApplicationContext like so anywhere in your code:

     ApplicationContext applicationContext = SpringApplicationContextProvider.getApplicationContext();