Exit Print View

Sun GlassFish Enterprise Server v3 Add-On Component Development Guide

  This Document Entire Library
Print View

Document Information

Preface

1.   Introduction to the Development Environment for Enterprise Server Add-On Components

2.  Writing HK2 Components

3.  Extending the Administration Console

4.  Extending the asadmin Utility

About the Administrative Command Infrastructure of Enterprise Server

Adding an asadmin Command

Representing an asadmin Command as a Java Class

Specifying the Name of an asadmin Command

Ensuring That an AdminCommand Implementation Is Stateless

Example of Adding an asadmin Command

Adding Parameters to an asadmin Command

Representing a Parameter of an asadmin Command

Identifying a Parameter of an asadmin Command

Specifying Whether a Parameter Is an Option or an Operand

Specifying the Name of an Option

Specifying the Long Form of an Option Name

Specifying the Short Form of an Option Name

Specifying the Acceptable Values of a Parameter

Specifying the Default Value of a Parameter

Specifying Whether a Parameter Is Required or Optional

Example of Adding Parameters to an asadmin Command

Adding Message Text Strings to an asadmin Command

Enabling an asadmin Command to Run

Setting the Context of an asadmin Command

Changing the Brand in the Enterprise Server CLI

Examples of Extending the asadmin Utility

5.  Adding Container Capabilities

6.  Packaging, Integrating, and Delivering an Add-On Component

A.  Integration Point Reference

Index

Enabling an asadmin Command to Run

To enable an asadmin command 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 command 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.