java.lang.Object
com.meterware.servletunit.WebApplication
- All Implemented Interfaces:
- SessionListenerDispatcher
- class WebApplication
- extends java.lang.Object
- implements SessionListenerDispatcher
This class represents the information recorded about a single web
application. It is usually extracted from web.xml.
|
Method Summary |
(package private) void |
destroyServlets()
Calls the destroy method for every active servlet. |
private void |
extractContextParameters(org.w3c.dom.Document document)
|
private void |
extractListeners(org.w3c.dom.Document document)
|
private void |
extractLoginConfiguration(org.w3c.dom.Document document)
|
private void |
extractSecurityConstraints(org.w3c.dom.Document document)
|
(package private) java.lang.String |
getAuthenticationRealm()
|
(package private) java.util.Hashtable |
getContextParameters()
|
(package private) java.lang.String |
getContextPath()
|
private WebApplication.SecurityConstraint |
getControllingConstraint(java.lang.String urlPath)
|
(package private) java.net.URL |
getErrorURL()
|
(package private) java.net.URL |
getLoginURL()
|
(package private) java.lang.String[] |
getPermittedRoles(java.net.URL url)
Returns an array containing the roles permitted to access the specified URL. |
(package private) java.io.File |
getResourceFile(java.lang.String path)
|
(package private) javax.servlet.ServletContext |
getServletContext()
|
(package private) ServletMetaData |
getServletRequest(java.net.URL url)
|
private void |
notifyContextDestroyed()
|
private void |
notifyContextInitialized()
|
private static boolean |
patternMatches(java.lang.String urlPattern,
java.lang.String urlPath)
|
private void |
registerFilter(java.util.Dictionary mapping,
org.w3c.dom.Element filterElement)
|
private void |
registerFilterClass(java.util.Dictionary mapping,
org.w3c.dom.Element filterElement)
|
private void |
registerFilterForServlet(java.lang.String servletName,
WebApplication.FilterConfiguration filterConfiguration)
|
private void |
registerFilterForUrl(java.lang.String resourceName,
WebApplication.FilterConfiguration filterConfiguration)
|
private void |
registerFilters(org.w3c.dom.Document document)
|
private void |
registerServlet(java.util.Dictionary mapping,
org.w3c.dom.Element servletElement)
|
(package private) void |
registerServlet(java.lang.String resourceName,
java.lang.String servletClassName,
java.util.Hashtable initParams)
Registers a servlet class to be run. |
(package private) void |
registerServlet(java.lang.String resourceName,
WebApplication.ServletConfiguration servletConfiguration)
Registers a servlet to be run. |
private void |
registerServletClass(java.util.Dictionary mapping,
org.w3c.dom.Element servletElement)
|
private void |
registerServlets(org.w3c.dom.Document document)
|
(package private) boolean |
requiresAuthorization(java.net.URL url)
Returns true if the specified path may only be accesses by an authorized user. |
void |
sendAttributeAdded(javax.servlet.http.HttpSession session,
java.lang.String name,
java.lang.Object value)
|
(package private) void |
sendAttributeAdded(java.lang.String name,
java.lang.Object value)
|
void |
sendAttributeRemoved(javax.servlet.http.HttpSession session,
java.lang.String name,
java.lang.Object oldValue)
|
(package private) void |
sendAttributeRemoved(java.lang.String name,
java.lang.Object value)
|
void |
sendAttributeReplaced(javax.servlet.http.HttpSession session,
java.lang.String name,
java.lang.Object oldValue)
|
(package private) void |
sendAttributeReplaced(java.lang.String name,
java.lang.Object value)
|
void |
sendSessionCreated(javax.servlet.http.HttpSession session)
|
void |
sendSessionDestroyed(javax.servlet.http.HttpSession session)
|
(package private) void |
shutDown()
|
(package private) boolean |
usesBasicAuthentication()
Returns true if this application uses Basic Authentication. |
(package private) boolean |
usesFormAuthentication()
Returns true if this application uses form-based authentication. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NULL_SECURITY_CONSTRAINT
private static final WebApplication.SecurityConstraint NULL_SECURITY_CONSTRAINT
SECURITY_CHECK_CONFIGURATION
private final WebApplication.ServletConfiguration SECURITY_CHECK_CONFIGURATION
SECURITY_CHECK_MAPPING
private final WebApplication.WebResourceMapping SECURITY_CHECK_MAPPING
_servletMapping
private WebApplication.WebResourceMap _servletMapping
- A mapping of resource names to servlet configurations.
_filterUrlMapping
private FilterUrlMap _filterUrlMapping
- A mapping of resource names to filter configurations.
_filterMapping
private java.util.Hashtable _filterMapping
- A mapping of servlet names to filter configurations.
_securityConstraints
private java.util.ArrayList _securityConstraints
_contextListeners
private java.util.ArrayList _contextListeners
_contextAttributeListeners
private java.util.ArrayList _contextAttributeListeners
_sessionListeners
private java.util.ArrayList _sessionListeners
_sessionAttributeListeners
private java.util.ArrayList _sessionAttributeListeners
_useBasicAuthentication
private boolean _useBasicAuthentication
_useFormAuthentication
private boolean _useFormAuthentication
_authenticationRealm
private java.lang.String _authenticationRealm
_loginURL
private java.net.URL _loginURL
_errorURL
private java.net.URL _errorURL
_contextParameters
private java.util.Hashtable _contextParameters
_contextDir
private java.io.File _contextDir
_contextPath
private java.lang.String _contextPath
_servletContext
private ServletUnitServletContext _servletContext
DONT_AUTOLOAD
static final int DONT_AUTOLOAD
- See Also:
- Constant Field Values
ANY_LOAD_ORDER
static final int ANY_LOAD_ORDER
- See Also:
- Constant Field Values
NO_FILTERS
static final FilterMetaData[] NO_FILTERS
WebApplication
WebApplication()
- Constructs a default application spec with no information.
WebApplication
WebApplication(org.w3c.dom.Document document)
throws java.net.MalformedURLException,
org.xml.sax.SAXException
- Constructs an application spec from an XML document.
WebApplication
WebApplication(org.w3c.dom.Document document,
java.lang.String contextPath)
throws java.net.MalformedURLException,
org.xml.sax.SAXException
- Constructs an application spec from an XML document.
WebApplication
WebApplication(org.w3c.dom.Document document,
java.io.File file,
java.lang.String contextPath)
throws java.net.MalformedURLException,
org.xml.sax.SAXException
- Constructs an application spec from an XML document.
extractListeners
private void extractListeners(org.w3c.dom.Document document)
throws org.xml.sax.SAXException
notifyContextInitialized
private void notifyContextInitialized()
shutDown
void shutDown()
notifyContextDestroyed
private void notifyContextDestroyed()
sendAttributeAdded
void sendAttributeAdded(java.lang.String name,
java.lang.Object value)
sendAttributeReplaced
void sendAttributeReplaced(java.lang.String name,
java.lang.Object value)
sendAttributeRemoved
void sendAttributeRemoved(java.lang.String name,
java.lang.Object value)
extractSecurityConstraints
private void extractSecurityConstraints(org.w3c.dom.Document document)
throws org.xml.sax.SAXException
getContextPath
java.lang.String getContextPath()
getServletContext
javax.servlet.ServletContext getServletContext()
registerServlet
void registerServlet(java.lang.String resourceName,
java.lang.String servletClassName,
java.util.Hashtable initParams)
- Registers a servlet class to be run.
registerServlet
void registerServlet(java.lang.String resourceName,
WebApplication.ServletConfiguration servletConfiguration)
- Registers a servlet to be run.
destroyServlets
void destroyServlets()
- Calls the destroy method for every active servlet.
getServletRequest
ServletMetaData getServletRequest(java.net.URL url)
usesBasicAuthentication
boolean usesBasicAuthentication()
- Returns true if this application uses Basic Authentication.
usesFormAuthentication
boolean usesFormAuthentication()
- Returns true if this application uses form-based authentication.
getAuthenticationRealm
java.lang.String getAuthenticationRealm()
getLoginURL
java.net.URL getLoginURL()
getErrorURL
java.net.URL getErrorURL()
requiresAuthorization
boolean requiresAuthorization(java.net.URL url)
- Returns true if the specified path may only be accesses by an authorized user.
getPermittedRoles
java.lang.String[] getPermittedRoles(java.net.URL url)
- Returns an array containing the roles permitted to access the specified URL.
getControllingConstraint
private WebApplication.SecurityConstraint getControllingConstraint(java.lang.String urlPath)
getResourceFile
java.io.File getResourceFile(java.lang.String path)
getContextParameters
java.util.Hashtable getContextParameters()
sendSessionCreated
public void sendSessionCreated(javax.servlet.http.HttpSession session)
- Specified by:
sendSessionCreated in interface SessionListenerDispatcher
sendSessionDestroyed
public void sendSessionDestroyed(javax.servlet.http.HttpSession session)
- Specified by:
sendSessionDestroyed in interface SessionListenerDispatcher
sendAttributeAdded
public void sendAttributeAdded(javax.servlet.http.HttpSession session,
java.lang.String name,
java.lang.Object value)
- Specified by:
sendAttributeAdded in interface SessionListenerDispatcher
sendAttributeReplaced
public void sendAttributeReplaced(javax.servlet.http.HttpSession session,
java.lang.String name,
java.lang.Object oldValue)
- Specified by:
sendAttributeReplaced in interface SessionListenerDispatcher
sendAttributeRemoved
public void sendAttributeRemoved(javax.servlet.http.HttpSession session,
java.lang.String name,
java.lang.Object oldValue)
- Specified by:
sendAttributeRemoved in interface SessionListenerDispatcher
registerFilters
private void registerFilters(org.w3c.dom.Document document)
throws org.xml.sax.SAXException
registerFilterClass
private void registerFilterClass(java.util.Dictionary mapping,
org.w3c.dom.Element filterElement)
throws org.xml.sax.SAXException
registerFilter
private void registerFilter(java.util.Dictionary mapping,
org.w3c.dom.Element filterElement)
throws org.xml.sax.SAXException
registerFilterForUrl
private void registerFilterForUrl(java.lang.String resourceName,
WebApplication.FilterConfiguration filterConfiguration)
registerFilterForServlet
private void registerFilterForServlet(java.lang.String servletName,
WebApplication.FilterConfiguration filterConfiguration)
extractLoginConfiguration
private void extractLoginConfiguration(org.w3c.dom.Document document)
throws java.net.MalformedURLException,
org.xml.sax.SAXException
registerServlets
private void registerServlets(org.w3c.dom.Document document)
throws org.xml.sax.SAXException
registerServletClass
private void registerServletClass(java.util.Dictionary mapping,
org.w3c.dom.Element servletElement)
throws org.xml.sax.SAXException
registerServlet
private void registerServlet(java.util.Dictionary mapping,
org.w3c.dom.Element servletElement)
throws org.xml.sax.SAXException
extractContextParameters
private void extractContextParameters(org.w3c.dom.Document document)
throws org.xml.sax.SAXException
patternMatches
private static boolean patternMatches(java.lang.String urlPattern,
java.lang.String urlPath)