Methods Summary |
---|
private void | CheckForMutuallyExclusiveAttribute(org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask$DeployComponent deployComp)This private class checks for any mutually exclusive attributes.
If mutually exclusive attributes that are specified, then a
BuildException is thrown.
if (deployComp.createtablesIsSet &&
deployComp.dropandcreatetablesIsSet ) {
final String msg = lsm.getString("MutuallyExclusivelyAttribute",
new Object[] {"createtables",
"dropandcreatetables"});
throw new BuildException(msg, getLocation());
}
|
protected void | checkComponentConfig(Server aServer, Component comp)
log("Checking component and server config in DeployTask", Project.MSG_DEBUG);
DeployServer deployServer = (DeployServer) aServer;
DeployComponent deployComp = (DeployComponent) comp;
// file must be specified
File theFile = comp.getFile();
if (theFile == null) {
throw new BuildException(lsm.getString("ComponentFileMustBeSpecified",
new Object[] {getTaskName()}), getLocation());
}
/*
* The file attribute is checked before the superclass implementation.
* If the superclass is called first and no file is specified, a
* somewhat misleading error message is provided complaining the
* component name couldn't be determined.
*/
super.checkComponentConfig(aServer, comp);
// if an "exploded" archive is being deployed, --upload is not allowed
if (theFile.isDirectory() && deployServer.getUpload()) {
String hostname = aServer.getHost();
if (hostname == null) {
hostname = "localhost";
}
throw new BuildException(lsm.getString("UploadMayNotBeSetToTrue",
new Object[] {theFile.getAbsolutePath()}),
getLocation());
}
// retrievestubs (if specified) must be a directory
File theDir = deployComp.getRetrieveStubs();
if (theDir != null) {
if (!theDir.exists()) {
throw new BuildException(lsm.getString(
"RetrieveStubsDirectoryDoesNotExist",
new Object[] {theDir}), getLocation());
}
if (!theDir.isDirectory()) {
throw new BuildException(lsm.getString(
"RetrievesStbusDoesNotReferToADirectory",
new Object[] {theDir}), getLocation());
}
}
|
public Server | createServer()Creates a nested server element.
log("createServer using DeployServer object", Project.MSG_DEBUG);
Server aNestedServer = new DeployServer(server);
servers.add(aNestedServer);
return aNestedServer;
|
protected java.lang.String | getCommandString(Server aServer, Component comp)
DeployServer deployServer = (DeployServer) aServer;
DeployComponent deployComp = (DeployComponent) comp;
CheckForMutuallyExclusiveAttribute(deployComp);
StringBuffer cmdString;
boolean isFile = comp.getFile().isFile();
cmdString = new StringBuffer(isFile ? DEPLOY_COMMAND : DEPLOY_DIR_COMMAND);
cmdString.append(aServer.getCommandParameters(true));
if (comp.getType() != null) {
log(lsm.getString("DeprecatedTypeAttribute"), Project.MSG_WARN);
}
cmdString.append(" --force=").append(deployComp.isForce());
cmdString.append(" --enabled=").append(deployComp.isEnabled());
cmdString.append(" --name ").append(comp.getName());
cmdString.append(" --verify=").append(deployComp.isVerify());
cmdString.append(" --precompilejsp=").append(deployComp.isPrecompileJsp());
if (isFile) {
cmdString.append(" --upload=").append(deployServer.getUpload());
}
if (deployServer.getVirtualServers() != null) {
cmdString.append(" --virtualservers ");
cmdString.append(deployServer.getVirtualServers());
}
if (deployComp.getRetrieveStubs() != null) {
cmdString.append(" --retrieve ");
cmdString.append("\""+deployComp.getRetrieveStubs()+"\"");
}
if (deployComp.getDeploymentplan() != null) {
cmdString.append(" --deploymentplan ");
cmdString.append("\""+deployComp.getDeploymentplan()+"\"");
}
if (deployComp.contextRootIsSet()) {
cmdString.append(" --contextroot ").append(deployComp.getContextroot());
}
if (deployComp.getDbvendorname() != null) {
cmdString.append(" --dbvendorname ").append(deployComp.getDbvendorname());
}
if (deployComp.createtablesIsSet) {
cmdString.append(" --createtables=").append(deployComp.getCreatetables());
deployComp.createtablesIsSet = false; // set it back to false
}
if (deployComp.dropandcreatetablesIsSet) {
cmdString.append(" --dropandcreatetables=").append(deployComp.getDropandcreatetables());
deployComp.dropandcreatetablesIsSet = false; // set it back to false
}
if (deployComp.uniquetablenamesIsSet) {
cmdString.append(" --uniquetablenames=").append(deployComp.getUniquetablenames());
deployComp.uniquetablenamesIsSet = false; // set it back to false
}
if (deployComp.availabilityenabledIsSet) {
cmdString.append(" --availabilityenabled=").append(deployComp.getAvailabilityenabled());
deployComp.availabilityenabledIsSet = false; // set it back to false
}
if (deployComp.generatermistubsIsSet) {
cmdString.append(" --generatermistubs=").append(deployComp.getGeneratermistubs());
deployComp.generatermistubsIsSet = false; // set it back to false
}
// check the value and append target
String lTarget = deployComp.getTarget();
if ((lTarget != null) && (lTarget.length() > 0)) {
cmdString.append(" --target ").append(lTarget);
}
cmdString.append(" ").append("\""+comp.getFile().getPath()+"\"");
return cmdString.toString();
|
protected Component | getNewComponent()
return new DeployComponent(component);
|
protected Server | getNewServer()
return new DeployServer(server);
|
public void | setAvailabilityenabled(boolean availabilityenabled)Sets availabilityenabled option. If false then all SFSB checkpointing is disabled for
either the given j2ee app or the given ejb module. If it is true then the j2ee app
or stand-alone ejb modules may be ha enabled.
((DeployComponent)component).setAvailabilityenabled(availabilityenabled); // Delegates to component object
|
public void | setContextroot(java.lang.String contextroot)Sets the context root for a web module (WAR file). This attribute is only
used when deploying WAR files to the application server.
((DeployComponent)component).setContextroot(contextroot); // Delegates to component obj
|
public void | setCreatetables(boolean createtables)Sets if creates tables at deploy of an application with unmapped CMP beans.
((DeployComponent)component).setCreatetables(createtables); // Delegates to component object
|
public void | setDbvendorname(java.lang.String dbvendorname)Sets the dbvendorname - the name of database vendor being used.
((DeployComponent)component).setDbvendorname(dbvendorname); // Delegates to component obj
|
public void | setDeploymentplan(java.io.File deploymentplan)Sets the deploymentplan, a jar containing the sun-specifi descriptors which should be
passed along when deploying a pure ear.
((DeployComponent)component).setDeploymentplan(deploymentplan); // Delegates to component obj
|
public void | setDropandcreatetables(boolean dropandcreatetables)Sets if drops tables at undeploy of an already deployed application with
unmapped CMP beans.
((DeployComponent)component).setDropandcreatetables(dropandcreatetables); // Delegates to component object
|
public void | setEnabled(boolean enabled)Sets if the command is enabled or disabled.
((DeployComponent)component).setEnabled(enabled); // Delegates to component object
|
public void | setForce(boolean force)Sets if the command should overwrite existing values or components.
((DeployComponent)component).setForce(force); // Delegates to component object
|
public void | setGeneratermistubs(boolean generatermistubs)Sets generatermistubs option. If true then generate the static RMI-IIOP
stubs and put it in the client.jar.
((DeployComponent)component).setGeneratermistubs(generatermistubs); // Delegates to component object
|
public void | setPrecompileJsp(boolean precompile)Sets if the command should precompile JSPs when deploying them to the
server.
((DeployComponent)component).setPrecompileJsp(precompile); // Delegates to component object
|
public void | setRetrieveStubs(java.io.File stubsDir)Sets the directory where the JAR file with client stubs will be saved.
((DeployComponent)component).setRetrieveStubs(stubsDir); // Delegates to component object
|
public void | setUniquetablenames(boolean uniquetablenames)Sets the unique table names for all the beans and results in a hascode added
to the table names.
((DeployComponent)component).setUniquetablenames(uniquetablenames); // Delegates to component object
|
public void | setUpload(boolean upload)Set if the component should be transferred to the (potentially)
remote server before executing the command. Defaults to
true .
((DeployServer)server).setUpload(upload); // Delegates to server object
|
public void | setVerify(boolean verify)Sets if the deployment descriptors should be verified as part of the
deployment process.
((DeployComponent)component).setVerify(verify);
|
public void | setVirtualServers(java.lang.String virtualServers)Specifies the virtual server (or servers) where the component will be
deployed. This applies to only EAR and WAR files.
((DeployServer)server).setVirtualServers(virtualServers);
|