AbstractApplicationContext vs ApplicationContext

后端 未结 3 1588
悲哀的现实
悲哀的现实 2021-02-19 15:06

what is the difference between AbstractApplicationContext and ApplicationContext ? can we call

context.registerShutdownHook()  
         


        
3条回答
  •  迷失自我
    2021-02-19 15:51

    registerShutdownHook() gracefully shutdowns bean and preform finalization like calling the destroy methods. This is the method declared in the interface ConfigurableApplicationContext which is implemented by AbstractApplicationContext,and it is not implemented by ApplicationContext.So the invokation of registerShutdownHook() only possible from the AbstractApplicationContext's object

提交回复
热议问题