+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.support.deploy;\r
-\r
-import java.io.File;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.build.Distribution;\r
-import org.argeo.slc.deploy.DeployEnvironment;\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-import org.argeo.slc.deploy.Deployment;\r
-import org.argeo.slc.deploy.DeploymentData;\r
-import org.argeo.slc.deploy.TargetData;\r
-\r
-public class HttpdApplicationDeployment implements Deployment {\r
- private static final Log log = LogFactory\r
- .getLog(HttpdApplicationDeployment.class);\r
-\r
- private HttpdApplicationTargetData targetData;\r
- private DeploymentData deploymentData;\r
- private SimpleHttpdApplication deployedSystem;\r
- private Distribution distribution;\r
-\r
- private DeployEnvironment deployEnvironment;\r
-\r
- public void run() {\r
- try {\r
- deployEnvironment.unpackTo(distribution, targetData\r
- .getTargetRootLocation(), null);\r
-\r
- // FIXME: make it generic\r
- String deployDataPath = targetData.getTargetRootLocation()\r
- .getCanonicalPath();\r
-\r
- deployEnvironment.unpackTo(deploymentData,\r
- new File(deployDataPath), null);\r
- deployedSystem = new SimpleHttpdApplication();\r
- deployedSystem.setTargetData(targetData);\r
-\r
- log.info("Deployed " + distribution + " to " + targetData);\r
- } catch (Exception e) {\r
- throw new SlcException("Cannot deploy " + distribution + " to "\r
- + targetData, e);\r
- }\r
-\r
- }\r
-\r
- public void setTargetData(TargetData targetData) {\r
- this.targetData = (HttpdApplicationTargetData) targetData;\r
- }\r
-\r
- public void setDeploymentData(DeploymentData deploymentData) {\r
- this.deploymentData = deploymentData;\r
- }\r
-\r
- public DeployedSystem getDeployedSystem() {\r
- return deployedSystem;\r
- }\r
-\r
- public void setDistribution(Distribution distribution) {\r
- this.distribution = distribution;\r
- }\r
-\r
- public void setDeployEnvironment(DeployEnvironment deployEnvironment) {\r
- this.deployEnvironment = deployEnvironment;\r
- }\r
-\r
-}\r