org.apache.cactus.integration.api.deployable
Class EarParser

java.lang.Object
  extended by org.apache.cactus.integration.api.deployable.EarParser

public class EarParser
extends java.lang.Object

Parse an EAR descriptor to extract meaninful information for Cactus, the results being stored in a EarDeployableFile object.

Since:
Cactus 1.5
Version:
$Id: EarParser.java 239003 2004-05-31 20:05:27Z vmassol $

Constructor Summary
EarParser()
           
 
Method Summary
protected static java.lang.String getUriOfCactifiedWebModule(org.codehaus.cargo.module.application.EarArchive theEar)
          Finds the web module in the EAR that contains the servlet test redirector, and returns the web-uri of the module found.
static EarDeployableFile parse(java.io.File theDeployableFile)
          Parse an EAR descriptor to extract meaninful information for Cactus.
static java.lang.String parseTestContext(org.codehaus.cargo.module.application.EarArchive theEar, java.lang.String theWebUri)
          Find the test context from the EAR archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EarParser

public EarParser()
Method Detail

parse

public static final EarDeployableFile parse(java.io.File theDeployableFile)
Parse an EAR descriptor to extract meaninful information for Cactus.

Parameters:
theDeployableFile - the file to parse and deploy
Returns:
the parse results as a EarDeployableFile object

parseTestContext

public static final java.lang.String parseTestContext(org.codehaus.cargo.module.application.EarArchive theEar,
                                                      java.lang.String theWebUri)
                                               throws javax.xml.parsers.ParserConfigurationException,
                                                      java.io.IOException,
                                                      org.xml.sax.SAXException,
                                                      org.jdom.JDOMException
Find the test context from the EAR archive.

Parameters:
theEar - the EAR archive from which to extract the test context
theWebUri - the WAR URI of the WAR file in the EAR from which to extract the test context
Returns:
the test context
Throws:
java.io.IOException - If there was a problem reading the deployment descriptor in the WAR
org.xml.sax.SAXException - If the deployment descriptor of the WAR could not be parsed
javax.xml.parsers.ParserConfigurationException - If there is an XML parser configration problem
org.jdom.JDOMException

getUriOfCactifiedWebModule

protected static final java.lang.String getUriOfCactifiedWebModule(org.codehaus.cargo.module.application.EarArchive theEar)
                                                            throws org.xml.sax.SAXException,
                                                                   java.io.IOException,
                                                                   javax.xml.parsers.ParserConfigurationException,
                                                                   org.jdom.JDOMException
Finds the web module in the EAR that contains the servlet test redirector, and returns the web-uri of the module found. A web-app is considered cactified when it contains at least a mapping for the Cactus servlet test redirector

Parameters:
theEar - the EAR archive from which to extract the web URI
Returns:
The URI of the cactified web-module, or null if no cactified web-app could be found
Throws:
java.io.IOException - If there was a problem reading the deployment descriptor in the WAR
org.xml.sax.SAXException - If the deployment descriptor of the WAR could not be parsed
javax.xml.parsers.ParserConfigurationException - If there is an XML parser configration problem
org.jdom.JDOMException


Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.