dev@glassfish.java.net

Re: Example of support for --target option?

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Wed, 02 Jun 2010 15:34:33 -0700

And looking at the
web/admin/src/main/java/org/glassfish/web/admin/cli/CreateNetworkListener.java
that has @Cluster({RuntimeType.DAS, RuntimeType.INSTANCE}) annotation, I still see

     @Param(name = "target", optional = true, defaultValue = "server")
     String target;

with this boiler-plate code:

public void execute(AdminCommandContext context) {
         Server targetServer = domain.getServerNamed(target);
         if (targetServer!=null) {
             config = domain.getConfigNamed(targetServer.getConfigRef());
         }
         com.sun.enterprise.config.serverbeans.Cluster cluster =
domain.getClusterNamed(target);
         if (cluster!=null) {
             config = domain.getConfigNamed(cluster.getConfigRef());
         }


Do we all need all of it?

thanks,
-marina

Marina Vatkina wrote:
> Can it be expanded to be easier understood by CLI dummies (like me)?
>
> thanks,
> -marina
>
> Tom Mueller wrote:
>
>> Please see this writeup by Vijay on how to implement the --target option:
>>
>> http://wiki.glassfish.java.net/Wiki.jsp?page=CLIDeveloperGuide
>>
>> Tom
>>
>> On 6/1/2010 6:04 PM, Marina Vatkina wrote:
>>
>>> Do we have an example of how --target option should be
>>> defaulted/implemented?
>>>
>>> There are multiple cases of annotating the option with
>>> @Param(name = "target", optional = true, defaultValue = "server")
>>>
>>> but I'm wondering if it's safe to hardcode "server" string everywhere...
>>>
>>> thanks,
>>> -marina
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>> --
>> Oracle <http://www.oracle.com>
>> Tom Mueller | Principal Member of Technical Staff
>> Phone: +1 4029169943 | Fax: +1 4029169943 | Mobile: +1 4027206872
>> 21915 Hillandale Dr | Elkhorn, NE 68022
>> Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
>> developing practices and products that help protect the environment
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>