Class SynapseAppDeployer

  • All Implemented Interfaces:
    org.wso2.carbon.application.deployer.handler.AppDeploymentHandler

    public class SynapseAppDeployer
    extends Object
    implements org.wso2.carbon.application.deployer.handler.AppDeploymentHandler
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addImport​(String libName, String packageName, org.apache.axis2.engine.AxisConfiguration axisConfig)
      Performing the action of importing the given meidation library
      boolean deleteEntry​(String ele, org.apache.axis2.engine.AxisConfiguration axisConfig)
      Remove the local entry
      void deleteImport​(String importQualifiedName, org.apache.axis2.engine.AxisConfiguration axisConfig)
      Delete the SynapseImport instance with given importQualifiedName in the synapse configuration
      void deployArtifacts​(org.wso2.carbon.application.deployer.CarbonApplication carbonApp, org.apache.axis2.engine.AxisConfiguration axisConfig)
      Deploy the artifacts which can be deployed through this deployer (endpoints, sequences, proxy service etc.).
      void deployArtifactType​(List<org.wso2.carbon.application.deployer.config.Artifact.Dependency> artifacts, org.wso2.carbon.application.deployer.CarbonApplication carbonApp, org.apache.axis2.engine.AxisConfiguration axisConfig)
      This deploys artifacts when a list of artifacts is provided
      String getArtifactName​(String filePath, org.apache.axis2.engine.AxisConfiguration axisConfig)
      Get the library artifact name
      protected Lock getLock​(org.apache.axis2.engine.AxisConfiguration axisConfig)
      Acquires the lock
      protected org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager getMediationPersistenceManager​(org.apache.axis2.engine.AxisConfiguration axisConfig)
      Helper method to get the persistence manger
      protected org.apache.synapse.config.SynapseConfiguration getSynapseConfiguration​(org.apache.axis2.engine.AxisConfiguration axisConfig)
      Helper method to retrieve the Synapse configuration from the relevant axis configuration
      void setCustomLogContent​(org.apache.axis2.deployment.Deployer deployer, org.wso2.carbon.application.deployer.CarbonApplication carbonApp)
      Set the custom log content if the per Artifact container logging is enabled
      void undeployArtifacts​(org.wso2.carbon.application.deployer.CarbonApplication carbonApplication, org.apache.axis2.engine.AxisConfiguration axisConfig)
      Un-deploys Synapse artifacts found in this application.
      boolean updateStatus​(String libQName, String libName, String packageName, String status, org.apache.axis2.engine.AxisConfiguration axisConfig)
      Performing the action of enabling/disabling the given meidation library
    • Constructor Detail

      • SynapseAppDeployer

        public SynapseAppDeployer()
    • Method Detail

      • deployArtifacts

        public void deployArtifacts​(org.wso2.carbon.application.deployer.CarbonApplication carbonApp,
                                    org.apache.axis2.engine.AxisConfiguration axisConfig)
                             throws org.apache.axis2.deployment.DeploymentException
        Deploy the artifacts which can be deployed through this deployer (endpoints, sequences, proxy service etc.).
        Specified by:
        deployArtifacts in interface org.wso2.carbon.application.deployer.handler.AppDeploymentHandler
        Parameters:
        carbonApp - - CarbonApplication instance to check for artifacts
        axisConfig - - AxisConfiguration of the current tenant
        Throws:
        org.apache.axis2.deployment.DeploymentException
      • undeployArtifacts

        public void undeployArtifacts​(org.wso2.carbon.application.deployer.CarbonApplication carbonApplication,
                                      org.apache.axis2.engine.AxisConfiguration axisConfig)
                               throws org.apache.axis2.deployment.DeploymentException
        Un-deploys Synapse artifacts found in this application. Just delete the files from the hot folders. Synapse hot deployer will do the rest..
        Specified by:
        undeployArtifacts in interface org.wso2.carbon.application.deployer.handler.AppDeploymentHandler
        Parameters:
        carbonApplication - - CarbonApplication instance
        axisConfig - - AxisConfiguration of the current tenant
        Throws:
        org.apache.axis2.deployment.DeploymentException
      • getArtifactName

        public String getArtifactName​(String filePath,
                                      org.apache.axis2.engine.AxisConfiguration axisConfig)
                               throws org.apache.axis2.deployment.DeploymentException
        Get the library artifact name
        Parameters:
        axisConfig - AxisConfiguration of the current tenant
        Throws:
        org.apache.axis2.deployment.DeploymentException - if something goes wrong while deployment
      • getSynapseConfiguration

        protected org.apache.synapse.config.SynapseConfiguration getSynapseConfiguration​(org.apache.axis2.engine.AxisConfiguration axisConfig)
        Helper method to retrieve the Synapse configuration from the relevant axis configuration
        Parameters:
        axisConfig - AxisConfiguration of the current tenant
        Returns:
        extracted SynapseConfiguration from the relevant AxisConfiguration
      • updateStatus

        public boolean updateStatus​(String libQName,
                                    String libName,
                                    String packageName,
                                    String status,
                                    org.apache.axis2.engine.AxisConfiguration axisConfig)
                             throws org.apache.axis2.AxisFault
        Performing the action of enabling/disabling the given meidation library
        Parameters:
        libName -
        packageName -
        status -
        axisConfig - AxisConfiguration of the current tenant
        Throws:
        org.apache.axis2.AxisFault
      • addImport

        public void addImport​(String libName,
                              String packageName,
                              org.apache.axis2.engine.AxisConfiguration axisConfig)
                       throws org.apache.axis2.AxisFault
        Performing the action of importing the given meidation library
        Parameters:
        libName -
        packageName -
        axisConfig - AxisConfiguration of the current tenant
        Throws:
        org.apache.axis2.AxisFault
      • getMediationPersistenceManager

        protected org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager getMediationPersistenceManager​(org.apache.axis2.engine.AxisConfiguration axisConfig)
        Helper method to get the persistence manger
        Parameters:
        axisConfig - AxisConfiguration of the current tenant
        Returns:
        persistence manager for this configuration context
      • deleteEntry

        public boolean deleteEntry​(String ele,
                                   org.apache.axis2.engine.AxisConfiguration axisConfig)
        Remove the local entry
        Parameters:
        ele -
        axisConfig - AxisConfiguration of the current tenant
      • getLock

        protected Lock getLock​(org.apache.axis2.engine.AxisConfiguration axisConfig)
        Acquires the lock
        Parameters:
        axisConfig - AxisConfiguration instance
        Returns:
        Lock instance
      • deleteImport

        public void deleteImport​(String importQualifiedName,
                                 org.apache.axis2.engine.AxisConfiguration axisConfig)
                          throws org.apache.axis2.AxisFault
        Delete the SynapseImport instance with given importQualifiedName in the synapse configuration
        Parameters:
        importQualifiedName - of the MessageProcessor to be deleted
        axisConfig - AxisConfiguration of the current tenant
        Throws:
        org.apache.axis2.AxisFault - if Message processor does not exist
      • setCustomLogContent

        public void setCustomLogContent​(org.apache.axis2.deployment.Deployer deployer,
                                        org.wso2.carbon.application.deployer.CarbonApplication carbonApp)
        Set the custom log content if the per Artifact container logging is enabled
        Parameters:
        deployer - Application Deployer
        carbonApp - carbon application
      • deployArtifactType

        public void deployArtifactType​(List<org.wso2.carbon.application.deployer.config.Artifact.Dependency> artifacts,
                                       org.wso2.carbon.application.deployer.CarbonApplication carbonApp,
                                       org.apache.axis2.engine.AxisConfiguration axisConfig)
                                throws org.apache.axis2.deployment.DeploymentException
        This deploys artifacts when a list of artifacts is provided
        Parameters:
        artifacts - - List of artifacts which should be deployed
        carbonApp - - CarbonApplication instance to check for artifacts
        axisConfig - - AxisConfiguration of the current tenant
        Throws:
        org.apache.axis2.deployment.DeploymentException - if some error occurs while deployment