Mak*_*sim 3 java glassfish quartz-scheduler
在 Glassfish 中部署/取消部署/重新部署 JEE5 应用程序时,如何自动触发 Java 功能以停止 Quartz 调度程序作业。
实施ServletContextListener并挂上contextDestroyed().
基本示例:
public class Config implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
// Write code here which should be executed on webapp startup.
}
public void contextDestroyed(ServletContextEvent event) {
// Write code here which should be executed on webapp shutdown.
}
}
Run Code Online (Sandbox Code Playgroud)
并将其注册为<listener>in web.xml。
public class Config implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
// Write code here which should be executed on webapp startup.
}
public void contextDestroyed(ServletContextEvent event) {
// Write code here which should be executed on webapp shutdown.
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2136 次 |
| 最近记录: |