dev@glassfish.java.net

Re: getting server-config in an instance

From: Tom Mueller <tom.mueller_at_ORACLE.COM>
Date: Wed, 21 Sep 2011 15:33:03 -0500

Currently no.

When an instance reads the domain.xml file, it only reads in its own
config, it's own cluster, and the server elements that are in its own
cluster. The "server-config" and the "server" <server> element are never
read in by an instance.

This behavior is implemented by the InstanceReaderFilter which is only
used on instances. The DAS uses the DasReaderFilter. The choice
between these is made by the DomainXml class. These are all in the
admin/config-api module.

We have several options for fixing this as we work towards a cluster
that includes the DAS and eventually a floating DAS. One is to include
the DAS server-ref in the cluster element. Also, we may not want to have
the DAS be special (always named "server") and give the DAS a normal
instance name.

Tom

On 9/21/2011 3:16 PM, Bobby Bissett wrote:
> Hi all,
>
> From an instance starting up, I'm trying to get the DAS's host name
> and gms port so that the instance can connect to the DAS without
> multicast. I can get the host name just fine from the das.properties
> file, but can't reach the port info for some reason. The server config
> contains this sys prop, which I'm trying to read:
>
> <configs>
> <config name="server-config">
> <system-property name="GMS_LISTENER_PORT-clus"
> value="9090"></system-property>
> etc.
>
> In the gms adapter, I'm injecting the domain object, and am trying:
>
> Config serverConf =
> domain.getConfigNamed("server-config");
>
> ...but this is always null. If I iterate over the configs in
> domain.getConfigs().getConfig(), the only config that shows up is the
> cluster one, "clus-config" in this case.
>
> Can an instance not read the das's configuration info?
>
> Thanks,
> Bobby
>