是否有一些简单的方法可以在 JBoss 部署 EAR 内的 JAR 时执行代码?
我计划将 EAR 打包应用程序部署到 JBoss v4.2 中,作为包含 EAR 内容的文件夹。到目前为止,EAR 都是作为单个文件部署的。我希望能够替换单个 JAR 而无需重新启动应用程序。
是否有任何类型的事件侦听器或注释可用于在部署时注册这些 JAR 文件?这个想法是像插件一样部署一些实现已知接口的功能。这些插件应在 Seam webapp 环境中使用,并且可以动态地与更新版本进行交换。
有什么想法吗?谢谢。
I plan to deploy an EAR packaged application into JBoss v4.2 as a folder containing the content of the EAR. Until now the EAR is deployed as a single file. I hope to be able to replace single JARs without the need to restart the application.
Is there any kind of event listener or annotation that can be used to register those JAR files upon deployment? The idea is a plugin like deployment of some features implementing a known interface. The plugins shall be used in a Seam webapp environment and may be exchanged with updated versions on the fly.
Any ideas? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AFAIK,这是不可能/不支持的。使用爆炸式 EAR 时,触摸单个模块将触发整个 EAR 的热部署。
轻量级 Java Web 应用程序开发:利用 EJB3、JSF、POJO 和 Seam:
您正在寻找的东西听起来并不简单。它需要检测更改,卸载来自该 JAR 的已加载类定义(假设此信息已知),重新加载类(类似的事情,但我很确定我过于简单化了)。也许更多的是 OSGI 服务器的工作。
另请参阅
AFAIK, this is not possible/supported. When using an exploded EAR, touching an individual module would trigger the hot deployment of the whole EAR.
From Lightweight Java Web Application Development: Leveraging EJB3, JSF, POJO, and Seam:
What you're looking for doesn't sound simple. It would require detecting the change, unloading loaded class definitions coming from that JAR (assuming this information is known), reloading classes (something like that but I'm pretty sure I'm oversimplifying). Maybe more a job for an OSGI server.
See also