jboss war deployed listener

心不动则不痛 提交于 2019-12-22 01:31:56

问题


Is there a single listener one could implement to get a "war deployed" event?

I know there is the ContextServletListener. But it has to be 'attached' for each component (several web.xml files).

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.


回答1:


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.

An ObjectName filter like jboss.management.local:J2EEServer=Local,j2eeType=WebModule,* for your registered notification listener will get you notifications for all deployed wars.

This will work for JBoss 4.x and 5.x.



来源:https://stackoverflow.com/questions/6596729/jboss-war-deployed-listener

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!