org.objectweb.jonas_web.deployment.api
Class WebContainerDeploymentDesc

java.lang.Object
  |
  +--org.objectweb.jonas_lib.deployment.AbsDeploymentDesc
        |
        +--org.objectweb.jonas_web.deployment.api.WebContainerDeploymentDesc
All Implemented Interfaces:
DeploymentDesc

public class WebContainerDeploymentDesc
extends AbsDeploymentDesc

This class do the parsing of the web.xml file and jonas-web.xml files and contruct a data structure associated to these two files.

Author:
Ludovic Bert, Florent Benoit

Field Summary
static java.lang.String JONAS_WEB_FILE_NAME
          The path to the jonas-web.xml file.
static java.lang.String WEB_FILE_NAME
          The path to the web.xml file.
 
Fields inherited from class org.objectweb.jonas_lib.deployment.AbsDeploymentDesc
displayName
 
Method Summary
 java.lang.String getContextRoot()
          Get the context root of this web application.
 EjbLocalRefDesc[] getEjbLocalRefTags()
          Get an array of mapping between an ejb local name and its JNDI name.
 EjbRefDesc[] getEjbRefTags()
          Get an array of mapping between an ejb name and its JNDI name.
static org.xml.sax.EntityResolver getEntityResolver()
          Get the current EntityResolver.
 EnvEntryDesc[] getEnvEntryTags()
          Get an array of mapping between an entry name and its value.
static org.xml.sax.ErrorHandler getErrorHandler()
          Get the current ErrorHandler.
 java.lang.String getHost()
          Get the host on which the web application must be deployed.
static WebContainerDeploymentDesc getInstance(java.lang.String warFileName, java.lang.ClassLoader classLoaderForCls)
          ontainerDeploymentDescException("ejb-lin Get an instance of a WEB deployment descriptor by parsing the web.xml and jonas-web.xml deployment descriptors.
static WebContainerDeploymentDesc getInstance(java.lang.String warFileName, java.lang.ClassLoader classLoaderForCls, java.lang.String altWebXmlFilename)
          ontainerDeploymentDescException("ejb-lin Get an instance of a WEB deployment descriptor by parsing the web.xml and jonas-web.xml deployment descriptors.
static boolean getParsingWithValidation()
          Controls whether the parser is reporting all validity errors.
 ResourceEnvRefDesc[] getResourceEnvRefTags()
          Get an array of mapping between a res-env-ref name and its JNDI name.
 ResourceRefDesc[] getResourceRefTags()
          Get an array of mapping between an res-ref name and its JNDI name.
static void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
          Set the specified EntityResolver.
static void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
          Set the specified ErrorHandler.
static void setParsingWithValidation(boolean validation)
          Controls whether the parser is reporting all validity errors.
 java.lang.String toString()
          Return a String representation of the WebContainerDeploymentDesc.
 
Methods inherited from class org.objectweb.jonas_lib.deployment.AbsDeploymentDesc
getDisplayName, getSAXMsg
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WEB_FILE_NAME

public static final java.lang.String WEB_FILE_NAME
The path to the web.xml file.

JONAS_WEB_FILE_NAME

public static final java.lang.String JONAS_WEB_FILE_NAME
The path to the jonas-web.xml file.
Method Detail

getInstance

public static WebContainerDeploymentDesc getInstance(java.lang.String warFileName,
                                                     java.lang.ClassLoader classLoaderForCls,
                                                     java.lang.String altWebXmlFilename)
                                              throws WebContainerDeploymentDescException
ontainerDeploymentDescException("ejb-lin Get an instance of a WEB deployment descriptor by parsing the web.xml and jonas-web.xml deployment descriptors.
Parameters:
warFileName - the fileName of the war file for the deployment descriptors.
classLoaderForCls - the classloader for the classes.
altWebXmlFilename - the fileName to the web.xml for the alt-dd tag in the Ear Case. This is used for specify an alternate DDesc file.
Returns:
a WEB deployment descriptor by parsing the web.xml and jonas-web.xml deployment descriptors.
Throws:
WebContainerDeploymentDescException - if the deployment descriptors are corrupted.

getInstance

public static WebContainerDeploymentDesc getInstance(java.lang.String warFileName,
                                                     java.lang.ClassLoader classLoaderForCls)
                                              throws WebContainerDeploymentDescException
ontainerDeploymentDescException("ejb-lin Get an instance of a WEB deployment descriptor by parsing the web.xml and jonas-web.xml deployment descriptors.
Parameters:
warFileName - the fileName of the war file for the deployment descriptors.
classLoaderForCls - the classloader for the classes.
Returns:
a WEB deployment descriptor by parsing the web.xml and jonas-web.xml deployment descriptors.
Throws:
WebContainerDeploymentDescException - if the deployment descriptors are corrupted.

getResourceEnvRefTags

public ResourceEnvRefDesc[] getResourceEnvRefTags()
Get an array of mapping between a res-env-ref name and its JNDI name.
Returns:
an array of mapping between a res-env-ref name and its JNDI name.

getResourceRefTags

public ResourceRefDesc[] getResourceRefTags()
Get an array of mapping between an res-ref name and its JNDI name.
Returns:
an array of mapping between an res-ref name and its JNDI name.

getEnvEntryTags

public EnvEntryDesc[] getEnvEntryTags()
Get an array of mapping between an entry name and its value.
Returns:
an array of mapping between an entry name and its value.

getEjbRefTags

public EjbRefDesc[] getEjbRefTags()
Get an array of mapping between an ejb name and its JNDI name.
Returns:
an array of mapping between an ejb name and its JNDI name.

getEjbLocalRefTags

public EjbLocalRefDesc[] getEjbLocalRefTags()
Get an array of mapping between an ejb local name and its JNDI name.
Returns:
an array of mapping between an ejb name local and its JNDI name.

getContextRoot

public java.lang.String getContextRoot()
Get the context root of this web application.
Returns:
the context root of this web application.

getHost

public java.lang.String getHost()
Get the host on which the web application must be deployed.
Returns:
the host on which the web application must be deployed.

toString

public java.lang.String toString()
Return a String representation of the WebContainerDeploymentDesc.
Overrides:
toString in class AbsDeploymentDesc
Returns:
a String representation of the WebContainerDeploymentDesc.

getErrorHandler

public static org.xml.sax.ErrorHandler getErrorHandler()
Get the current ErrorHandler.
Returns:
the current ErrorHandler.

getEntityResolver

public static org.xml.sax.EntityResolver getEntityResolver()
Get the current EntityResolver.
Returns:
the current EntityResolver.

getParsingWithValidation

public static boolean getParsingWithValidation()
Controls whether the parser is reporting all validity errors.
Returns:
if true, all external entities will be read.

setErrorHandler

public static void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Set the specified ErrorHandler. If the application does not register an ErrorHandler, all error events reported by the reader are ignored.
Parameters:
errorHandler - the Error Handler to set.

setEntityResolver

public static void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Set the specified EntityResolver.
Parameters:
entityResolver - the Entity Resolver to set.

setParsingWithValidation

public static void setParsingWithValidation(boolean validation)
Controls whether the parser is reporting all validity errors.
Parameters:
validation - if true, all external entities will be read.