Cargo : Container Start
This page last changed on Jul 17, 2005 by vmassol.
DefinitionStart a container that is not already running ExplanationFirst you need to create a Container instance. This can be done using the container factory or directly by instating a container implementation class. Once you have this container instance, starting the container is as simple as calling the start() method. Before doing this though you'll need to ensure you have defined the container's homeDir (if you're using a container in standalone mode - It's not required for containers in embedded mode). Of course it you wish to statically deploy archives, you'll need to add deployables to the container. It is important to note that the Container.start() method will wait until the container is fully started before returning. Example using the Java APIStarting Resin 3.x with no deployable: Container container = new Resin3xContainer( new Resin3xStandaloneConfiguration("target/resin3x")); container.setHomeDir("c:/apps/resin-3.0.8"); container.start(); Example using the Ant APIBefore being able to use the Cargo Ant tasks you need to register them against Ant. This is done by using the Ant <taskdef> element. See the Ant support page. The action to start the container is specified using the action="start" attribute as shown below. Starting Resin 3.x with no deployable: <cargo-resin3x homeDir="c:/apps/resin-3.0.8" action="start"/>
|
![]() |
Document generated by Confluence on Jul 21, 2005 06:52 |