Cargo : Home
![]()
This page last changed on Mar 22, 2006 by vmassol.
MissionCargo is a thin wrapper around existing containers (e.g. J2EE containers). It provides different APIs to easily manipulate containers. Cargo provides the following APIs:
Check the utilisation page to understand what you can use Cargo for. StatusVersion status (click in the status column to get release notes):
Architecture
The main Container API objects are:
Feature listSome top-level features (the full feature list can be found here):
Container supportList of supported containers and the extensions that are implemented for each container (Java API, Ant tasks and Maven plugins). The specified version is the Cargo version where the feature was first made available. Click on a container's name to see a detailed list of features it supports.
Quick StartThe following examples demonstrate how to configure Resin 3.0.15 to start in target/resin3x and deploy a WAR located in path/to/simple.war. The default port is 8080. Please note that the container.start() and container.stop() methods wait until the container is fully started and fully stopped before continuing. Thus, for any action you are executing after, you are assured the container is completely operational. Static deploymentStatic deployment means that the Deployable is deployed before the container is started. Here's an example using the strongly typed Java API: Deployable war = new WAR("path/to/simple.war"); LocalConfiguration configuration = new Resin3xStandaloneLocalConfiguration(new File("target/myresin3x")); configuration.addDeployable(war); InstalledLocalContainer container = new Resin3xInstalledLocalContainer(configuration); container.setHome(new File("c:/apps/resin-3.0.18")); container.start(); // Here you are assured the container is started. container.stop(); // Here you are assured the container is stopped. Here's the same example using the generic untyped API (which we recommend as it leads to more generic code): Deployable war = new DefaultDeployableFactory().createDeployable( "resin3x", "path/to/simple.war", DeployableType.WAR); ConfigurationFactory configurationFactory = new DefaultConfigurationFactory(); LocalConfiguration configuration = (LocalConfiguration) configurationFactory.createConfiguration( "resin3x", ConfigurationType.STANDALONE); configuration.addDeployable(war); InstalledLocalContainer container = (InstalledLocalContainer) new DefaultContainerFactory().createContainer( "resin3x", ContainerType.INSTALLED, configuration); container.setHome(new File("c:/apps/resin-3.0.18")); container.start(); // Here you are assured the container is started. container.stop(); // Here you are assured the container is stopped. Hot deploymentHot deployment means that the Deployable is deployed after the container is started. InstalledLocalContainer container = new Resin3xInstalledLocalContainer( new Resin3xStandaloneLocalConfiguration( new File("target/myresin3x"))); container.setHome(new File("c:/apps/resin-3.0.18")); container.start(); // Here you are assured the container is started. Deployable war = new WAR("path/to/simple.war"); Deployer deployer = new ResinDeployer(container); deployer.deploy(war); // Here you are NOT sure the WAR has finished deploying. To be sure you // need to use a DeployableMonitor to monitor the deployment. For example // the following code deploys the WAR and wait until it is available to // serve requests (the URL should point to a resource inside your WAR): deployer.deploy(war, new URLDeployableMonitor( new URL("http://server:port/some/url"))); container.stop(); // Here you are assured the container is stopped. ![]() ![]() ![]() ![]() ![]() |
![]() |
Document generated by Confluence on Mar 22, 2006 15:28 |