users@glassfish.java.net

Re: Instance name in Log Handler?

From: <glassfish_at_javadesktop.org>
Date: Mon, 20 Jul 2009 07:34:19 PDT

> I'm not familiar with jps and jinfo, but either way
> they are not present on our Solaris servers

I am sure they are present as part of your JDK installation (since 1.5 they should be there).

> ... and I'm
> also quite uncertain I want to rely on external
> processes for this... but if I am missing something
> here, please elaborate, I may be misunderstanding (I
> often am).

I did not mean to use the above tools at runtime (which would occur a large overhead),
but just as a easy way to explore which system properties are usually available in your Glassfish.
Maybe you find one which looks like the instance name (I mixed this up with domain).
 
Another more portable way is to use the Admin console and display JVM information.
This is the same content as "jinfo" I guess.

> Since I am in a class that is loaded by Glassfish, is
> there no easier way to get this information via some
> kind of internal API in Glassfish, or even to read
> these system properties with regular Java?

I do hope there is some property. You must find the name (see above) by browsing through all of the system properties of your current Glassfish installation.
[Message sent by forum member 'jthoennes' (jthoennes)]

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