Oracle GlassFish Server 3.0.1 Add-On Component Development Guide

Enabling an asadmin Subcommand to Run

To enable an asadmin subcommand to run, implement the execute method in your implementation of the AdminCommand interface. The declaration of the execute method in your implementation must be as follows.

    public void execute(AdminCommandContext context);

Pass each parameter of the subcommand as a property to your implementation of the execute method. Set the key of the property to the parameter name and set the value of the property to the parameter's value.

In the body of the execute method, provide the code for performing the operation that the command was designed to perform. For examples, see Example 4–6 and Example 4–7.