jboss-tomcat部署侦听器 [英] jboss - tomcat deploy listener

查看:153
本文介绍了jboss-tomcat部署侦听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有战争部署完毕后,我必须写一条日志行. 我可以挂钩的Tomcat部署程序是否有观察者模式?

I got a requirement to write a log line when all wars have been deployed. Is there an observer pattern for Tomcat's deployer I could hook onto?

在第一次启动时,jBoss/Tomcat会发送一条包含确切启动时间的行. 不完美...但是可以.

On first start jBoss/Tomcat send out a line with exact time spent on startup. Not perfect... but works.

但是在热部署中,不会发送/编写任何通知/日志:(

But on hot deploy no notification/log is sent/written :(

(该项目中大约有100个servlet,有可能将它们全部按顺序列出,然后猜测一旦最后一个初始化完成,部署就完成了,所以让我们尝试跳过这种解决方案)

(There are around 100 servlets in the project and it's a risk to list them all in order and then guess that the deployment is finished once the last one initializes, so let's try to skip solutions of that kind)

有任何提示吗?

推荐答案

您是否看过JBoss JMX API?除其他外,还有一个MainDeployer MBean可让您管理部署,它具有方法listIncompletelyDeployed(),您可以调用该方法来检查尚未部署的内容. ListenerServiceMBeanSupport允许您订阅JMX通知.

Did you look at JBoss JMX API? Among others there is a MainDeployer MBean that lets you manage deployments, it has a method listIncompletelyDeployed() which you can call to check what's not yet deployed. A ListenerServiceMBeanSupport allows you to subscribe for JMX notifications.

我无法为您提供确切的解决方案,但是在JMX上戳戳可能会为您带来所需的东西.

Well I cannot give you an exact solution, but poking around the JMX may bring you what you need.

这篇关于jboss-tomcat部署侦听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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