Oracle GlassFish Server 3.0.1 Application Development Guide

The sun-appserv-admin Task

Enables arbitrary administrative commands and scripts to be executed on the GlassFish Server. This is useful for cases where a specific Ant task has not been developed or a set of related commands are in a single script.

Subelements of sun-appserv-admin

The following table describes subelements for the sun-appserv-admin task. These are objects upon which this task acts.

Table 3–9 The sun-appserv-admin Subelements

Element 

Description 

The server Subelement

A GlassFish Server instance 

Attributes of sun-appserv-admin

The following table describes attributes for the sun-appserv-admin task.

Table 3–10 The sun-appserv-admin Attributes

Attribute 

Default 

Description 

command

none 

(exactly one of these is required: command or explicitcommand) The command to execute. If the user, passwordfile, host, port, or target attributes are also specified, they are automatically inserted into the command before execution. If any of these options are specified in the command string, the corresponding attribute values are ignored.

explicitcommand

none 

(exactly one of these is required: command or explicitcommand) The exact command to execute. No command processing is done, and all other attributes are ignored.

user

admin

(optional) The user name used when logging into the GlassFish Server administration instance. This attribute is inherited by nested server elements.

passwordfile

none 

(optional) File containing passwords. The password from this file is retrieved for communication with the GlassFish Server administration instance. This attribute is inherited by nested server elements.

host

localhost

(optional) Target server. If it is a remote server, use the fully qualified host name. This attribute is inherited by nested server elements.

port

4848

(optional) The administration port on the target server. This attribute is inherited by nested server elements.

asinstalldir

see description 

(optional) The installation directory for the local GlassFish Server installation, which is used to find the administrative classes. If not specified, the command checks if the asinstalldir parameter has been set. Otherwise, administrative classes must be in the system classpath.

Examples of sun-appserv-admin

Here is an example of executing the create-jms-dest command:

<sun-appserv-admin command="create-jms-dest --desttype topic">

Here is an example of using explicitcommand to execute the create-jms-dest command:

<sun-appserv-admin explicitcommand="create-jms-dest --desttype topic --target server1 simpleJmsDest">