admin@glassfish.java.net

Re: Following glassfish issue that impacts IIOP getting ports from domain.xml was categorized for m4

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Tue, 06 Jul 2010 18:12:39 -0500

On 7/6/2010 5:56 PM, Ken wrote:
> Tom Mueller wrote:
>> Once you have a Server s, call s.getCluster() which returns a
>> Cluster, or null if the instance is not clustered.
>>
>>
> How to I figure out which Server instance in Servers corresponds to my
> instance?
If you inject a Server, you get the one you are on, AFAIK.
>
> Also, I need to know the host name of the server. In my test, the
> attribute node-agent-ref
> was set to the host name. Can I rely on node-agent-ref to always be
> the host name?
Don't assume there is a single host name for a server. There could be
multiple NICs with multiple IP address and multiple hostname.

Get the hostname from the relevant listener, and if it isn't there
because that listener is listening on 0.0.0.0, then there is a
Node.getNodeHost() that can be used. The node-agent-ref is a name for
the node, not a hostname, although often times people name their nodes
with a hostname.

Tom

>
> Thanks,
>
> Ken.
>