users@glassfish.java.net

Re: Is there a way for code to query what instance it is currently running on?

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Wed, 15 Aug 2012 13:18:56 -0500

If you don't mind using a non-portable interface,
System.getProperty("com.sun.aas.instanceName") returns the instance name.

Tom

On 8/15/2012 12:44 PM, forums_at_java.net wrote:
> Is there a way for code to query what instance it is currently running
> on?
> I'm trying to write some code that needs to be aware of the instance
> it is
> running on in a cluster. I know by using the REST API it is possible
> to find
> out the instances that are active and also the hostnames/ip addresses
> of each
> instance. https://DAS:4848/management/domain/clusters/cluster/{cluster
> id}/get-health https://DAS:4848/management/domain/servers/server
> https://DAS:4848/management/domain/servers/server/{instance id} Thanks
>
> --
>
> [Message sent by forum member 'schaffer1969']
>
> View Post: http://forums.java.net/node/889163
>
>