dev@glassfish.java.net

Re: Example of support for --target option?

From: Vijay Ramachandran <vijay.ramachandran_at_oracle.com>
Date: Thu, 03 Jun 2010 12:28:57 -0700

Please refer to the recent checkin that Byron made where he has
implemented a few DuckTyped methods to make it easy for everyone to
avoid bioler plate code. Also, I just checked in a Target type which you
can get from Habitat and use those services to avoid boiler plate code.

There are some duplications (which will be removed soon) and more
"services" will be added in Target. Please let me know what more you
would like to see in Target "service".

Vijay

On 6/2/10 3:34 PM, Marina Vatkina wrote:
> 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
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>