2 * Copyright (C) 2007-2012 Argeo GmbH
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.
16 package org
.argeo
.slc
.support
.deploy
;
20 import org
.apache
.commons
.logging
.Log
;
21 import org
.apache
.commons
.logging
.LogFactory
;
22 import org
.argeo
.slc
.SlcException
;
23 import org
.argeo
.slc
.build
.Distribution
;
24 import org
.argeo
.slc
.deploy
.DeployEnvironment
;
25 import org
.argeo
.slc
.deploy
.DeployedSystem
;
26 import org
.argeo
.slc
.deploy
.Deployment
;
27 import org
.argeo
.slc
.deploy
.DeploymentData
;
28 import org
.argeo
.slc
.deploy
.TargetData
;
30 public class HttpdApplicationDeployment
implements Deployment
{
31 private static final Log log
= LogFactory
32 .getLog(HttpdApplicationDeployment
.class);
34 private HttpdApplicationTargetData targetData
;
35 private DeploymentData deploymentData
;
36 private SimpleHttpdApplication deployedSystem
;
37 private Distribution distribution
;
39 private DeployEnvironment deployEnvironment
;
43 deployEnvironment
.unpackTo(distribution
, targetData
44 .getTargetRootLocation(), null);
46 // FIXME: make it generic
47 String deployDataPath
= targetData
.getTargetRootLocation()
50 deployEnvironment
.unpackTo(deploymentData
,
51 new File(deployDataPath
), null);
52 deployedSystem
= new SimpleHttpdApplication();
53 deployedSystem
.setTargetData(targetData
);
55 log
.info("Deployed " + distribution
+ " to " + targetData
);
56 } catch (Exception e
) {
57 throw new SlcException("Cannot deploy " + distribution
+ " to "
63 public void setTargetData(TargetData targetData
) {
64 this.targetData
= (HttpdApplicationTargetData
) targetData
;
67 public void setDeploymentData(DeploymentData deploymentData
) {
68 this.deploymentData
= deploymentData
;
71 public DeployedSystem
getDeployedSystem() {
72 return deployedSystem
;
75 public void setDistribution(Distribution distribution
) {
76 this.distribution
= distribution
;
79 public void setDeployEnvironment(DeployEnvironment deployEnvironment
) {
80 this.deployEnvironment
= deployEnvironment
;