This page last changed on Apr 30, 2005 by vmassol.

Mission

Cargo is a thin wrapper around existing J2EE containers. It provides different APIs to easily manipulate containers. "Cargo, your container's best friend!"

Cargo provides the following APIs:

  • A Java, Ant and Maven API to start/stop/configure Java Containers
  • A Java API to parse/create J2EE Modules

Status

Version status (click in the status column to get release notes):
Version Status Comments
0.1 Released on 11/09/04
0.2 Released on 03/10/04
0.3 Released on 30/10/04
0.4 Released on 26/11/04
0.5 Released on 30/04/05

As glitches may happen even after a container is released for the first time, e.g. if a new feature is added to the framework, but not supported by all containers, we encourage you to report your success/failures in the Tested on section.


Documentation for Cargo version in development

The documentation below is for Cargo 0.6 which is the version that we are currently developing (not released yet). The documentation for Cargo 0.5 (latest version) is available here

Architecture



Different ways of using Cargo


High level Cargo architecture

Cargo offers differents ways of using it at different levels:
  • Module Java API: A Java API to parse/create J2EE Modules (WAR, EAR, etc)
  • Container Java API: A Java API to start/stop/configure Java Containers
  • Generic Java API: A Java API that sits on top of the Container API but allows writing generic code that works with any container. It consists mostly in a set of Factory classes to instantiate Container API objects by name.
  • Ant tasks: A set of Ant tasks that wrap the Generic Java API
  • Maven plugin: A Maven plugin that wraps the Ant tasks

The main Container API objects are:
  • The Container is the top level interface wrapping a real physical container. It is composed of a Configuration.
  • A Configuration tells Cargo how the container is to be configured (whether it should create a standalone setup, whether it should be based on an existing configuration, etc). A Configuration can be configured to install Deployables before the Container is started.
  • You can use a Deployer to deploy Deployables dynamically (i.e. after the Container is started).
  • Deployables are archives to be deployed in the Container. They are WAR, EAR, etc.

Feature list

Container support

List of supported containers and the integration points that are implemented for each container (Java API, Ant tasks and Maven plugin). The specified version is the Cargo version where the feature was first made available.
Container Java API(version) Ant tasks(version) Maven plugin(version)
JBoss 3.x ??? ??? ???
Jetty 4.x 0.1 ??? ???
jo! 1.x 0.5 0.5 0.5
OC4J 9.x 0.3 0.3 0.5
Orion 1.x 0.1 0.1 0.5
Orion 2.x 0.1 0.1 0.5
Resin 2.x 0.1 0.1 0.5
Resin 3.x 0.1 0.1 0.5
Tomcat 3.x 0.1 0.1 0.5
Tomcat 4.x 0.1 0.1 0.5
Tomcat 5.x 0.1 0.1 0.5
WebLogic 8.x 0.3 0.3 0.5

Quick Start

The following examples demonstrate how to configure Resin 3.0.8 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 deployment

Static deployment means that the Deployabe is deployed before the container is started.

Container container = new Resin3xContainer();
container.setHomeDir("c:/apps/resin-3.0.8");

Deployable war = 
    container.getDeployableFactory().createWAR("path/to/simple.war");
container.getConfiguration().addDeployable(war);

container.start();

// Here you are assured the container is started.

container.stop();

// Here you are assured the container is stopped.

Dynamic deployment

Dynamic deployment means that the Deployable is deployed after the container is started.
Container container = new Resin3xContainer();
container.setHomeDir("c:/apps/resin-3.0.8");

container.start();

// Here you are assured the container is started.

Deployable war = 
    container.getDeployableFactory().createWAR("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("http://server:port/some/url"));

container.stop();

// Here you are assured the container is stopped.

architecture.jpg (image/jpeg)
architecture.jpg (image/jpeg)
access-layers.jpg (image/jpeg)
access-layers.jpg (image/jpeg)
Document generated by Confluence on Apr 30, 2005 12:52