org.objectweb.jonas_web.deployment.api
Class WebContainerDeploymentDesc

java.lang.Object
  extended byorg.objectweb.jonas_lib.deployment.AbsDeploymentDesc
      extended byorg.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. 03/03 : Can read web.xml and jonas-web.xml if the url of the war is a directory.

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)
          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)
          Get an instance of a WEB deployment descriptor by parsing the web.xml and jonas-web.xml deployment descriptors.
 boolean getJava2DelegationModel()
          Context classloader must follow the java2 delegation model ?
static java.lang.String getJOnASXmlContent()
          Return the content of the jonas-web.xml file
static boolean getParsingWithValidation()
          Controls whether the parser is reporting all validity errors.
 java.lang.String getPort()
          Get the prefered port of the connector used to access the web application.
 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.
 ServiceRef[] getServiceRefTags()
          Get an array of mapping between a service ref name and its JNDI name.
 java.lang.Class getServletClass(java.lang.String servName)
          Return the class of the given servlet
 java.util.List getServletMappings(java.lang.String servName)
          Return the list of urlMapping of the given servlet
 java.lang.String[] getServletsName()
          Return a list of all servlets available
static java.lang.String getXmlContent()
          Return the content of the web.xml file
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.

See Also:
Constant Field Values

JONAS_WEB_FILE_NAME

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

See Also:
Constant Field Values
Method Detail

getInstance

public static WebContainerDeploymentDesc getInstance(java.lang.String warFileName,
                                                     java.lang.ClassLoader classLoaderForCls,
                                                     java.lang.String altWebXmlFilename)
                                              throws WebContainerDeploymentDescException
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
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.

getServiceRefTags

public ServiceRef[] getServiceRefTags()
Get an array of mapping between a service ref name and its JNDI name.

Returns:
an array of mapping between a service ref name 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.

getJava2DelegationModel

public boolean getJava2DelegationModel()
Context classloader must follow the java2 delegation model ?

Returns:
true if the context's classloader must follow the java 2 delegation model.

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.

getPort

public java.lang.String getPort()
Get the prefered port of the connector used to access the web application.

Returns:
the prefered port of the connector used to access the web application.

toString

public java.lang.String toString()
Return a String representation of the WebContainerDeploymentDesc.

Specified by:
toString in interface DeploymentDesc
Specified by:
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.

getXmlContent

public static java.lang.String getXmlContent()
Return the content of the web.xml file

Returns:
the content of the web.xml file

getJOnASXmlContent

public static java.lang.String getJOnASXmlContent()
Return the content of the jonas-web.xml file

Returns:
the content of the jonas-web.xml file

getServletsName

public java.lang.String[] getServletsName()
Return a list of all servlets available

Returns:
a list of all servlets available

getServletClass

public java.lang.Class getServletClass(java.lang.String servName)
Return the class of the given servlet

Returns:
the class of the given servlet

getServletMappings

public java.util.List getServletMappings(java.lang.String servName)
Return the list of urlMapping of the given servlet

Returns:
the list of urlMapping of the given servlet