org.jboss.metadata
Class WebMetaData

java.lang.Object
  extended by org.jboss.metadata.MetaData
      extended by org.jboss.metadata.WebMetaData
All Implemented Interfaces:
Cloneable, XmlLoadable

public class WebMetaData
extends MetaData

A representation of the web.xml and jboss-web.xml deployment descriptors as used by the AbstractWebContainer web container integration support class.

Version:
$Revision: 57209 $
Author:
Scott.Stark@jboss.org
See Also:
XmlLoadable, AbstractWebContainer

Field Summary
static int REPLICATION_GRANULARITY_ATTRIBUTE
           
static int REPLICATION_GRANULARITY_FIELD
           
static int REPLICATION_GRANULARITY_SESSION
          Specify the session replication granularity level: session --- whole session level, attribute --- per attribute change, field --- fine grained user object level.
static int REPLICATION_TYPE_ASYNC
           
static int REPLICATION_TYPE_SYNC
           
static int SESSION_COOKIES_DEFAULT
           
static int SESSION_COOKIES_DISABLED
           
static int SESSION_COOKIES_ENABLED
           
static int SESSION_INVALIDATE_ACCESS
           
static int SESSION_INVALIDATE_SET
           
static int SESSION_INVALIDATE_SET_AND_GET
           
static int SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET
           
 
Fields inherited from class org.jboss.metadata.MetaData
TX_MANDATORY, TX_NEVER, TX_NOT_SUPPORTED, TX_REQUIRED, TX_REQUIRES_NEW, TX_SUPPORTS, TX_UNKNOWN
 
Constructor Summary
WebMetaData()
           
 
Method Summary
 String getConfigFile()
           
 String getConfigName()
           
 ClassLoader getContextLoader()
           
 String getContextRoot()
          This the the jboss-web.xml descriptor context-root and it is only meaningful if a war is deployed outside of an ear.
 Collection getDepends()
          Access the web application depends
 boolean getDistributable()
          The distributable flag.
 Iterator getEjbLocalReferences()
          Return an iterator of the ejb-local-ref mappings.
 Iterator getEjbReferences()
          Return an iterator of the ejb-ref mappings.
 ClassLoader getENCLoader()
           
 Iterator getEnvironmentEntries()
          Return an iterator of the env-entry mappings.
 int getInvalidateSessionPolicy()
           
 String getJaccContextID()
           
 boolean getJava2ClassLoadingCompliance()
          A flag indicating if the normal Java2 parent first class loading model should be used over the servlet 2.3 web container first model.
 org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig getLoaderConfig()
           
 MessageDestinationMetaData getMessageDestination(String name)
          Get a message destination metadata
 Iterator getMessageDestinationReferences()
          Return an iterator of message-destination-refs.
 boolean getReplicationFieldBatchMode()
           
 int getReplicationGranularity()
           
 int getReplicationType()
           
 Iterator getResourceEnvReferences()
          Return an iterator of the resource-ref mappings.
 Iterator getResourceReferences()
          Return an iterator of the resource-ref mappings.
 Map getRunAsIdentity()
           
 org.jboss.security.RunAsIdentity getRunAsIdentity(String servletName)
          Access the RunAsIdentity associated with the given servlet
 Iterator getSecurityContraints()
          Get the security-constraint settings
 String getSecurityDomain()
          Return the optional security-domain jboss-web.xml element.
 Set getSecurityRoleNames()
          Get the security-role names from the web.xml descriptor
 Set getSecurityRoleNamesByPrincipal(String userName)
           
 Map getSecurityRoleRefs()
           
 List getSecurityRoleRefs(String servletName)
           
 Map getSecurityRoles()
          Get the optional map of security role/user mapping.
 Iterator getServiceReferences()
          Return an iterator of the service-ref mappings.
 Map getServletClassMap()
          Get the servlet-name/servlet-class mapping from the web.xml descriptor
 HashMap getServletMappings()
          Get the servlet-name values from the web.xml descriptor
 Set getServletNames()
          Get the servlet-name values from the web.xml descriptor
 int getSessionCookies()
           
 Iterator getVirtualHosts()
          The servlet container virtual host the war should be deployed into.
 String getWsdlPublishLocationByName(String name)
          Get the optional wsdl publish location from jboss-web.xml.
protected  void importJBossWebXml(Element jbossWeb)
          Parse the elements of the jboss-web element used by the integration layer.
protected  void importWebXml(Element webApp)
          Parse the elements of the web-app element used by the integration layer.
 void importXml(Element element)
          Imports either the jboss or ejb-jar from the given element.
 boolean isFlushOnSessionInvalidation()
          The flag indicating whether the associated security domain cache should be flushed when the session is invalidated.
 boolean isWebServiceDeployment()
           
 void mergeSecurityRoles(Map applRoles)
          Merge the security role/principal mapping defined in jboss-web.xml with the one defined at jboss-app.xml.
 void setConfigFile(String configFile)
           
 void setConfigName(String configName)
           
 void setContextLoader(ClassLoader cxtLoader)
          Make sure this is called during performDeploy
 void setContextRoot(String contextRoot)
           
 void setDepends(Collection depends)
           
 void setDistributable(boolean distributable)
          Mark the web-app as distributable
 void setEjbLocalReferences(Map ejbReferences)
           
 void setEjbReferences(Map ejbReferences)
           
 void setENCLoader(ClassLoader encLoader)
           
 void setEnvironmentEntries(Collection environmentEntries)
           
 void setFlushOnSessionInvalidation(boolean flag)
          The flag indicating whether the associated security domain cache should be flushed when the session is invalidated.
 void setInvalidateSessionPolicy(int invalidateSessionPolicy)
           
 void setJaccContextID(String jaccContextID)
           
 void setJava2ClassLoadingCompliance(boolean flag)
           
 void setLoaderConfig(org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig loaderConfig)
           
 void setMessageDestination(Map messageDestinations)
           
 void setMessageDestinationReferences(Map messageDestinationReferences)
           
 void setReplicationGranularity(int replicationGranularity)
           
 void setResourceClassLoader(URLClassLoader resourceCl)
          Set the ClassLoader to load additional resources
 void setResourceEnvReferences(Map resourceReferences)
           
 void setResourceReferences(Map resourceReferences)
           
 void setRunAsIdentity(Map runAsIdentity)
          The jboss-web.xml servlet/run-as
 void setSecurityConstraints(Collection securityContraints)
           
 void setSecurityDomain(String securityDomain)
          Set the security domain for this web application
 void setSecurityRoleReferences(Map securityRoleReferences)
           
 void setSecurityRoles(Map securityRoles)
           
 void setServiceReferences(Map serviceReferences)
           
 void setServletMappings(Map servletMappings)
          servlet-mapping/serlvet-name to url-pattern mapping
 void setSessionCookies(int sessionCookies)
           
 void setVirtualHosts(Collection virtualHosts)
           
 void setWebServiceDeployment(boolean webServiceDeployment)
           
 void setWsdlPublishLocationMap(Map wsdlPublishLocationMap)
           
 
Methods inherited from class org.jboss.metadata.MetaData
clone, getChildrenByTagName, getElementAttribute, getElementAttribute, getElementContent, getElementContent, getElementContent, getFirstElementContent, getFirstElementContent, getOptionalChild, getOptionalChild, getOptionalChildBooleanContent, getOptionalChildBooleanContent, getOptionalChildContent, getOptionalChildContent, getUniqueChild, getUniqueChildContent, importEjbJarXml, importJbossXml, jdk13Enabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_INVALIDATE_ACCESS

public static final int SESSION_INVALIDATE_ACCESS
See Also:
Constant Field Values

SESSION_INVALIDATE_SET_AND_GET

public static final int SESSION_INVALIDATE_SET_AND_GET
See Also:
Constant Field Values

SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET

public static final int SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET
See Also:
Constant Field Values

SESSION_INVALIDATE_SET

public static final int SESSION_INVALIDATE_SET
See Also:
Constant Field Values

REPLICATION_TYPE_SYNC

public static final int REPLICATION_TYPE_SYNC
See Also:
Constant Field Values

REPLICATION_TYPE_ASYNC

public static final int REPLICATION_TYPE_ASYNC
See Also:
Constant Field Values

REPLICATION_GRANULARITY_SESSION

public static final int REPLICATION_GRANULARITY_SESSION
Specify the session replication granularity level: session --- whole session level, attribute --- per attribute change, field --- fine grained user object level.

See Also:
Constant Field Values

REPLICATION_GRANULARITY_ATTRIBUTE

public static final int REPLICATION_GRANULARITY_ATTRIBUTE
See Also:
Constant Field Values

REPLICATION_GRANULARITY_FIELD

public static final int REPLICATION_GRANULARITY_FIELD
See Also:
Constant Field Values

SESSION_COOKIES_DEFAULT

public static final int SESSION_COOKIES_DEFAULT
See Also:
Constant Field Values

SESSION_COOKIES_ENABLED

public static final int SESSION_COOKIES_ENABLED
See Also:
Constant Field Values

SESSION_COOKIES_DISABLED

public static final int SESSION_COOKIES_DISABLED
See Also:
Constant Field Values
Constructor Detail

WebMetaData

public WebMetaData()
Method Detail

setResourceClassLoader

public void setResourceClassLoader(URLClassLoader resourceCl)
Set the ClassLoader to load additional resources


getEnvironmentEntries

public Iterator getEnvironmentEntries()
Return an iterator of the env-entry mappings.

Returns:
Iterator of EnvEntryMetaData objects.

setEnvironmentEntries

public void setEnvironmentEntries(Collection environmentEntries)
Parameters:
environmentEntries - - Collection

getEjbReferences

public Iterator getEjbReferences()
Return an iterator of the ejb-ref mappings.

Returns:
Iterator of EjbRefMetaData objects.

setEjbReferences

public void setEjbReferences(Map ejbReferences)
Parameters:
ejbReferences - - Map

getEjbLocalReferences

public Iterator getEjbLocalReferences()
Return an iterator of the ejb-local-ref mappings.

Returns:
Iterator of EjbLocalRefMetaData objects.

setEjbLocalReferences

public void setEjbLocalReferences(Map ejbReferences)
Parameters:
ejbReferences - - Map

getResourceReferences

public Iterator getResourceReferences()
Return an iterator of the resource-ref mappings.

Returns:
Iterator of ResourceRefMetaData objects.

setResourceReferences

public void setResourceReferences(Map resourceReferences)
Parameters:
resourceReferences - - Map

getResourceEnvReferences

public Iterator getResourceEnvReferences()
Return an iterator of the resource-ref mappings.

Returns:
Iterator of ResourceEnvRefMetaData objects.

setResourceEnvReferences

public void setResourceEnvReferences(Map resourceReferences)
Parameters:
resourceReferences - - Map

getMessageDestinationReferences

public Iterator getMessageDestinationReferences()
Return an iterator of message-destination-refs.

Returns:
Iterator of MessageDestinationRefMetaData objects.

setMessageDestinationReferences

public void setMessageDestinationReferences(Map messageDestinationReferences)
Parameters:
messageDestinationReferences - - Map

getMessageDestination

public MessageDestinationMetaData getMessageDestination(String name)
Get a message destination metadata

Parameters:
name - the name of the message destination
Returns:
the message destination metadata

setMessageDestination

public void setMessageDestination(Map messageDestinations)
Parameters:
messageDestinations - - Map

getServiceReferences

public Iterator getServiceReferences()
Return an iterator of the service-ref mappings.

Returns:
Iterator of ServiceRefMetaData objects

setServiceReferences

public void setServiceReferences(Map serviceReferences)
Parameters:
serviceReferences - - Map

getContextRoot

public String getContextRoot()
This the the jboss-web.xml descriptor context-root and it is only meaningful if a war is deployed outside of an ear.


setContextRoot

public void setContextRoot(String contextRoot)

getConfigFile

public String getConfigFile()

setConfigFile

public void setConfigFile(String configFile)

getConfigName

public String getConfigName()

setConfigName

public void setConfigName(String configName)

getWsdlPublishLocationByName

public String getWsdlPublishLocationByName(String name)
Get the optional wsdl publish location from jboss-web.xml.


setWsdlPublishLocationMap

public void setWsdlPublishLocationMap(Map wsdlPublishLocationMap)
Parameters:
wsdlPublishLocationMap - - Map

isWebServiceDeployment

public boolean isWebServiceDeployment()

setWebServiceDeployment

public void setWebServiceDeployment(boolean webServiceDeployment)

getJaccContextID

public String getJaccContextID()

setJaccContextID

public void setJaccContextID(String jaccContextID)

getSecurityDomain

public String getSecurityDomain()
Return the optional security-domain jboss-web.xml element.

Returns:
The jndiName of the security manager implementation that is responsible for security of the web application. May be null if there was no security-domain specified in the jboss-web.xml descriptor.

setSecurityDomain

public void setSecurityDomain(String securityDomain)
Set the security domain for this web application


isFlushOnSessionInvalidation

public boolean isFlushOnSessionInvalidation()
The flag indicating whether the associated security domain cache should be flushed when the session is invalidated.

Returns:
true if the flush should occur, false otherwise.

setFlushOnSessionInvalidation

public void setFlushOnSessionInvalidation(boolean flag)
The flag indicating whether the associated security domain cache should be flushed when the session is invalidated.

Parameters:
flag - - true if the flush should occur, false otherwise.

getSecurityContraints

public Iterator getSecurityContraints()
Get the security-constraint settings


setSecurityConstraints

public void setSecurityConstraints(Collection securityContraints)
Parameters:
securityContraints - - Collection

getSecurityRoleRefs

public Map getSecurityRoleRefs()
Returns:
>

getSecurityRoleRefs

public List getSecurityRoleRefs(String servletName)
Parameters:
servletName -
Returns:
List for the given servlet name

setSecurityRoleReferences

public void setSecurityRoleReferences(Map securityRoleReferences)
Parameters:
securityRoleReferences - - >

getSecurityRoleNames

public Set getSecurityRoleNames()
Get the security-role names from the web.xml descriptor

Returns:
Set of the security-role names from the web.xml

getSecurityRoles

public Map getSecurityRoles()
Get the optional map of security role/user mapping.

Returns:
Map

setSecurityRoles

public void setSecurityRoles(Map securityRoles)
Parameters:
securityRoles - - Map

getSecurityRoleNamesByPrincipal

public Set getSecurityRoleNamesByPrincipal(String userName)
Parameters:
userName -
Returns:
Set

getRunAsIdentity

public org.jboss.security.RunAsIdentity getRunAsIdentity(String servletName)
Access the RunAsIdentity associated with the given servlet

Parameters:
servletName - - the servlet-name from the web.xml
Returns:
RunAsIdentity for the servet if one exists, null otherwise

getRunAsIdentity

public Map getRunAsIdentity()
Returns:
servlet/run-as

setRunAsIdentity

public void setRunAsIdentity(Map runAsIdentity)
The jboss-web.xml servlet/run-as


getServletMappings

public HashMap getServletMappings()
Get the servlet-name values from the web.xml descriptor

Returns:
Set of the servlet-names from the servlet-mappings

setServletMappings

public void setServletMappings(Map servletMappings)
servlet-mapping/serlvet-name to url-pattern mapping

Parameters:
servletMappings - - Map

getServletNames

public Set getServletNames()
Get the servlet-name values from the web.xml descriptor

Returns:
Set of the servlet-names from the servlet-mappings

getServletClassMap

public Map getServletClassMap()
Get the servlet-name/servlet-class mapping from the web.xml descriptor

Returns:
Map of the servlet-name/servlet-class mapping from web.xml

mergeSecurityRoles

public void mergeSecurityRoles(Map applRoles)
Merge the security role/principal mapping defined in jboss-web.xml with the one defined at jboss-app.xml.


getVirtualHosts

public Iterator getVirtualHosts()
The servlet container virtual host the war should be deployed into. If null then the servlet container default host should be used.


setVirtualHosts

public void setVirtualHosts(Collection virtualHosts)
Parameters:
virtualHosts - - Collection

getDistributable

public boolean getDistributable()
The distributable flag.

Returns:
true if the web-app is marked distributable

setDistributable

public void setDistributable(boolean distributable)
Mark the web-app as distributable

Parameters:
distributable - - true for distributable

getDepends

public Collection getDepends()
Access the web application depends

Returns:
Iterator of JMX ObjectNames the web app depends on.

setDepends

public void setDepends(Collection depends)
Parameters:
depends - - Collection of the web app dependencies

getJava2ClassLoadingCompliance

public boolean getJava2ClassLoadingCompliance()
A flag indicating if the normal Java2 parent first class loading model should be used over the servlet 2.3 web container first model.

Returns:
true for parent first, false for the servlet 2.3 model

setJava2ClassLoadingCompliance

public void setJava2ClassLoadingCompliance(boolean flag)

getLoaderConfig

public org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig getLoaderConfig()

setLoaderConfig

public void setLoaderConfig(org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig loaderConfig)

getENCLoader

public ClassLoader getENCLoader()

setENCLoader

public void setENCLoader(ClassLoader encLoader)

getContextLoader

public ClassLoader getContextLoader()

setContextLoader

public void setContextLoader(ClassLoader cxtLoader)
Make sure this is called during performDeploy


getSessionCookies

public int getSessionCookies()

setSessionCookies

public void setSessionCookies(int sessionCookies)

getInvalidateSessionPolicy

public int getInvalidateSessionPolicy()

setInvalidateSessionPolicy

public void setInvalidateSessionPolicy(int invalidateSessionPolicy)

getReplicationType

public int getReplicationType()

getReplicationGranularity

public int getReplicationGranularity()

setReplicationGranularity

public void setReplicationGranularity(int replicationGranularity)

getReplicationFieldBatchMode

public boolean getReplicationFieldBatchMode()

importXml

public void importXml(Element element)
               throws org.jboss.deployment.DeploymentException
Description copied from class: MetaData
Imports either the jboss or ejb-jar from the given element.

Specified by:
importXml in interface XmlLoadable
Overrides:
importXml in class MetaData
Parameters:
element - The element to import.
Throws:
org.jboss.deployment.DeploymentException - Unrecognized root tag.

importWebXml

protected void importWebXml(Element webApp)
                     throws org.jboss.deployment.DeploymentException
Parse the elements of the web-app element used by the integration layer.

Throws:
org.jboss.deployment.DeploymentException

importJBossWebXml

protected void importJBossWebXml(Element jbossWeb)
                          throws org.jboss.deployment.DeploymentException
Parse the elements of the jboss-web element used by the integration layer.

Throws:
org.jboss.deployment.DeploymentException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.