Cargo : Deployable
This page last changed on Dec 26, 2005 by vmassol.
DefinitionDeployables are archives (WAR, EAR, etc) that can be deployed in the container ExplanationA Deployable class is a wrapper class around a physical archive. Deployable are constructed by directly instantiating them (e.g. new WAR(...) or new TomcatWAR(...)) or by using a DeployableFactory (e.g. DefaultDeployableFactory). There are 2 generic deployable classes:
The DeployableFactory interface offers a principal method for creating a Deployable: DeployableFactory.createDeployable(String containerId, String deployableLocation, DeployableType type). DeployableType can be DeployableType.WAR or DeployableType.EAR. Once you have a Deployable instance wrapping your archive, you'll need to deploy it. This can be done either using Static Deployment or using Hot Deployment. Example using the Java APIDeploying a WAR in Tomcat 5.x: Container container = new Tomcat5xContainer( new CatalinaStandalineConfiguration("target/tomcat5x")); container.setHome("c:/apps/tomcat-5.0.29"); WAR war = new WAR("path/to/my.war"); [...] Example using the Generic API[...] DeployableFactory factory = new DefaultDeployableFactory(); WAR war = factory.createDeployable("tomcat5x", "path/to/my.war", DeployableType.WAR); Example using the Ant APIStatically deploying a WAR in Tomcat 5.x: <cargo containerId="tomcat5x" home="c:/apps/tomcat-5.0.29" action="start"> <configuration> <war warfile="path/to/my.war"/> </configuration> </cargo> Note: In the future there will be an Ant task to support Hot Deployment. |
![]() |
Document generated by Confluence on Aug 25, 2010 07:10 |