org.sandev.sandbuild
Class WARDeploymentPackager

java.lang.Object
  extended by org.sandev.sandbuild.WARDeploymentPackager
All Implemented Interfaces:
SandDeploymentPackager

public class WARDeploymentPackager
extends java.lang.Object
implements SandDeploymentPackager

Deploy the finished build files as a single WAR file.


Constructor Summary
WARDeploymentPackager()
           
 
Method Summary
 void doDeployment(SandProject deployment, SandProject platform, int mode)
          Deploy the files into the container, provided anything has changed.
protected  java.lang.String getEnvDir(SandProject proj)
          Return the name of the env dir for the specified project.
protected  java.lang.String getWardeployDir(SandProject proj)
          Return the name of the wardeploy repackaging directory off the given project.
protected  boolean haveNewerFile(java.lang.String dirstr, long gateTime)
          Return true if any file in the given directory was modified more recently than the given gating time.
protected  void log(java.lang.String text)
          Dump the specified text to the build log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WARDeploymentPackager

public WARDeploymentPackager()
Method Detail

doDeployment

public void doDeployment(SandProject deployment,
                         SandProject platform,
                         int mode)
                  throws SandBuildException
Deploy the files into the container, provided anything has changed. This works by capturing the current time, then building the deployment war as needed, then checking if any newer files were created.

This worked great until the build computers started repacking the war faster than the file time resolution could account for, so now we subtract a couple of seconds from the current time to account for that. That means that if you do a complete build, and then another incremental build immediately after on a really fast machine, it might still outpace the check and repack when it didn't need to. In practice that's a lot less annoying than not deploying when it should.

Specified by:
doDeployment in interface SandDeploymentPackager
Throws:
SandBuildException

log

protected void log(java.lang.String text)
Dump the specified text to the build log.


getEnvDir

protected java.lang.String getEnvDir(SandProject proj)
                              throws SandBuildException
Return the name of the env dir for the specified project.

Throws:
SandBuildException

getWardeployDir

protected java.lang.String getWardeployDir(SandProject proj)
                                    throws SandBuildException
Return the name of the wardeploy repackaging directory off the given project.

Throws:
SandBuildException

haveNewerFile

protected boolean haveNewerFile(java.lang.String dirstr,
                                long gateTime)
                         throws SandBuildException
Return true if any file in the given directory was modified more recently than the given gating time. Returns after finding anything newer, logging which file was found.

Throws:
SandBuildException