Operate before the spring container initializes and destroys the bean

Three ways:

The first: the operations performed before the initialization and destruction of beans are implemented through the @PostConstruct and @PreDestroy methods

The second is: by defining init-method and destruction-method methods in xml

The third is:  implement InitializingBean and DisposableBean interfaces through beans

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327030062&siteId=291194637