X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=cms%2Forg.argeo.slc.support%2Fsrc%2Forg%2Fargeo%2Fslc%2Fsupport%2Fdeploy%2FHttpdApplicationDeployment.java;fp=cms%2Forg.argeo.slc.support%2Fsrc%2Forg%2Fargeo%2Fslc%2Fsupport%2Fdeploy%2FHttpdApplicationDeployment.java;h=804f2805dc9fffc9f59029ad12213b36213b6927;hb=ecc22e604e47533c79de9cecdcdeacbc752cbff1;hp=0000000000000000000000000000000000000000;hpb=e07ded4632e53f8b8869763bc1f1f4091361e76e;p=gpl%2Fargeo-slc.git diff --git a/cms/org.argeo.slc.support/src/org/argeo/slc/support/deploy/HttpdApplicationDeployment.java b/cms/org.argeo.slc.support/src/org/argeo/slc/support/deploy/HttpdApplicationDeployment.java new file mode 100644 index 000000000..804f2805d --- /dev/null +++ b/cms/org.argeo.slc.support/src/org/argeo/slc/support/deploy/HttpdApplicationDeployment.java @@ -0,0 +1,68 @@ +package org.argeo.slc.support.deploy; + +import java.io.File; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.argeo.slc.SlcException; +import org.argeo.slc.build.Distribution; +import org.argeo.slc.deploy.DeployEnvironment; +import org.argeo.slc.deploy.DeployedSystem; +import org.argeo.slc.deploy.Deployment; +import org.argeo.slc.deploy.DeploymentData; +import org.argeo.slc.deploy.TargetData; + +public class HttpdApplicationDeployment implements Deployment { + private static final Log log = LogFactory + .getLog(HttpdApplicationDeployment.class); + + private HttpdApplicationTargetData targetData; + private DeploymentData deploymentData; + private SimpleHttpdApplication deployedSystem; + private Distribution distribution; + + private DeployEnvironment deployEnvironment; + + public void run() { + try { + deployEnvironment.unpackTo(distribution, targetData + .getTargetRootLocation(), null); + + // FIXME: make it generic + String deployDataPath = targetData.getTargetRootLocation() + .getCanonicalPath(); + + deployEnvironment.unpackTo(deploymentData, + new File(deployDataPath), null); + deployedSystem = new SimpleHttpdApplication(); + deployedSystem.setTargetData(targetData); + + log.info("Deployed " + distribution + " to " + targetData); + } catch (Exception e) { + throw new SlcException("Cannot deploy " + distribution + " to " + + targetData, e); + } + + } + + public void setTargetData(TargetData targetData) { + this.targetData = (HttpdApplicationTargetData) targetData; + } + + public void setDeploymentData(DeploymentData deploymentData) { + this.deploymentData = deploymentData; + } + + public DeployedSystem getDeployedSystem() { + return deployedSystem; + } + + public void setDistribution(Distribution distribution) { + this.distribution = distribution; + } + + public void setDeployEnvironment(DeployEnvironment deployEnvironment) { + this.deployEnvironment = deployEnvironment; + } + +}