Bre*_*ail 22
从EJB 3.1开始,可以通知单例bean启动和停止模块:
@Singleton
@Startup
public class StartupBean {
@PostConstruct
private void postConstruct() { /* ... */ }
@PreDestroy
private void preDestroy() { /* ... */ }
}
Run Code Online (Sandbox Code Playgroud)
在EJB 3.1之前,没有标准的,仅限EJB的解决方案.我建议在你的EAR中添加一个WAR并使用servlet-context-listener.
| 归档时间: |
|
| 查看次数: |
17621 次 |
| 最近记录: |