admin@glassfish.java.net

Re: How do you know if you are a DAS?

From: Byron Nevins <byron.nevins_at_oracle.com>
Date: Fri, 22 Apr 2011 10:35:55 -0700

This touches on the #1 error, IMO, in the development of 3.1 and
clustering: No architecture or planning at all for these fundamental
up-front questions like -- am I DAS or an instance? What clusters and
instances are running? etc.

What I added in ServerEnvironmentalImpl was ad hoc. We had to have
*something* and I thought that matching the name="server" stunk.
Launcher adds a -type flag. 100% Guarantee. Did you notice that
implied assumption:

If launcher is NOT used to start (e.g. java -jar glassfish.jar) then,
probably, the server will be marked as DAS.
If the user starts DAS without launcher and passes in a -type arg to
ASMain of instance or nodeagent or embedded -- then we have problems.

I.e. if you use launcher to start we guarantee correct "typing" of the
server. If you don't use launcher all bets are off.


On 4/21/2011 12:57 PM, Tom Mueller wrote:
> I've been looking into how a DAS determines that it's a DAS, and I'm
> seeing some different approaches:
>
> 1. Calling Server.isDas() - this method looks at the instance name; if
> it's "server" then return true.
>
> 2. Using the "-type" argument that is passed when the JVM is
> launched. start-domain passes in DAS, start-local-instance passes in
> INSTANCE.
>
> 3. Calling Server.getName() and doing the comparison to "server"
> directly, rather than calling isDas().
>
> Do you know of other ways that code determines whether it is running
> on the DAS?
>
> I'd like to move in the direction of consolidating this behavior, so
> that we have exactly one way of determining the role that the server
> is filling. Thoughts?
>
> Thanks.
> Tom
>

-- 
Oracle <http://www.oracle.com>
Byron Nevins | Principal MTS
Phone: +1 6503958992 <tel:+1%206503958992>
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to 
developing practices and products that help protect the environment