如何以编程方式获取 JBoss AS 5.1 中的版本? [英] How do I programmatically obtain the version in JBoss AS 5.1?

查看:19
本文介绍了如何以编程方式获取 JBoss AS 5.1 中的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何在JBossAS 5.1下以编程方式获取服务器版本号?

Does anyone know how to programmatically obtain the server version number under JBossAS 5.1?

JBossAS 4.2 有 org.jboss.Version,带有 getMajor()getMinor() 方法,但这似乎没有存在于 5.1.

JBossAS 4.2 had org.jboss.Version, with getMajor() and getMinor() methods, but this doesn't seem to exist in 5.1.

推荐答案

最后我选择从 JBoss 4.2 反编译 Version 类,看看它在做什么,看看结果是否可以被改造为JBoss 5.最终结果是将资源/org/jboss/version.properties 加载到Properties 对象中,然后读出version.majorversion.minor 属性.我很想知道为什么他们不能把 Version 类留在那里,但是你去.

In the end I chose to decompile the Version class from JBoss 4.2 to see what it was doing, and see if the result could be retrofitted into JBoss 5. The end result was to load the resource /org/jboss/version.properties into a Properties object, and then read out the version.major and version.minor properties from that. Beats me why they couldn't just leave the Version class in there, but there you go.

这篇关于如何以编程方式获取 JBoss AS 5.1 中的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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