what is the difference between AbstractApplicationContext
and ApplicationContext
?
can we call
context.registerShutdownHook()
registerShutdownHook() is not part of ApplicationContext. So, we can not use Application context.
This method can be invoked using references using with either ConfigurableApplicationContext or AbstractApplicationContext.
As methods can be called either from interface or class having the implementation. Because, we actually create object for ClassPathXmlApplicationContext using the reference of AbstractApplicationContext.
Difference: ConfigurableApplicationContext is an interface where the methods are implemented in AbstractApplicationContext class.