1 package org
.argeo
.slc
.support
.deploy
;
5 import org
.apache
.commons
.logging
.Log
;
6 import org
.apache
.commons
.logging
.LogFactory
;
7 import org
.argeo
.slc
.core
.SlcException
;
8 import org
.argeo
.slc
.core
.build
.Distribution
;
9 import org
.argeo
.slc
.core
.deploy
.DeployEnvironment
;
10 import org
.argeo
.slc
.core
.deploy
.DeployedSystem
;
11 import org
.argeo
.slc
.core
.deploy
.DeploymentData
;
12 import org
.argeo
.slc
.core
.deploy
.ExecutableDeployment
;
13 import org
.argeo
.slc
.core
.deploy
.TargetData
;
15 public class HttpdApplicationDeployment
implements ExecutableDeployment
{
16 private static final Log log
= LogFactory
17 .getLog(HttpdApplicationDeployment
.class);
19 private HttpdApplicationTargetData targetData
;
20 private DeploymentData deploymentData
;
21 private SimpleHttpdApplication deployedSystem
;
22 private Distribution distribution
;
24 private DeployEnvironment deployEnvironment
;
26 public void execute() {
28 deployEnvironment
.unpackTo(getDistribution(), targetData
29 .getTargetRootLocation(), null);
31 // FIXME: make it generic
32 String deployDataPath
= targetData
.getTargetRootLocation()
35 deployEnvironment
.unpackTo(getDeploymentData(), new File(
36 deployDataPath
), null);
37 deployedSystem
= new SimpleHttpdApplication();
38 deployedSystem
.setTargetData(targetData
);
40 } catch (Exception e
) {
41 throw new SlcException("Cannot deploy " + deploymentData
+ " to "
47 public void setTargetData(TargetData targetData
) {
48 this.targetData
= (HttpdApplicationTargetData
) targetData
;
51 public void setDeploymentData(DeploymentData deploymentData
) {
52 this.deploymentData
= deploymentData
;
55 public DeployedSystem
getDeployedSystem() {
56 return deployedSystem
;
59 public DeploymentData
getDeploymentData() {
60 return deploymentData
;
63 public TargetData
getTargetData() {
67 public Distribution
getDistribution() {
71 public void setDistribution(Distribution distribution
) {
72 this.distribution
= distribution
;
75 public void setDeployEnvironment(DeployEnvironment deployEnvironment
) {
76 this.deployEnvironment
= deployEnvironment
;