Cargo : Deployer
This page last changed on Apr 25, 2005 by vmassol.
DefinitionPerforms a hot deployment of a DeployableExplanationYou use a Deployer when you wish to deploy a Deployable into a running container (this is known as Hot Deployment). To instantiate a Deployer you need to know its class name. A Deployer is specific to a container (you can find the class names on the container page listing all containers).The deployment is done using one of the Deployer.deploy(...) APIs. Some deploy(...) signatures accept a DeployableMonitor which is used to wait till the container has not finished deploying. Cargo currently offers a URLDeployableMonitor which waits by polling a provided URL (see below in the example). Whent the URL becomes available the monitor considers that the Deployable is fully deployed. In the future, Cargo will provide other DeployableMonitor such as a Jsr88DeployableMonitor. Example using the Java APIExample without using a DeployableMonitorHot-deploying a WAR on Resin 3.0.9 without waiting for the deployment to finish:Container container = new Resin3xContainer(); container.setHomeDir("c:/apps/resin-3.0.9"); DeployableFactory factory = container.getDeployableFactory(); WAR war = factory.createWAR("path/to/my.war"); Deployer deployer = new ResinDeployer(); deployer.deploy(war); Please note that the Deployer.deploy() method call does not wait for the Deployable to be fully deployed before returning. Example using a URLDeployableMonitorHot-deploying an WAR on Resin 3.0.9 and waiting for the deployment to finish: Container container = new Resin3xContainer(); container.setHomeDir("c:/apps/resin-3.0.9"); DeployableFactory factory = container.getDeployableFactory(); WAR war = factory.createWAR("path/to/my.war"); Deployer deployer = new ResinDeployer(); deployer.deploy(war, new URLDeployableMonitor("http://server:port/some/url")); Example using the Ant APIThere's currently no Ant task for performing hot deployments. |
![]() |
Document generated by Confluence on Apr 30, 2005 12:52 |