Cargo 介绍
Cargo是一个J2EE 容器的轻量级封装,提供操作容器的API
Cargo 提供的API 有:
- 用于启动和停止以及发布新应用到容器的 Java API,同时提供有 ANT、Maven、Intellij IDEA 和 Netbeans 的插件;
- 用于解析、创建和合并应用的 Java API
Cargo 的使用例子:
Deployable war = new WAR("path/to/simple.war"); LocalConfiguration configuration = new Resin3xStandaloneLocalConfiguration("target/myresin3x"); configuration.addDeployable(war); InstalledLocalContainer container = new Resin3xInstalledLocalContainer(configuration); container.setHome("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.