Spring ApplicationContext Container
by, 07-07-2012 at 05:39 PM (1012 Views)
The advanced spring container is the Application Context. Just like the BeanFactory, it can perform the similar operations like wiere beans together, loading of bean definitions and upon request dispense bean. Following enterprise specific functionality is provided:
• From properties file, it can resolve textual messages.
• Application events are published to event listeners.
The ApplicationContext interface defines this container.
The BeanFactory complete functionality is provided by the ApplicationContext and it is preferred over the BeanFactory. For light weight applications the BeanFactory is still usable like applet applications and mobile devices.
Following ApplicationContext implementations are most popular:
• FileSystemXmlApplicationContext: From an XML file, bean definition is loaded by this container. The complete path of the configuration file is provided to the constructor in this approach.
• ClassPathXmlApplicationContext: From an XML file, bean definiation is loaded and it is not required to give the full path of the configuration file. Instead of this, class path is configured because container will find the bean configuration file in the class path.
• WebXmlApplicationContext: From web application, the bean definition is loaded by the container.