org.wso2.carbon.webapp.mgt

## Class TomcatGenericWebappsDeployer

- java.lang.Object
- - org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer

-     public class TomcatGenericWebappsDeployer
      extends Object

  This deployer is responsible for deploying/undeploying/updating those webapps.
  See Also:
    `org.wso2.carbon.tomcat`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.apache.axis2.context.ConfigurationContext` | `configurationContext`
    `protected Map<String,org.apache.catalina.Manager>` | `sessionManagerMap`
    `protected String` | `tenantDomain`
    `protected int` | `tenantId`
    `protected Map<String,WebApplicationsHolder>` | `webApplicationsHolderMap`
    `protected String` | `webContextPrefix`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TomcatGenericWebappsDeployer(String webContextPrefix, int tenantId, String tenantDomain, Map<String,WebApplicationsHolder> webApplicationsHolderMap, org.apache.axis2.context.ConfigurationContext configurationContext)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deploy(File webappFile, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners)` Deploy webapps
    `protected String` | `handleAppVersion(String warContext)`
    `protected void` | `handleExplodedWebappDeployment(File webappDir, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners)` Handle the deployment of a an exploded webapp.
    `protected void` | `handleHotDeployment(File webapp, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners)` Hot deploy a webapp.
    `protected void` | `handleHotUpdate(WebApplication webApplication, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners)` Hot update an existing webapp.
    `protected void` | `handleWarWebappDeployment(File webappWAR, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners)` Handle the deployment of a an archive webapp.
    `protected void` | `handleWebappDeployment(File webappFile, String contextStr, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners)`
    `protected void` | `handleZipWebappDeployment(File webapp, List<WebContextParameter> webContextParams, List<Object> applicationEventListeners)`
    `void` | `lazyUnload(File webappFile)` Handle undeployment.
    `protected String` | `recievePersistedWebappMetaData(File webappFile, String propertyName)` This method reads from webapp meta files to check weather bam statistics are enabled.
    `protected void` | `setPersistedWebappMetaData(File webappFile, String propertyName, String value)` This method stores the value in the webapp metadata file.
    `void` | `undeploy(File webappFile)` Handle undeployment.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### webContextPrefix

          protected String webContextPrefix

    - #### tenantId

          protected int tenantId

    - #### tenantDomain

          protected String tenantDomain

    - #### configurationContext

          protected org.apache.axis2.context.ConfigurationContext configurationContext

    - #### webApplicationsHolderMap

          protected Map<String,WebApplicationsHolder> webApplicationsHolderMap

    - #### sessionManagerMap

          protected Map<String,org.apache.catalina.Manager> sessionManagerMap

  - ### Constructor Detail

    - #### TomcatGenericWebappsDeployer

          public TomcatGenericWebappsDeployer(String webContextPrefix,
                                              int tenantId,
                                              String tenantDomain,
                                              Map<String,WebApplicationsHolder> webApplicationsHolderMap,
                                              org.apache.axis2.context.ConfigurationContext configurationContext)

      Constructor
      Parameters:
        `webContextPrefix` - The Web context prefix
        `tenantId` - The tenant ID of the tenant to whom this deployer belongs to
        `tenantDomain` - The tenant domain of the tenant to whom this deployer belongs to
        `webApplicationsHolderMap` - WebApplicationsHolder

  - ### Method Detail

    - #### deploy

          public void deploy(File webappFile,
                             List<WebContextParameter> webContextParams,
                             List<Object> applicationEventListeners)
                      throws org.wso2.carbon.CarbonException

      Deploy webapps
      Parameters:
        `webappFile` - The webapp file to be deployed
        `webContextParams` - context-params for this webapp
        `applicationEventListeners` - Application event listeners
      Throws:
        `org.wso2.carbon.CarbonException` - If a deployment error occurs

    - #### handleHotDeployment

          protected void handleHotDeployment(File webapp,
                                             List<WebContextParameter> webContextParams,
                                             List<Object> applicationEventListeners)
                                      throws org.wso2.carbon.CarbonException

      Hot deploy a webapp. i.e., deploy a webapp that has newly become available.
      Parameters:
        `webapp` - The webapp WAR or directory that needs to be deployed
        `webContextParams` - ServletContext params for this webapp
        `applicationEventListeners` - Application event listeners
      Throws:
        `org.wso2.carbon.CarbonException` - If an error occurs during deployment

    - #### handleWarWebappDeployment

          protected void handleWarWebappDeployment(File webappWAR,
                                                   List<WebContextParameter> webContextParams,
                                                   List<Object> applicationEventListeners)
                                            throws org.wso2.carbon.CarbonException

      Handle the deployment of a an archive webapp. i.e., a WAR
      Parameters:
        `webappWAR` - The WAR webapp file
        `webContextParams` - ServletContext params for this webapp
        `applicationEventListeners` - Application event listeners
      Throws:
        `org.wso2.carbon.CarbonException` - If a deployment error occurs

    - #### handleZipWebappDeployment

          protected void handleZipWebappDeployment(File webapp,
                                                   List<WebContextParameter> webContextParams,
                                                   List<Object> applicationEventListeners)
                                            throws org.wso2.carbon.CarbonException

      Throws:
        `org.wso2.carbon.CarbonException`

    - #### handleExplodedWebappDeployment

          protected void handleExplodedWebappDeployment(File webappDir,
                                                        List<WebContextParameter> webContextParams,
                                                        List<Object> applicationEventListeners)
                                                 throws org.wso2.carbon.CarbonException

      Handle the deployment of a an exploded webapp. i.e., a webapp deployed as a directory & not an archive
      Parameters:
        `webappDir` - The exploded webapp directory
        `webContextParams` - ServletContext params for this webapp
        `applicationEventListeners` - Application event listeners
      Throws:
        `org.wso2.carbon.CarbonException` - If a deployment error occurs

    - #### handleWebappDeployment

          protected void handleWebappDeployment(File webappFile,
                                                String contextStr,
                                                List<WebContextParameter> webContextParams,
                                                List<Object> applicationEventListeners)
                                         throws org.wso2.carbon.CarbonException

      Throws:
        `org.wso2.carbon.CarbonException`

    - #### handleHotUpdate

          protected void handleHotUpdate(WebApplication webApplication,
                                         List<WebContextParameter> webContextParams,
                                         List<Object> applicationEventListeners)
                                  throws org.wso2.carbon.CarbonException

      Hot update an existing webapp. i.e., reload or redeploy a webapp archive which has been updated
      Parameters:
        `webApplication` - The webapp which needs to be hot updated
        `webContextParams` - ServletContext params for this webapp
        `applicationEventListeners` - Application event listeners
      Throws:
        `org.wso2.carbon.CarbonException` - If a deployment error occurs

    - #### undeploy

          public void undeploy(File webappFile)
                        throws org.wso2.carbon.CarbonException

      Handle undeployment.
      Parameters:
        `webappFile` - The webapp file to be undeployed
      Throws:
        `org.wso2.carbon.CarbonException` - If an error occurs while undeploying webapp

    - #### lazyUnload

          public void lazyUnload(File webappFile)
                          throws org.wso2.carbon.CarbonException

      Handle undeployment.
      Parameters:
        `webappFile` - The webapp file to be undeployed
      Throws:
        `org.wso2.carbon.CarbonException` - If an error occurs while lazy unloading

    - #### recievePersistedWebappMetaData

          protected String recievePersistedWebappMetaData(File webappFile,
                                                          String propertyName)
                                                   throws org.apache.axis2.AxisFault,
                                                          org.wso2.carbon.core.persistence.metadata.ArtifactMetadataException

      This method reads from webapp meta files to check weather bam statistics are enabled.
      Parameters:
        `webappFile` -
        `propertyName` -
      Returns:
        bam enable or disable
      Throws:
        `org.apache.axis2.AxisFault`
        `org.wso2.carbon.core.persistence.metadata.ArtifactMetadataException`

    - #### setPersistedWebappMetaData

          protected void setPersistedWebappMetaData(File webappFile,
                                                    String propertyName,
                                                    String value)
                                             throws org.apache.axis2.AxisFault,
                                                    org.wso2.carbon.core.persistence.metadata.ArtifactMetadataException

      This method stores the value in the webapp metadata file.
      Parameters:
        `webappFile` -
        `propertyName` -
        `value` -
      Throws:
        `org.apache.axis2.AxisFault`
        `org.wso2.carbon.core.persistence.metadata.ArtifactMetadataException`

    - #### handleAppVersion

          protected String handleAppVersion(String warContext)

Copyright © 2017 WSO2. All rights reserved.