如何以编程方式启动/停止EJB? [英] How do I programmatically start/stop an EJB

查看:127
本文介绍了如何以编程方式启动/停止EJB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道是否可以在我的应用程序代码中启动/停止EJB?例如。我有一些MDB,我希望在我的应用程序运行时选择性地启动/停止?有任何想法吗?这可以通过JMX来实现吗?



干杯!

解决方案

EJB不是可以启动或停止的东西。当然,它有一个生命周期,但这更多涉及创建,激活,钝化和删除EJB实例,完全取决于EJB容器来管理生命周期。



简短:您无法以编程方式管理EJB的生命周期。


Does anyone know if it's possible to start/stop an EJB within my application code? Eg. I have some MDBs that I wish to selectively start/stop while my application is running? Any ideas? Can this maybe be done via JMX?

Cheers!

解决方案

An EJB is not something that can be "started" or "stopped". Sure, it has a life cycle but that is more concerned with creation, activation, passivation and removal of EJB instances, and it's entirely up to the EJB container to manage the life cycle.

In short: you can't manage an EJB's life cycle programmatically.

这篇关于如何以编程方式启动/停止EJB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆