问题描述
是否可以实现一个侦听器来获取战争部署"事件?
Is there a single listener one could implement to get a "war deployed" event?
我知道有 ContextServletListener .但是每个组件(几个web.xml文件)都必须附加".
I know there is the ContextServletListener.But it has to be 'attached' for each component (several web.xml files).
作为后备,如果我使用ContextServletListener,如何知道最后一个组件已部署?
As a fallback, if I use ContextServletListener, how can I tell that the last component has been deployed?
作为旁注:完成部署后,我需要注意一个热部署.
As a side note: I need to be aware of a hot deploy when it finishes.
推荐答案
部署战争时,JBoss注册一个 J2EEApplication MBean.您可以向JBoss MBeanServer的MBeanServer委托(对象名称: JMImplementation:type = MBeanServerDelegate )注册JMX通知侦听器,该通知将在您注册和取消注册MBean时通知您.
JBoss registers a J2EEApplication MBean when a war is deployed. You can register a JMX notification listener with the JBoss MBeanServer's MBeanServer delegate (Object name: JMImplementation:type=MBeanServerDelegate) which will notify you when MBeans are registered and unregistered.
已注册通知监听器的 jboss.management.local:J2EEServer = Local,j2eeType = WebModule ** 的ObjectName过滤器将为您发送所有已部署战争的通知.
An ObjectName filter like jboss.management.local:J2EEServer=Local,j2eeType=WebModule,* for your registered notification listener will get you notifications for all deployed wars.
这将适用于JBoss 4.x和5.x.
This will work for JBoss 4.x and 5.x.
这篇关于jboss战争部署的监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!