FileDocCategorySizeDatePackage
UndeployTask.javaAPI DocGlassfish v2 API7999Fri May 04 22:32:42 BST 2007org.apache.tools.ant.taskdefs.optional.sun.appserv

UndeployTask

public class UndeployTask extends ComponentAdmin
This task undeploys J2EE components from the Sun ONE Application Server 7. The following components may be undeployed:
  • Enterprise application
  • Web application
  • Enterprise Java Bean
  • Enterprise connector
  • Application client

The archive is not required to undeploy a component -- only the component name and type are required. The component archive may be used, however, as it implies the component name.

see
AppServerAdmin
see
ComponentAdmin
author
Greg Nelson gn@sun.com

Fields Summary
private static final String
UNDEPLOY_COMMAND
LocalStringsManager
lsm
private boolean
droptables
private boolean
droptablesIsSet
private boolean
cascade
private boolean
cascadeIsSet
Constructors Summary
Methods Summary
protected voidcheckComponentConfig(Server aServer, Component comp)


	      
			  
		super.checkComponentConfig(aServer, comp);

		// name must be valid string
		String theName = comp.getName();
		if ((theName == null) || (theName.length() == 0)) {
            final String msg = lsm.getString("InvalidComponentName", new Object [] {theName});
			throw new BuildException(msg, getLocation());
		}
	
protected java.lang.StringgetCommandString(Server server, Component comp)

		StringBuffer cmdString = new StringBuffer(UNDEPLOY_COMMAND);
		cmdString.append(server.getCommandParameters(true));
		if (comp.getType() != null) {
            log(lsm.getString("DeprecatedTypeAttribute"), Project.MSG_WARN);
		}
        if (droptablesIsSet) {
            cmdString.append(" --droptables=").append(droptables);
            droptablesIsSet = false;
		}
        if (cascade) {
            cmdString.append(" --cascade=").append(cascade);
            cascadeIsSet = false;
		}

		// check the value and append target
		String lTarget = comp.getTarget();
		if ((lTarget != null) && (lTarget.length() > 0)) {
	    		cmdString.append(" --target ").append(lTarget);
		}

		cmdString.append(" ").append(comp.getName());

		return cmdString.toString();
	
public voidsetCascade(boolean casacde)
Set cascade. If true, it deletse all the connection pools and connector resources associated with the resource adapter. If false, the undeploy fails if any pools and resources are still associated with the resource adapter.

param
cascade

		this.cascade = cascade;
        cascadeIsSet = true;
	
public voidsetDroptables(boolean droptables)
Drops tables at undeploy of already deployed application with unmapped CMP beans.

param
droptables

		this.droptables = droptables;
        droptablesIsSet = true;