Class ServiceDeployer
- java.lang.Object
-
- org.apache.axis2.deployment.AbstractDeployer
-
- org.apache.axis2.deployment.ServiceDeployer
-
- All Implemented Interfaces:
Deployer
public class ServiceDeployer extends AbstractDeployer
Standard Axis2 service Deployer which use services.xml file to build services. ServiceDeployer can be used with Axis2 archive (.aar) or exploded directory structure. Some of the example formats given below.
Examples :
- repository/services/SimpleService.aar/meta-inf/services.xml
- repository/services/SimpleService/meta-inf/services.xml
- WEB-INF/services/SimpleService.aar/meta-inf/services.xml
- WEB-INF/services/SimpleService/meta-inf/services.xml
Further ServiceDeployer can be used to deploy services from a remote repository or load a repository from a JAR file. In this case service files access through URLs. To deploy services from a remote repository or JAR file it is expected to present service/services.list file which contains names of services.
Example :
jar:file:/home/resources/repo.jar!/repo/services/services.list may contains following list of service.
- StudentService.aar
- SimpleService.aar
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.
-
-
Field Summary
-
Fields inherited from class org.apache.axis2.deployment.AbstractDeployer
deploymentFileDataMap
-
-
Constructor Summary
Constructors Constructor Description ServiceDeployer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeploy(DeploymentFileData deploymentFileData)Process a file and add it to the configurationvoiddeployFromUrl(Deployer deployer, URL servicesURL)voiddeployFromUrl(DeploymentFileData deploymentFileData)voidinit(ConfigurationContext configCtx)Initialize the Deployerprotected ArrayList<AxisService>populateService(AxisServiceGroup serviceGroup, URL servicesURL, String serviceName)voidsetDirectory(String directory)Set the directoryvoidsetExtension(String extension)Set the extension to look for TODO: Support multiple extensions?voidundeploy(String fileName)Remove a given file from the configuration-
Methods inherited from class org.apache.axis2.deployment.AbstractDeployer
addServiceBuilderExtensions, cleanup, executeServiceBuilderExtensions, getServiceBuilderExtensions
-
-
-
-
Method Detail
-
init
public void init(ConfigurationContext configCtx)
Description copied from interface:DeployerInitialize the Deployer- Parameters:
configCtx- our ConfigurationContext
-
deploy
public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException
Description copied from interface:DeployerProcess a file and add it to the configuration- Specified by:
deployin interfaceDeployer- Overrides:
deployin classAbstractDeployer- Parameters:
deploymentFileData- the DeploymentFileData object to deploy- Throws:
DeploymentException- if there is a problem
-
deployFromUrl
public void deployFromUrl(DeploymentFileData deploymentFileData) throws DeploymentException
- Throws:
DeploymentException
-
deployFromUrl
public void deployFromUrl(Deployer deployer, URL servicesURL) throws DeploymentException
- Throws:
DeploymentException
-
populateService
protected ArrayList<AxisService> populateService(AxisServiceGroup serviceGroup, URL servicesURL, String serviceName) throws DeploymentException
- Throws:
DeploymentException
-
setDirectory
public void setDirectory(String directory)
Description copied from interface:DeployerSet the directory- Parameters:
directory- directory name
-
setExtension
public void setExtension(String extension)
Description copied from interface:DeployerSet 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:DeployerRemove a given file from the configuration- Specified by:
undeployin interfaceDeployer- Overrides:
undeployin classAbstractDeployer- Parameters:
fileName- name of item to remove- Throws:
DeploymentException- if there is a problem
-
-