Class ModuleDeployer

java.lang.Object
org.apache.axis2.deployment.AbstractDeployer
org.apache.axis2.deployment.ModuleDeployer
All Implemented Interfaces:
Deployer

public class ModuleDeployer extends AbstractDeployer

Standard Axis2 Module Deployer which use module.xml file to deploy Modules. ModuleDeployer can be used with Axis2 Module archive (.mar) or exploded directory structure. Some of the example formats given below.

Examples :

  • repository/modules/LogModule.mar/meta-inf/module.xml
  • repository/modules/LogModule/meta-inf/module.xml
  • WEB-INF/modules/LogModule.mar/meta-inf/module.xml
  • WEB-INF/modules/LogModule/meta-inf/module.xml

Further ModuleDeployer can be used to deploy Modules from a remote repository or load a repository from a JAR file. In this case module files access through URLs. To deploy Modules from a remote repository or JAR file it is expected to present modules/modules.list file which contains names of Modules.

Example :

jar:file:/home/resources/repo.jar!/repo/modules/modules.list may contains following list of service.

  • LogModule.mar
  • Addressing.mar

There are several approaches available to set repository URL to Axis2 run time. As an example one can provide repository URL as a init-param of AxisServlet. Some of the examples given below.

  • Example -1 :

                             <init-param> 
                          <param-name>axis2.repository.url</param-name>
                          <param-value>http://localhost/repo/</param-value> 
                     </init-param> 
          
  • Example -2 :

     
                              <init-param> 
                          <param-name>axis2.repository.url</param-name>
                          <param-value>jar:file:/home/resources/repo.jar!/repo/</param-value> 
                      </init-param>   
        

NOTE - It is discouraged to use above services.list based deployment approach because it does not support hot-deployment, hot-update and some of other important deployment features as well.

  • Constructor Details

    • ModuleDeployer

      public ModuleDeployer()
    • ModuleDeployer

      public ModuleDeployer(AxisConfiguration axisConfig)
  • Method Details

    • init

      public void init(ConfigurationContext configCtx)
      Description copied from interface: Deployer
      Initialize the Deployer
      Parameters:
      configCtx - our ConfigurationContext
    • deploy

      public void deploy(DeploymentFileData deploymentFileData)
      Description copied from interface: Deployer
      Process a file and add it to the configuration
      Specified by:
      deploy in interface Deployer
      Overrides:
      deploy in class AbstractDeployer
      Parameters:
      deploymentFileData - the DeploymentFileData object to deploy
    • deoloyFromUrl

      public void deoloyFromUrl(DeploymentFileData deploymentFileData)
    • setDirectory

      public void setDirectory(String directory)
      Description copied from interface: Deployer
      Set the directory
      Parameters:
      directory - directory name
    • setExtension

      public void setExtension(String extension)
      Description copied from interface: Deployer
      Set the extension to look for TODO: Support multiple extensions?
      Parameters:
      extension - the file extension associated with this Deployer
    • undeploy

      public void undeploy(String fileName) throws DeploymentException
      Description copied from interface: Deployer
      Remove a given file from the configuration
      Specified by:
      undeploy in interface Deployer
      Overrides:
      undeploy in class AbstractDeployer
      Parameters:
      fileName - name of item to remove
      Throws:
      DeploymentException - if there is a problem