Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.j2ee

public Class WebLogicHotDeploymentTool

extends AbstractHotDeploymentTool
implements HotDeploymentTool
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool
Imports
org.apache.tools.ant.BuildException, org.apache.tools.ant.taskdefs.Java

An Ant wrapper task for the weblogic.deploy tool. This is used to hot-deploy J2EE applications to a running WebLogic server. This is not the same as creating the application archive. This task assumes the archive (EAR, JAR, or WAR) file has been assembled and is supplied as the "source" attribute.

In the end, this task assembles the commandline parameters and runs the weblogic.deploy tool in a separate JVM.

See Also
org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool, org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool, org.apache.tools.ant.taskdefs.optional.j2ee.ServerDeploy

Field Summary

Modifier and TypeField and Description
private String
application

The application name that is being deployed

private String
component

The component name:target(s) for the "-component" argument of weblogic.deploy

private boolean
debug

Represents the "-debug" flag from weblogic.deploy

private static final int
private static final String[]
VALID_ACTIONS

All the valid actions that weblogic.deploy permits

private static final String
WEBLOGIC_DEPLOY_CLASS_NAME

The classname of the tool to run

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected StringBuffer

Returns:

A StringBuffer containing the prefix arguments. The action-specific build methods will append to this StringBuffer.
buildArgsPrefix
()

Builds the prefix arguments to pass to weblogic.deploy.

protected String

Returns:

A String containing the full argument string for weblogic.deploy.
buildDeployArgs
()

Builds the arguments to pass to weblogic.deploy for deployment actions ("deploy" and "update").

protected String

Returns:

A String containing the full argument string for weblogic.deploy.
buildListArgs
()

Builds the arguments to pass to weblogic.deploy for the list action

protected String

Returns:

A String containing the full argument string for weblogic.deploy.
buildUndeployArgs
()

Builds the arguments to pass to weblogic.deploy for undeployment actions ("undeploy" and "delete").

public void
public String

Returns:

A String containing the arguments for the weblogic.deploy tool.
getArguments
()

Builds the arguments to pass to weblogic.deploy according to the supplied action.

protected boolean

Returns:

true if the action attribute is valid, false if not.
isActionValid
()

Implements abstract org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool.isActionValid.

Determines if the action supplied is valid.
public void
setApplication(String
A String representing the application portion of the weblogic.deploy command line.
application
)

The name of the application being deployed; required.

public void
setComponent(String
A String representing the value of the "-component" argument of the weblogic.deploy command line argument.
component
)

the component string for the deployment targets; optional.

public void
setDebug(boolean
A boolean representing weblogic.deploy "-debug" flag.
debug
)

If set to true, additional information will be printed during the deployment process; optional.

public void
Inherited from org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool:
createClasspathgetClasspathgetPasswordgetServergetTaskgetUserNamesetClasspathsetPasswordsetServersetTasksetUserName

Field Detail

applicationback to summary
private String application

The application name that is being deployed

componentback to summary
private String component

The component name:target(s) for the "-component" argument of weblogic.deploy

debugback to summary
private boolean debug

Represents the "-debug" flag from weblogic.deploy

STRING_BUFFER_SIZEback to summary
private static final int STRING_BUFFER_SIZE
VALID_ACTIONSback to summary
private static final String[] VALID_ACTIONS

All the valid actions that weblogic.deploy permits

WEBLOGIC_DEPLOY_CLASS_NAMEback to summary
private static final String WEBLOGIC_DEPLOY_CLASS_NAME

The classname of the tool to run

Constructor Detail

WebLogicHotDeploymentToolback to summary
public WebLogicHotDeploymentTool()

Method Detail

buildArgsPrefixback to summary
protected StringBuffer buildArgsPrefix()

Builds the prefix arguments to pass to weblogic.deploy. These arguments are generic across all actions.

Returns:StringBuffer

A StringBuffer containing the prefix arguments. The action-specific build methods will append to this StringBuffer.

buildDeployArgsback to summary
protected String buildDeployArgs()

Builds the arguments to pass to weblogic.deploy for deployment actions ("deploy" and "update").

Returns:String

A String containing the full argument string for weblogic.deploy.

buildListArgsback to summary
protected String buildListArgs()

Builds the arguments to pass to weblogic.deploy for the list action

Returns:String

A String containing the full argument string for weblogic.deploy.

buildUndeployArgsback to summary
protected String buildUndeployArgs()

Builds the arguments to pass to weblogic.deploy for undeployment actions ("undeploy" and "delete").

Returns:String

A String containing the full argument string for weblogic.deploy.

deployback to summary
public void deploy()

Implements org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool.deploy.

Perform the actual deployment. For this implementation, a JVM is spawned and the weblogic.deploy tools is executed.

Annotations
@Override
Exceptions
BuildException:
if the attributes are invalid or incomplete.
getArgumentsback to summary
public String getArguments() throws BuildException

Builds the arguments to pass to weblogic.deploy according to the supplied action.

Returns:String

A String containing the arguments for the weblogic.deploy tool.

Exceptions
BuildException:
if there is an error.
isActionValidback to summary
protected boolean isActionValid()

Implements abstract org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool.isActionValid.

Determines if the action supplied is valid.

Valid actions are contained in the static array VALID_ACTIONS

Returns:boolean

true if the action attribute is valid, false if not.

Annotations
@Override
setApplicationback to summary
public void setApplication(String application)

The name of the application being deployed; required.

Parameters
application:String

A String representing the application portion of the weblogic.deploy command line.

setComponentback to summary
public void setComponent(String component)

the component string for the deployment targets; optional. It is in the form <component>:<target1>,<target2>... Where component is the archive name (minus the .jar, .ear, .war extension). Targets are the servers where the components will be deployed

Parameters
component:String

A String representing the value of the "-component" argument of the weblogic.deploy command line argument.

setDebugback to summary
public void setDebug(boolean debug)

If set to true, additional information will be printed during the deployment process; optional.

Parameters
debug:boolean

A boolean representing weblogic.deploy "-debug" flag.

validateAttributesback to summary
public void validateAttributes() throws BuildException

Overrides org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool.validateAttributes.

Implements org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool.validateAttributes.

Validates the passed in attributes.

The rules are:

  1. If action is "deploy" or "update" the "application" and "source" attributes must be supplied.
  2. If action is "delete" or "undeploy" the "application" attribute must be supplied.
Annotations
@Override
Exceptions
BuildException:
if the attributes are invalid or incomplete