Home

News: Cargo Announced: Open source Java API to work with containers

  1. Vincent Massol talked about the idea of having an API to start, stop, and configure Java containers. This has lead to Cargo, which you can find as part of Codehaus. In addition to the API itself, there are Ant tasks which can be used to access a container in a generic way.

    Features

            
    • Provides a Java API to:
                  
      • Start containers
      •           
      • Stop containers
      •           
      • Configure containers for deployment in any user-specified directory
      •           
      • Wait for containers to be started
      •           
      • Wait for containers to be stopped
      •           
      • Supports WAR and EAR static deployments
      •         
            
    •       
    • Provides Ant tasks that wraps the Java API.
    Code Example
    Container container = new Resin3xContainer();
    container.setHomeDir("c:/apps/resin-3.0.8");
    container.setWorkingDir("target/resin3x");

    Deployable deployable = new WAR("src/testinput/simple.war");
            
    container.addDeployable(deployable);

    container.start();

    // At this point you are assured the container is started.

    container.stop();

    // At this point you are assured the container is stopped.
    Visit the Cargo home page
  2. Great idea, should be particularly useful for a continuous build process where you may want to unit test a web application with Httpunit as part of your build.

    Ian Purton
    Website Uptime and Availability Monitoring | Permission Email List Management | Website Traffic Analysis | All Time Top 100 Rock Charts
  3. HTTPUnit and ...Cactus[ Go to top ]

    Cargo takes its roots in Cactus where some of the implementation comes from, the author of these two tools being the same :)
  4. I know there's a JSR for application deployment - maybe the JCP should extend it to container-management as well, no?
  5. Problem with Maven[ Go to top ]

    Hi Vincent,

    great stuff, thank you (-:.

    I understand that there are no maven goals yet. But even if I use cargo with maven via ant it doesn't work. The container starts up, but when the goal is finished the respective process gets killed.

    That doesn't happen when I use cargo via ant or programatically.

    Any idea?

    Hans
  6. Problem with Maven[ Go to top ]

    Hi Vincent,great stuff, thank you (-:. I understand that there are no maven goals yet. But even if I use cargo with maven via ant it doesn't work. The container starts up, but when the goal is finished the respective process gets killed.That doesn't happen when I use cargo via ant or programatically.Any idea?Hans
    Hans, could you please subscribe to the Cargo user mailing list (http://cargo.codehaus.org/mail-lists.html) and send the questions there. We'll answer there and make it work for you.

    Thanks
    -Vincent
  7. Excellent idea.

    What are the plans/issues for some other widely used Appservers? Not wanting to name names. :) I did a quick look on issues, etc. and didn't see anything.



    Thx.
  8. Excellent idea. What are the plans/issues for some other widely used Appservers? Not wanting to name names. :) I did a quick look on issues, etc. and didn't see anything.Thx.
    Hi Mark,

    So far we've planned the ones that are listed on http://cargo.codehaus.org. Then it will be driven by user requests and contributions ;-)

    -Vincent
  9. Ok. So, currently I see no plan for WebSphere. Any current User requests for it or pending contributions? If not, what does it take to contribute and did anyone run into issues with it?
  10. Ok. So, currently I see no plan for WebSphere. Any current User requests for it or pending contributions? If not, what does it take to contribute and did anyone run into issues with it?
    Hi mark,

    I guess the best is to continue the discussion on the Cargo dev or user mailing list. Let's meet there! :-)