2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org
.argeo
.slc
.support
.deploy
;
21 import org
.apache
.commons
.logging
.Log
;
22 import org
.apache
.commons
.logging
.LogFactory
;
23 import org
.argeo
.slc
.SlcException
;
24 import org
.argeo
.slc
.build
.Distribution
;
25 import org
.argeo
.slc
.deploy
.DeployEnvironment
;
26 import org
.argeo
.slc
.deploy
.DeployedSystem
;
27 import org
.argeo
.slc
.deploy
.Deployment
;
28 import org
.argeo
.slc
.deploy
.DeploymentData
;
29 import org
.argeo
.slc
.deploy
.TargetData
;
31 public class HttpdApplicationDeployment
implements Deployment
{
32 private static final Log log
= LogFactory
33 .getLog(HttpdApplicationDeployment
.class);
35 private HttpdApplicationTargetData targetData
;
36 private DeploymentData deploymentData
;
37 private SimpleHttpdApplication deployedSystem
;
38 private Distribution distribution
;
40 private DeployEnvironment deployEnvironment
;
44 deployEnvironment
.unpackTo(distribution
, targetData
45 .getTargetRootLocation(), null);
47 // FIXME: make it generic
48 String deployDataPath
= targetData
.getTargetRootLocation()
51 deployEnvironment
.unpackTo(deploymentData
,
52 new File(deployDataPath
), null);
53 deployedSystem
= new SimpleHttpdApplication();
54 deployedSystem
.setTargetData(targetData
);
56 log
.info("Deployed " + distribution
+ " to " + targetData
);
57 } catch (Exception e
) {
58 throw new SlcException("Cannot deploy " + distribution
+ " to "
64 public void setTargetData(TargetData targetData
) {
65 this.targetData
= (HttpdApplicationTargetData
) targetData
;
68 public void setDeploymentData(DeploymentData deploymentData
) {
69 this.deploymentData
= deploymentData
;
72 public DeployedSystem
getDeployedSystem() {
73 return deployedSystem
;
76 public void setDistribution(Distribution distribution
) {
77 this.distribution
= distribution
;
80 public void setDeployEnvironment(DeployEnvironment deployEnvironment
) {
81 this.deployEnvironment
= deployEnvironment
;