Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Developer's Guide

sun-appserv-admin

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

Subelements

none

Attributes

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

Table 3–11 sun-appserv-admin Attributes

Attribute  

Default  

Description  

command

none 

(exactly one of these is required: command, commandfile, or explicitcommand) The command to execute. If the user, passwordfile, host, or port 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.

commandfile

none 

(exactly one of these is required: command, commandfile, or explicitcommand) Deprecated. The command script to execute. If commandfile is used, the values of all other attributes are ignored. Be sure to end the script referenced by commandfile with the exit command; if you omit exit, the Ant task might appear to hang after the command script is called.

explicitcommand

none 

(exactly one of these is required: command, commandfile, 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 application server. 

password

none 

(optional) Deprecated, use passwordfile instead. The password used when logging into the application server.

passwordfile

none 

(optional) File containing passwords. The password from this file is retrieved for communication with the application server. If both password and passwordfile are specified, passwordfile takes precedence.

host

localhost

(optional) Target server. If it is a remote server, use the fully qualified host name. 

port

4848 

(optional) The administration port on the target server. 

asinstalldir

see description 

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

sunonehome

see description 

(optional) Deprecated. Use asinstalldir instead.

Examples

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 commandfile to execute the create-jms-dest command:

<sun-appserv-admin commandfile="create_jms_dest.txt" instance="development">

The create_jms_dest.txt file contains the following:

create-jms-dest --user admin --passwordfile "${passwordfile}" --host 
localhost --port 4848 --desttype topic --target server1 simpleJmsDest

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

<sun-appserv-admin command="create-jms-dest --user admin --passwordfile 
"${passwordfile}" --host localhost --port 4848 --desttype topic 
--target server1 simpleJmsDest">