[Carbon-commits] [Carbon-Components] svn commit r68358 - trunk/carbon/components/webapp-mgt/org.wso2.carbon.webapp.mgt/src/main/java/org/wso2/carbon/webapp/mgt

azeez at wso2.com azeez at wso2.com
Tue Jun 22 10:50:12 PDT 2010


Author: azeez
Date: Tue Jun 22 10:50:12 2010
New Revision: 68358
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=68358

Log:
API change to include tenant ID on webapp deployer creation


Modified:
   trunk/carbon/components/webapp-mgt/org.wso2.carbon.webapp.mgt/src/main/java/org/wso2/carbon/webapp/mgt/WebappDeployer.java

Modified: trunk/carbon/components/webapp-mgt/org.wso2.carbon.webapp.mgt/src/main/java/org/wso2/carbon/webapp/mgt/WebappDeployer.java
URL: http://wso2.org/svn/browse/wso2/trunk/carbon/components/webapp-mgt/org.wso2.carbon.webapp.mgt/src/main/java/org/wso2/carbon/webapp/mgt/WebappDeployer.java?rev=68358&r1=68357&r2=68358&view=diff
==============================================================================
--- trunk/carbon/components/webapp-mgt/org.wso2.carbon.webapp.mgt/src/main/java/org/wso2/carbon/webapp/mgt/WebappDeployer.java	(original)
+++ trunk/carbon/components/webapp-mgt/org.wso2.carbon.webapp.mgt/src/main/java/org/wso2/carbon/webapp/mgt/WebappDeployer.java	Tue Jun 22 10:50:12 2010
@@ -23,6 +23,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.core.multitenancy.utils.TenantUtils;
 import org.wso2.carbon.server.TomcatGenericWebappsDeployer;
 import org.wso2.carbon.server.WebApplicationsHolder;
 import org.wso2.carbon.server.WebContextParameter;
@@ -44,12 +45,14 @@
     private List<WebContextParameter> servletContextParameters =
             new ArrayList<WebContextParameter>();
 
+
     public void init(ConfigurationContext configCtx) {
         String repoPath = configCtx.getAxisConfiguration().getRepository().getPath();
         File webappsDirFile = new File(repoPath + File.separator + webappsDir);
         if (!webappsDirFile.exists()) {
             webappsDirFile.mkdirs();
         }
+        int tenantId = TenantUtils.getTenantId(configCtx);
         Parameter tenantDomainParam =
                 configCtx.getAxisConfiguration().getParameter(MultitenantConstants.TENANT_DOMAIN);
         String webContextPrefix = (tenantDomainParam != null) ?
@@ -59,6 +62,7 @@
         configCtx.setProperty(CarbonConstants.WEB_APPLICATIONS_HOLDER, webappsHolder);
         try {
             tomcatWebappDeployer = new TomcatGenericWebappsDeployer(webContextPrefix,
+                                                                    tenantId,
                                                                     webappsHolder);
             WebContextParameter webServiceServerUrlParam =
                     new WebContextParameter("webServiceServerURL",
@@ -73,7 +77,13 @@
     }
 
     public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException {
-        tomcatWebappDeployer.deploy(deploymentFileData.getFile(), servletContextParameters);
+        try {
+            tomcatWebappDeployer.deploy(deploymentFileData.getFile(), servletContextParameters);
+        } catch (Exception e) {
+            String msg = "Error occurred while deploying webapp " + deploymentFileData.getFile().getAbsolutePath();
+            log.error(msg, e);
+            throw new DeploymentException(msg, e);
+        }
     }
 
     public void setDirectory(String repoDir) {



More information about the Carbon-commits mailing list