admin@glassfish.java.net

Re: stop-domain

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Thu, 27 Aug 2009 13:51:45 -0700

I haven't gotten any feedback on this...

I implemented this and ran into a few issues.

Bill Shannon wrote on 8/26/09 9:13 PM:
> I'm thinking about how stop-domain should work and looking at this bug:
> https://glassfish.dev.java.net/issues/show_bug.cgi?id=9229
>
> Unlike v2, stop-domain is supposed to work both locally and remotely,
> and I'm trying to figure out how this should work while also fixing
> the bug above. I'd appreciate any feedback on my thinking...
>
> Things to consider:
>
> Was a host specified (with --host or AS_ADMIN_HOST)?
> Was a domain name operand specified?
> How many local domains are there?
>
> Based on the above, do we do a local operation, remote operation,
> or is it an error?
>
> Here's the table of cases and results:
>
> --host N N N N N N Y Y Y Y Y Y
> domain operand N N N Y Y Y N N N Y Y Y
> domains 0 1 >1 0 1 >1 0 1 >1 0 1 >1
> local/rem/err E L E E L L R R R E E E
>
> Does that look right? Am I missing any important cases?
>
> Should explicitly specifying "--host localhost" be the same as or different
> than not specifying a host name and allowing it to default?

It was easiest to handle it the same, so that's what I did.

> Should specifying --port in the local case be an error or just ignored?

I ignored it.

> For the local case...
>
> - there *must* be a local password
> - the local password is always used
> - the host is always localhost and the port comes from domain.xml
> - authentication must succeed
> - the local password is passed as an operand to the stop-domain remote command
> - the server stop-domain command checks that the operand is the local password

The remote stop-domain command is marked @Async, so it can't return
failure. I decided instead to use the __locations command that I
also used in list-domains to make sure the domain was the correct one
before asking it to stop.

> For the remote case...
>
> - local domain information is ignored
> - the host name and port number are used
> - the user name and password are specified or defaulted
> - authentication must succeed
> - the stop-domain remote command gets no operand
> - with no operand, the stop-domain server command always stops
>
>
> Should restart-domain use the same approach?

I think it should. Any reason not to? I'm going to do that next.