users@glassfish.java.net

Re: How to get glassfish host info for deployed application?

From: <glassfish_at_javadesktop.org>
Date: Fri, 02 Mar 2007 13:27:33 PST

I can partially answer my own question. Nothing to do with glassfish.

I can use

hostName = InetAddress.getLocalHost().getHostName();

to get the host name (although in my local network environment, my Mac OS X is identified with a bogus host name) and

ipAddress = InetAddress.getLocalHost().getHostAddress();

to get the IP address -- this seems to be accurate even for my Mac.

Adding InetAddress and associated exceptions to my import list of course.

This does not give me the port that the wrapping app server is running on.

But at least this is a start to tell running instances apart.
[Message sent by forum member 'jjsban' (jjsban)]

http://forums.java.net/jive/thread.jspa?messageID=206020