org.ow2.jonas.deployment.web
Class WebContainerDeploymentDesc

java.lang.Object
  extended by org.ow2.jonas.deployment.common.DescriptionGroupDesc
      extended by org.ow2.jonas.deployment.common.JndiEnvRefsGroupDesc
          extended by org.ow2.jonas.deployment.web.WebContainerDeploymentDesc
All Implemented Interfaces:
IDescriptionGroupDesc, IJNDIEnvRefsGroupDesc

public class WebContainerDeploymentDesc
extends JndiEnvRefsGroupDesc

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, Philippe Coq

Field Summary
 
Fields inherited from class org.ow2.jonas.deployment.common.JndiEnvRefsGroupDesc
logger
 
Fields inherited from class org.ow2.jonas.deployment.common.DescriptionGroupDesc
description, displayName, largeIcon, smallIcon
 
Constructor Summary
WebContainerDeploymentDesc(String fileName, ClassLoader classLoader, WebApp webApp, JonasWebApp jonasWebApp, org.ow2.util.ee.metadata.war.api.IWarDeployableMetadata metadata)
          Construct an instance of a WebContainerDeploymentDesc.
Constructor is private, call one of the static getInstance method instead.
 
Method Summary
 String getContextRoot()
          Get the context root of this web application.
 String getHost()
          Get the host on which the web application must be deployed.
 boolean getJava2DelegationModel()
          Context classloader must follow the java2 delegation model ?
 String getJOnASXmlContent()
          Return the content of the jonas-web.xml file
 String getPort()
          Get the prefered port of the connector used to access the web application.
 SecurityConstraintListDesc getSecurityConstraintListDesc()
          Gets the constraint list
 List<SecurityRoleDesc> getSecurityRoleList()
          Gets the list of security roles
 String getServletClassname(String servName)
          Return the classname of the given servlet
 Collection<ServletDesc> getServletDescList()
          Gets the list of Servlets
 List<String> getServletMappings(String servName)
          Return the list of urlMapping of the given servlet
 String getServletPrincipalName(String servName)
          Return the principal name of the given servlet
 String[] getServletsName()
          Return a list of all servlets name available
 Map<String,org.ow2.util.ee.metadata.war.api.IWarClassMetadata> getWebServices()
           
 String getXmlContent()
          Return the content of the web.xml file
 void mergeServletsRunAS(org.ow2.util.ee.metadata.war.api.IWarDeployableMetadata warDeployableMetadata)
           
 void setJOnASXmlContent(String jXml)
          Set the content of the jonas-web.xml file
 void setWebServices(Map<String,org.ow2.util.ee.metadata.war.api.IWarClassMetadata> services)
          Set the list of POJO endpoints
 void setXmlContent(String xml)
          Set the content of the web.xml file
 String toString()
          Return a String representation of the WebContainerDeploymentDesc.
 
Methods inherited from class org.ow2.jonas.deployment.common.JndiEnvRefsGroupDesc
getEjbLocalRefDesc, getEjbRefDesc, getENCBindingHolder, getEnvEntryDesc, getMessageDestinationRefDesc, getPersistenceUnitRefs, getResourceEnvRefDesc, getResourceRefDesc, getServiceRefDesc, setENCBindingHolder
 
Methods inherited from class org.ow2.jonas.deployment.common.DescriptionGroupDesc
getDescription, getDisplayName, getLargeIcon, getSAXMsg, getSmallIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebContainerDeploymentDesc

public WebContainerDeploymentDesc(String fileName,
                                  ClassLoader classLoader,
                                  WebApp webApp,
                                  JonasWebApp jonasWebApp,
                                  org.ow2.util.ee.metadata.war.api.IWarDeployableMetadata metadata)
                           throws DeploymentDescException
Construct an instance of a WebContainerDeploymentDesc.
Constructor is private, call one of the static getInstance method instead.

Parameters:
fileName - the name of the warFile
classLoader - the classloader for the classes.
webApp - the data structure of the web-app (web.xml)
jonasWebApp - the data structure of the jonas-web-app (jonas-web.xml)
metadata - the annotation metadata of the jonas-web-app
Throws:
DeploymentDescException - if the deployment descriptors are corrupted.
Method Detail

getXmlContent

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

Returns:
the content of the web.xml file

getJOnASXmlContent

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

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

setXmlContent

public void setXmlContent(String xml)
Set the content of the web.xml file

Parameters:
xml - the content of the file

setJOnASXmlContent

public void setJOnASXmlContent(String jXml)
Set the content of the jonas-web.xml file

Parameters:
jXml - the content of the file

getContextRoot

public 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 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 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 String toString()
Return a String representation of the WebContainerDeploymentDesc.

Specified by:
toString in interface IDescriptionGroupDesc
Specified by:
toString in class DescriptionGroupDesc
Returns:
a String representation of the WebContainerDeploymentDesc.

getServletDescList

public Collection<ServletDesc> getServletDescList()
Gets the list of Servlets

Returns:
list of Servlets

getServletsName

public String[] getServletsName()
Return a list of all servlets name available

Returns:
a list of all servlets name available

getServletClassname

public String getServletClassname(String servName)
Return the classname of the given servlet

Parameters:
servName - name of the given servlet
Returns:
the classname of the given servlet

getSecurityConstraintListDesc

public SecurityConstraintListDesc getSecurityConstraintListDesc()
Gets the constraint list

Returns:
the constraint list

getSecurityRoleList

public List<SecurityRoleDesc> getSecurityRoleList()
Gets the list of security roles

Returns:
the list of security roles

getServletMappings

public List<String> getServletMappings(String servName)
Return the list of urlMapping of the given servlet

Parameters:
servName - name of the given servlet
Returns:
the list of urlMapping of the given servlet

getServletPrincipalName

public String getServletPrincipalName(String servName)
Return the principal name of the given servlet

Parameters:
servName - name of the given servlet
Returns:
the principal name of the given servlet

setWebServices

public void setWebServices(Map<String,org.ow2.util.ee.metadata.war.api.IWarClassMetadata> services)
Set the list of POJO endpoints

Parameters:
services - POJOs metadatas

getWebServices

public Map<String,org.ow2.util.ee.metadata.war.api.IWarClassMetadata> getWebServices()
Returns:
the list of classes annotated with @WebService from this webapp

mergeServletsRunAS

public void mergeServletsRunAS(org.ow2.util.ee.metadata.war.api.IWarDeployableMetadata warDeployableMetadata)


Copyright © 2010 OW2 Consortium. All Rights Reserved.