问题描述
有谁知道如何以编程方式获取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中的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!