com.ibm.websphere.ant.tasks

Class WsAdmin

  1. java.lang.Object
  2. extended byTask
  3. extended bycom.ibm.websphere.ant.tasks.WsAdmin
Direct known subclasses:
InstallApplication, ListApplications, StartApplication, StopApplication, UninstallApplication

  1. public class WsAdmin
  2. extends Task
The wsadmin task executes the WebSphere command-line administration tool with the specified arguments. The structure of the wsadmin task is shown below: <wsadmin washome="location of websphere installation" command="command to be passed to the script processor" properties="java properties file containing attributes to set in the jvm system properties" profile="a script file to be executed before the main command or file" profilename="the profile name of the desired server" script="a set of commands in a file to be passed to the script processor" lang="the language to be used to interpret scripts." conntype="specifies the type of connection to be used." host="the host to connect to" port="the port on the host to connect to" user="user id to authenticate with" password="password to authenticate with jvmMaxMemory="256m" fileencoding="utf8" failonerror="true | false"> <arg value=""/> . . . <arg value=""/> </wsadmin> The wasHome attribute is optional and contains the location of the WebSphere Installation Directory.
The command attribute is required, unless script is specified, and it contains the command to be passed to the script processor
The properties attribute is optional and it contains a java properties file containing attributes to set in the JVM System properties
The profile attribute is optional and it contains a script file to be executed before the main command or file
The profileName attribute is optional and it contains the name of the server profile to be used
The script attribute is required, unless command is specified, and it contains a set of commands in a file to be passed to the script processor
The lang attribute is optional and it contains the language to be used to interpret scripts. The supported values are jacl, and jython.
The conntype attribute is optional and it specifies the type of connection to be used. The Default type is SOAP. The valid values are SOAP, RMI, and NONE. NONE means that no server connection is made. The host attribute is optional and only specified if the conntype is specified. It contains the hostname of the machine to connect to
The port attribute is optional and only specified if the conntype is specified. It contains the port on the host to connect to
The user attribute is optional and contains the user ID to authenticate with
The password attribute is optional and contains the password to authenticate with
The jvmMaxMemory attribute is optional and sets maximum size of the memory for the underlying VM. Defaults to 256M
The failonerror attribute is optional. When this is specified the build will fail if any exception is thrown. The default is false.
The fileEncoding attribute is optional and sets the file.encoding System Property for the underlying VM.

The task can contain 0 or more nested arg elements that contain arguments that are passed to the script.


To use this task, add the following to your Ant build.xml <taskdef name="wsadmin" classname="com.ibm.websphere.ant.tasks.WsAdmin"/>

Constructor Summary

Constructor and Description
WsAdmin()
Constructor for WsEjbDeploy

Method Summary

Modifier and Type Method and Description
  1. Commandline.Argument
createArg()
Creates a nested arg element.
  1. Commandline.Argument
createJvmarg()
Creates a nested jvmArg element.
  1. void
execute()
  1. boolean
isDebug()
  1. void
setCommand(java.lang.String command)
Sets the command.
  1. void
setConntype(java.lang.String conntype)
Sets the conntype.
  1. void
setDebug(boolean debug)
  1. void
setFailonerror(boolean failonerror)
Sets the failonerror.
  1. void
setFileEncoding(java.lang.String fileEncoding)
  1. void
setHost(java.lang.String host)
Sets the host.
  1. void
setJvmMaxMemory(java.lang.String jvmMaxMemory)
Sets the jvmMaxMemory.
  1. void
setLang(java.lang.String lang)
Sets the lang.
  1. void
setPassword(java.lang.String password)
Sets the password.
  1. void
setPort(java.lang.String port)
Sets the port.
  1. void
setProfile(java.lang.String profile)
Sets the profile.
  1. void
setProfileName(java.lang.String string)
Sets the server profile name.
  1. void
setProperties(java.lang.String properties)
Sets the properties.
  1. void
setScript(java.lang.String script)
Sets the script.
  1. void
setUser(java.lang.String user)
Sets the user.
  1. void
setWasHome(java.lang.String wasHome)
Sets the wasHome.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WsAdmin

  1. public WsAdmin()
Constructor for WsEjbDeploy

Method Detail

execute

  1. public void execute()
  2. throws BuildException
Throws:
BuildException
See Also:
Task#execute()

setWasHome

  1. public void setWasHome(java.lang.String wasHome)
Sets the wasHome.
Parameters:
wasHome - The wasHome to set

setFailonerror

  1. public void setFailonerror(boolean failonerror)
Sets the failonerror.
Parameters:
failonerror - The failonerror to set

setCommand

  1. public void setCommand(java.lang.String command)
Sets the command.
Parameters:
command - The command to set

setProperties

  1. public void setProperties(java.lang.String properties)
Sets the properties.
Parameters:
properties - The properties to set

setProfile

  1. public void setProfile(java.lang.String profile)
Sets the profile.
Parameters:
profile - The profile to set

setProfileName

  1. public void setProfileName(java.lang.String string)
Sets the server profile name.

setScript

  1. public void setScript(java.lang.String script)
Sets the script.
Parameters:
script - The script to set

setLang

  1. public void setLang(java.lang.String lang)
Sets the lang.
Parameters:
lang - The lang to set

setConntype

  1. public void setConntype(java.lang.String conntype)
Sets the conntype.
Parameters:
conntype - The conntype to set

setHost

  1. public void setHost(java.lang.String host)
Sets the host.
Parameters:
host - The host to set

setPort

  1. public void setPort(java.lang.String port)
Sets the port.
Parameters:
port - The port to set

setUser

  1. public void setUser(java.lang.String user)
Sets the user.
Parameters:
user - The user to set

setPassword

  1. public void setPassword(java.lang.String password)
Sets the password.
Parameters:
password - The password to set

createArg

  1. public Commandline.Argument createArg( )
Creates a nested arg element.

createJvmarg

  1. public Commandline.Argument createJvmarg( )
Creates a nested jvmArg element.

setJvmMaxMemory

  1. public void setJvmMaxMemory(java.lang.String jvmMaxMemory)
Sets the jvmMaxMemory.
Parameters:
jvmMaxMemory - The JVM MaxMemory to set

setDebug

  1. public void setDebug(boolean debug)
Parameters:
debug -

isDebug

  1. public boolean isDebug()
Returns:

setFileEncoding

  1. public void setFileEncoding(java.lang.String fileEncoding)
Parameters:
fileEncoding - The fileEncoding to set.