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

查看:142
本文介绍了如何以编程方式获取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反编译 Version 类4.2看看它在做什么,看看结果是否可以改装成JBoss 5.最终结果是将资源 /org/jboss/version.properties 加载到一个属性对象,然后读出 version.major version.minor 来自的属性。打败我为什么他们不能在那里留下版本课程,但你去了。

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天全站免登陆