Cargo : JSR88
This page last changed on Mar 11, 2006 by vmassol.
DefinitionJSR88-compliant containers support Explanation
Cargo supports JSR 88: J2EE Application Deployment API, allowing it to be used with any JSR88-compliant container. The core functionality is implemented by the o.c.c.container.jsr88.JSR88Deployer class (a Deployer implementation), which acts as a proxy to the JSR88 DeploymentManager. JSR88Deployer assumes its container to implement the o.c.c.container.jsr88.JSR88Container interface and relies on it for acquiring all the necessary data (like container URI etc.) as a o.c.c.container.jsr88.JSR88Info instance. If the container type is not known until the run-time, a Generic JSR88 container can be used. Note: o.c.c.container.JSR88Container does not extend the o.c.c.container.Container interface. Implementation Limitations
ExampleManipulating a Geronimo container via JSR88 using strongly-typed API: Configuration configuration = new GenericJSR88Configuration( new URI("deployer:geronimo:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector")); configuration.setProperty(JSR88PropertySet.USERNAME, "system"); configuration.setProperty(JSR88PropertySet.PASSWORD, "manager"); configuration.setProperty(JSR88PropertySet.DEPLOYTOOL_JAR, "geronimo-deploy-tool.jar"); configuration.setProperty(JSR88PropertySet.DEPLOYTOOL_CLASSPATH, "jar-1.jar;jar-2.jar"); Container container = new GenericJSR88Container(configuration); Deployable deployable = new WAR("test.war"); Deployer deployer = new JSR88Deployer(container); deployer.deploy(deployable); Manipulating a Geronimo container via JSR88 using generic API: Configuration configuration = (new DefaultConfigurationFactory()).createConfiguration( GenericJSR88Container.ID, ConfigurationType.EXISTING, new URI("deployer:geronimo:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector")); configuration.setProperty(JSR88PropertySet.USERNAME, "system"); configuration.setProperty(JSR88PropertySet.PASSWORD, "manager"); configuration.setProperty(JSR88PropertySet.DEPLOYTOOL_JAR, "geronimo-deploy-tool.jar"); configuration.setProperty(JSR88PropertySet.DEPLOYTOOL_CLASSPATH, "jar-1.jar;jar-2.jar"); Container container = new DefaultContainerFactory(). createContainer(GenericJSR88Container.ID, configuration); Deployable deployable = new DefaultDeployableFactory().createDeployable( GenericJSR88Container.ID, "test.war").getFile(), DeployableType.WAR); Deployer deployer = new DefaultDeployerFactory(). createDeployer(container,DefaultDeployerFactory.DEFAULT); deployer.deploy(deployable); For complete samples, see CARGO-146. |
![]() |
Document generated by Confluence on Mar 22, 2006 15:28 |