如何在运行时获取端口绑定信息? (JBoss 5.1) [英] How can I obtain port binding information at runtime? (JBoss 5.1)

查看:149
本文介绍了如何在运行时获取端口绑定信息? (JBoss 5.1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我想要做的是获取JBoss在其上侦听HTTP请求的端口号(通常是8080).

Basically what I want to do is to obtain the port number on which JBoss is listening for HTTP requests (the one that is normally 8080).

我遇到了这个文章,这听起来很有希望,但不幸的是其中一些链接是坏了,我无法弄清楚那部分:

I came upon this article, which sounds promising, but unfortunately some of the links are broken and I cannot figure out the part:

ManagementView managementView = getManagementView(); // via JNDI lookup

如何实现getManagementView()?还是有其他更好的方法呢?

How could I implement getManagementView()? Or is there any other preferable way to do it?

推荐答案

回答我自己的问题,因为我决定了要做什么.

Answering my own question because I decided what to do.

在运行时获取端口信息很麻烦.一个简单的替代方法是拥有一个配置文件,该文件必须与实际端口号(每手)保持同步.不是很聪明,但是可以为您省去很多麻烦!

Obtaining port information at runtime is cumbersome. An easy alternative is to have a config file that must be kept in sync with the actual port number (per hand). Not very clever but it saves you a bunch of headaches!

这篇关于如何在运行时获取端口绑定信息? (JBoss 5.1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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