${log.root}/lowem.log
Inflation, Investing and Everything


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

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]

Comments:

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 SIBOR interest rates fall to 1.5%, lowest since Dec 2004
2. Singapore SIBOR rate falls to 1.31%, lowest since Nov 2004
3. Fuel prices seen stoking Malaysia inflation in 2008
4. Singapore SIBOR rate fell to 1.25% in Apr 2008, lowest since Aug 2004
5. Malaysia inflation rate jumps to 7.7% in Jun 2008, a 26-year record high
6. 2010 Honda Civic Hybrid preliminary specifications released
7. 2009 Honda Global Small Hybrid details released : bigger than Jazz/Fit, smaller than Civic
8. Singapore : Inflation rate could push past 6% in Q1 2008

Featured articles on lowem.log :

1. ABC Guide to Beating Inflation in Singapore and Elsewhere
2. Singapore inflation rate hits new 26-year high of 7.5% in Apr 2008
3. Singapore : Bread price inflation continues
4. 2010 Honda Civic Hybrid preliminary specifications released
5. Peakoiler buys 2008 Honda Civic Hybrid FD3
6. How to insert currency exchange rates into Google Spreadsheets
7. Singapore SIBOR rate fell to 1.25% in Apr 2008, lowest since Aug 2004
8. Singapore : Inflation erodes away bank savings





archives
search
sponsored links





bookmarks

personal
biow
ken
wenn

sites
photo gallery
wiki

blogroll
reviewem
sgenergycrisis
theenergycollective

forums
goldclubasia.com
peakoil.com


navigation
decals

Click for Singapore, Singapore Forecast





rss feed for lowem.log

Get Firefox!

powered by
hosted by