Inflation, Investing and Everything

All | Energy | Java | Tech | Musings | Env | Biz

AddThis Feed Button
20050908 Thursday September 08, 2005

WebLogic Domain/Cluster runtime information

mttech.com, samspublishing.com :

Needed a "proper" way to get the ListenAddress and ListenPort settings that were defined in the WebLogic server's config.xml file (besides opening and parsing the darn file directly, of course, lol). The links above include code for a servlet called InfoCluster which can be adapted to do just that.

This stemmed from a requirement to get the "localhost" address for a multi-homed server. If you just do an InetAddress.getLocalHost(), it appears that, for a multi-homed machine (one with more than one local IP address, due to multiple network cards or virtual adaptors), you will get just one of the available IP addresses, and the order of obtaining that address is implementation-specific to the JDK you're using (!)

On the other hand, obtaining the "ListenAddress" this way now makes the code WebLogic-specific (you know - gain some, lose some). Another way might be to use your system's configuration mechanism (whatever it is) and just do a config.getString() (for example - whatever the API is). And *then* your configuration mechanism will have to take care of deployment onto different machines - which, hopefully, at this point, it is not *your* problem :)

(2005-09-08 13:11:00 SGT) [Java] Permalink Comments [2]


Something like this:

Context ctx = new InitialContext();
MBeanHome home = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
Set clusters = home.getMBeansByType("Cluster");
for (Iterator iterator = clusters.iterator(); iterator.hasNext();)
ClusterMBean cluster = (ClusterMBean) iterator.next();
ServerMBean[] servers = cluster.getServers();
for (int i = 0; i < servers.length; i++)
ServerMBean server = servers[i];
String address = server.getListenAddress();
int port = server.getListenPort();
String name = server.getName();



Posted by Dmitri Colebatch on September 08, 2005 at 03:41 PM SGT #

Check out http://www.j2eegeek.com/blog/2004/09/23/weblogic-and-jmx/

Posted by Vinny Carpenter on September 09, 2005 at 03:57 AM SGT #

Post a Comment:

Comments are closed for this entry.

Most popular blog postings on lowem.log :

1. Singapore MRT rail network length to double by 2020
2. 2010 Nissan Leaf electric car specifications : 107hp, 24KWh lithium-ion batteries, 100-mile range
3. Live spot gold price quotes chart on COMEX
4. 2010 Toyota Prius specifications released : 50 mpg, 1.8L, 134hp, Ni-MH, solar roof option
5. AVG Anti-Virus Free Edition 2011 direct download link
6. Real-time live gold and silver price quotes chart on COMEX
7. Singapore electric vehicles : Government agencies EMA and LTA to study EV introduction
8. Book review : Shut Down by William Flynn

Featured articles on lowem.log :

1. Book review : Shut Down by William Flynn
2. Singapore electric cars testing starts with 9 electric vehicles
3. Honda, GS Yuasa JV to make lithium-ion batteries for 2010/2011 Honda Civic Hybrid
4. 2010 Honda Civic Hybrid preliminary specifications released
5. 2010 Honda CR-Z hybrid, 2010 Honda Fit/Jazz hybrid models confirmed
6. 2010 Toyota Prius specifications released : 50 mpg, 1.8L, 134hp, Ni-MH, solar roof option
7. NYMEX crude oil recovers from $32.40 low after 2.2 mbpd OPEC production cut announced
8. Singapore : Nuclear power not ruled out

sponsored links


my profile
contact me


live oil prices
live gold prices

live forex rates
live oil chart
live brent crude chart
live gold chart
live silver chart

crude oil chart
gold chart
silver chart


Click for Singapore, Singapore Forecast

rss feed for lowem.log

Get Firefox!

powered by
hosted by