Sun GlassFish Enterprise Server v3 Prelude Add-On Component Development Guide

Representing an asadmin Command as a Java Class

Each asadmin command that you are adding must be represented as a Java class. To represent an asadmin command as a Java class, write a Java class that implements the org.glassfish.api.admin.AdminCommand interface. Write one class for each command that you are adding. Do not represent multiple asadmin commands in a single class.

Annotate the declaration of your implementations of the AdminCommand interface with the org.jvnet.hk2.annotations.Service annotation. The @Service annotation ensures that the following requirements for your implementations are met: