Sun GlassFish Enterprise Server v3 Add-On Component Development Guide

Example of Adding Parameters to an asadmin Subcommand


Example 4–2 Adding Parameters to an asadmin Subcommand

This example shows the code for adding parameters to an asadmin subcommand with the properties as shown in the table.

Name 

Represented As 

Acceptable Values 

Default Value 

Optional or Required 

Short Name 

Option or Operand 

--originator

A field that is named originator

Any character string 

None defined 

Required 

None 

Option 

--description

A field that is named mycontainerDescription

Any character string 

None defined 

Optional 

None 

Option 

--enabled

A field that is named enabled

true or false

false

Optional 

None 

Option 

--containername

A field that is named containername

Any character string 

None defined 

Required 

None 

Operand 

...
import org.glassfish.api.Param;
...
{
…
    @Param
    String originator;
    
    @Param(name="description", optional=true)
    …
    String mycontainerDescription
    
    @Param (acceptableValues="true,false", defaultValue="false", optional=true)
    String enabled
    
    @Param(primary=true)
    String containername;
…
}