A container executing in the same JVM where Cargo is running
An embedded container means that Cargo is using directly the container's Java API to control it . If youand starts the container in the same JVM as where it is running. This implies you can do many advanced things programmatically - such as playing with the class loader, adding proxy classes, etc.
Please note that if you're using one of the embedded implementation you'll need to ensure that you have the container's JARs in your classpath.
Advantages of embbeded mode:
- Faster. There's no need to start a new JVM nor new threads.
- Simpler. There's no need to install the container in a directory.
Please note that CARGO simplifies container installation thanks to its installers; which can automatically download, extract and save the container for you.
Disadvantages of embbeded mode:
- Potentially difficult to control: the server will inherit whatever has existed in the JVM before the launch, such as predefined properties, existing ClassLoaders, some preinitialized components (XML parsers, etc.) and others.
Here is the list of container implementations that support the embedded mode:
Jetty4xEmbeddedContainer: Jetty 4.x implementation
Jetty5xEmbeddedContainer: Jetty 5.x implementation
Jetty6xEmbeddedContainer: Jetty 6.x implementation
Jetty7xEmbeddedContainer: Jetty 7.x implementation
Embedded containers, since they run in an existing JVM, will come with a large number of limitations:
As a result, except in cases where you have a compelling reason to use an embedded container, please use an Installed Container instead.