<colgroup> <col> <col width="70%"> </colgroup> <thead> <tr> <th>事件</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><b>ContextRefreshedEvent</b></td> <td>初始化或刷新<b>ApplicationContext</b>时将发布此事件。也可以使用<b>ConfigurableApplicationContext</b>接口上的<b>refresh()</b>方法来引发此事件。</td> </tr> <tr> <td><b>ContextStartedEvent</b></td> <td>使用<b>ConfigurableApplicationContext</b>接口上的<b>start()</b>方法启动<b>ApplicationContext</b>时,将触发此事件。您可以轮询数据库,也可以在收到此事件后重新启动任何已停止的应用程序。</td> </tr> <tr> <td><b>ContextStoppedEvent</b></td> <td>当使用<b>ConfigurableApplicationContext</b>接口上的<b>stop()</b>方法停止<b>ApplicationContext</b>时,将触发此事件。收到此事件后,您可以进行必要的资源回收。</td> </tr> <tr> <td><b>ContextClosedEvent</b></td> <td>使用<b>ConfigurableApplicationContext</b>接口上的<b>close()</b>方法关闭<b>ApplicationContext</b>时,将触发此事件。封闭的环境已经到了生命的尽头。它不能刷新或重新启动。</td> </tr> <tr> <td><b>RequestHandledEvent</b></td> <td>这是一个特定于Web的事件,告诉所有Bean HTTP请求已得到服务。</td> </tr> </tbody>
版权声明:
本文来源网络,所有图片文章版权属于原作者,如有侵权,联系删除。
本文网址:https://www.bianchenghao6.com/h6javajc/10441.html