dev@glassfish.java.net

Re: implementing a cli command

From: Joe Di Pol <joe.dipol_at_oracle.com>
Date: Fri, 30 Jul 2010 08:10:54 -0700

Bobby,

When I joined the team and started sorting through this I wrote this
page which, I think, is reasonably accurate (although it could use
some updating):

http://wikis.sun.com/display/GlassFish/V3CLILandscape

You extend CLICommand when you want to write a local command that
runs only in asadmin (not in the DAS).

You implement AdminCommand when you want to write a remote command
that runs in the DAS. The admin framework takes care of all the
wiring that needs to happen to make your command known and
invokable via asadmin.

Your case sounds like the later case -- a remote command.

Hope this helps,

Joe


Bobby Bissett wrote:
> Howdy,
>
> Am starting on an 'asadmin get-health' command, which just needs to talk
> to the das to query gms to get some server state. I'm confused about
> where to start: what's the difference between
> org.glassfish.api.admin.AdminCommand vs
> com.sun.enterprise.admin.cli.CLICommand?
>
> The code differences are fairly obvious, but not the reasoning. I don't
> see offhand why I should implement AdminCommand vs extending CLICommand.
> Am starting with the latter, but if someone knows I'm on the wrong path,
> let me know.
>
> Thanks,
> Bobby
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>