com.ibm.websphere.ant.tasks
Class WsAdmin
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- com.ibm.websphere.ant.tasks.WsAdmin
-
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- InstallApplication, ListApplications, StartApplication, StopApplication, UninstallApplication
public class WsAdmin extends org.apache.tools.ant.Task
The wsadmin task executes the WebSphere command-line administration tool with the specified arguments. The structure of the wsadmin task is shown below:. . .
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
-
-
Constructor Summary
Constructors Constructor and Description WsAdmin()
Constructor for WsEjbDeploy
-
Method Summary
Methods Modifier and Type Method and Description org.apache.tools.ant.types.Commandline.Argument
createArg()
Creates a nested arg element.org.apache.tools.ant.types.Commandline.Argument
createJvmarg()
Creates a nested jvmArg element.void
execute()
boolean
isDebug()
void
setCommand(java.lang.String command)
Sets the command.void
setConntype(java.lang.String conntype)
Sets the conntype.void
setDebug(boolean debug)
void
setFailonerror(boolean failonerror)
Sets the failonerror.void
setFileEncoding(java.lang.String fileEncoding)
void
setHost(java.lang.String host)
Sets the host.void
setJvmMaxMemory(java.lang.String jvmMaxMemory)
Sets the jvmMaxMemory.void
setLang(java.lang.String lang)
Sets the lang.void
setPassword(java.lang.String password)
Sets the password.void
setPort(java.lang.String port)
Sets the port.void
setProfile(java.lang.String profile)
Sets the profile.void
setProfileName(java.lang.String string)
Sets the server profile name.void
setProperties(java.lang.String properties)
Sets the properties.void
setScript(java.lang.String script)
Sets the script.void
setUser(java.lang.String user)
Sets the user.void
setWasHome(java.lang.String wasHome)
Sets the wasHome.-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildException
- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
- See Also:
Task.execute()
-
setWasHome
public void setWasHome(java.lang.String wasHome)
Sets the wasHome.- Parameters:
wasHome
- The wasHome to set
-
setFailonerror
public void setFailonerror(boolean failonerror)
Sets the failonerror.- Parameters:
failonerror
- The failonerror to set
-
setCommand
public void setCommand(java.lang.String command)
Sets the command.- Parameters:
command
- The command to set
-
setProperties
public void setProperties(java.lang.String properties)
Sets the properties.- Parameters:
properties
- The properties to set
-
setProfile
public void setProfile(java.lang.String profile)
Sets the profile.- Parameters:
profile
- The profile to set
-
setProfileName
public void setProfileName(java.lang.String string)
Sets the server profile name.- Parameters:
profileName
- The server profile name to set
-
setScript
public void setScript(java.lang.String script)
Sets the script.- Parameters:
script
- The script to set
-
setLang
public void setLang(java.lang.String lang)
Sets the lang.- Parameters:
lang
- The lang to set
-
setConntype
public void setConntype(java.lang.String conntype)
Sets the conntype.- Parameters:
conntype
- The conntype to set
-
setHost
public void setHost(java.lang.String host)
Sets the host.- Parameters:
host
- The host to set
-
setPort
public void setPort(java.lang.String port)
Sets the port.- Parameters:
port
- The port to set
-
setUser
public void setUser(java.lang.String user)
Sets the user.- Parameters:
user
- The user to set
-
setPassword
public void setPassword(java.lang.String password)
Sets the password.- Parameters:
password
- The password to set
-
createArg
public org.apache.tools.ant.types.Commandline.Argument createArg()
Creates a nested arg element.
-
createJvmarg
public org.apache.tools.ant.types.Commandline.Argument createJvmarg()
Creates a nested jvmArg element.
-
setJvmMaxMemory
public void setJvmMaxMemory(java.lang.String jvmMaxMemory)
Sets the jvmMaxMemory.- Parameters:
jvmMaxMemory
- The JVM MaxMemory to set
-
setDebug
public void setDebug(boolean debug)
- Parameters:
debug
-
-
isDebug
public boolean isDebug()
- Returns:
-
setFileEncoding
public void setFileEncoding(java.lang.String fileEncoding)
- Parameters:
fileEncoding
- The fileEncoding to set.
-
-