public class VirtualContextRootService extends ContextRootSwappingService
ContextRootSwappingService.ServletContextInfo
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
VirtualContextRootService()
Constructs an instanceof VirtualContextRootService
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
findContextRootFromServletPath(java.lang.String pServletPath)
find the context root within a servlet path
|
java.lang.String |
getAdditionalProductionURLPropertyName()
get AdditionalProductionURLPropertyName
|
ContextRootSwappingService.ServletContextInfo |
getContextRootForVirtualContextRoot(javax.servlet.ServletContext pServletContext,
java.lang.String pServletPath)
get a ServletContext for a virtual context root
|
ContextRootSwappingService.ServletContextInfo |
getContextRootForVirtualContextRoot(javax.servlet.ServletContext pServletContext,
java.lang.String pServletPath,
boolean pCheckForValidPath)
get a ServletContext for a virtual context root
|
java.lang.String |
getContextRootPropertyName()
get ContextRootPropertyName
|
java.lang.String |
getProductionURLPropertyName()
get ProductionURLPropertyName
|
java.lang.String |
getRealContextRoot(java.lang.String pVirtualContextRoot)
get the real context root for a given
virtual context root, or null if there isn't one
|
java.lang.String |
getRealServletPath(java.lang.String pServletPath)
transform the given servlet path containing
a virtual context root into a servlet path
with the corresponding real context root.
|
SiteContextManager |
getSiteContextManager()
get SiteContextManager
|
protected Site |
getSiteForVCRURL(java.lang.String pURL)
given a url containing a virtual context root, get the associated
site object
|
URLPatternMatchingRuleFilter |
getURLPatternMatchingRuleFilter()
get URLPatternMatchingRuleFilter
|
boolean |
hasVirtualContextRootMappings()
check to see if this service has any
virtual context root mappings
|
boolean |
hasVirtualContextRootMappings(java.lang.String pURL)
check to see if this service has any
virtual context root mappings
|
boolean |
isEnabled()
get Enabled - this determines if any VirtualContextRoot features will be
enabled.
|
void |
setAdditionalProductionURLPropertyName(java.lang.String pAdditionalProductionURLPropertyName)
set AdditionalProductionURLPropertyName
|
void |
setContextRootPropertyName(java.lang.String pContextRootPropertyName)
set ContextRootPropertyName
|
void |
setEnabled(boolean pEnabled)
set Enabled - this determines if any VirtualContextRoot features will be
enabled.
|
void |
setProductionURLPropertyName(java.lang.String pProductionURLPropertyName)
set ProductionURLPropertyName
|
void |
setSiteContextManager(SiteContextManager pSiteContextManager)
set SiteContextManager
|
void |
setURLPatternMatchingRuleFilter(URLPatternMatchingRuleFilter pURLPatternMatchingRuleFilter)
set URLPatternMatchingRuleFilter
|
java.lang.String |
transformRealURLToVirtualURL(java.lang.String pOriginalURL,
java.lang.String pRealURL)
given an original URL containing a virtual context root,
and second URL containing a real context root, return
a URL containing the virtual context root of the first URL, and
the servlet path of the second URL, if the second URL's context root
is the real context root corresponding to the virual context
root in the first URL
|
protected java.lang.String |
trimLevel(java.lang.String pURI)
trim one directory level off the URI
|
canGetResource, canGetResourceAsStream, findWelcomeFile, getDefaultWelcomeFiles, getWebAppFileExistenceService, getWelcomeFiles, setDefaultWelcomeFiles, setWebAppFileExistenceService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public VirtualContextRootService()
public void setContextRootPropertyName(java.lang.String pContextRootPropertyName)
pContextRootPropertyName
- the ContextRootPropertyNamepublic java.lang.String getContextRootPropertyName()
public void setProductionURLPropertyName(java.lang.String pProductionURLPropertyName)
pProductionURLPropertyName
- the ProductionURLPropertyNamepublic java.lang.String getProductionURLPropertyName()
public void setAdditionalProductionURLPropertyName(java.lang.String pAdditionalProductionURLPropertyName)
pAdditionalProductionURLPropertyName
- the AdditionalProductionURLPropertyNamepublic java.lang.String getAdditionalProductionURLPropertyName()
public void setEnabled(boolean pEnabled)
pEnabled
- the Enabledpublic boolean isEnabled()
public void setURLPatternMatchingRuleFilter(URLPatternMatchingRuleFilter pURLPatternMatchingRuleFilter)
pURLPatternMatchingRuleFilter
- the URLPatternMatchingRuleFilterpublic URLPatternMatchingRuleFilter getURLPatternMatchingRuleFilter()
public void setSiteContextManager(SiteContextManager pSiteContextManager)
pSiteContextManager
- the SiteContextManagerpublic SiteContextManager getSiteContextManager()
public boolean hasVirtualContextRootMappings()
public boolean hasVirtualContextRootMappings(java.lang.String pURL)
pURL
- the url used to determine the site that
corresponds to the virtual context root, if null, then
the site associated with the current thread is usedpublic ContextRootSwappingService.ServletContextInfo getContextRootForVirtualContextRoot(javax.servlet.ServletContext pServletContext, java.lang.String pServletPath)
pServletContext
- the current servlet context, if this is null
then no ServletContext will be returned within the
ServletContextInfo object, and no logic will be performed
to determine the welcome file path for the given servlet pathpServletPath
- the servlet pathpublic ContextRootSwappingService.ServletContextInfo getContextRootForVirtualContextRoot(javax.servlet.ServletContext pServletContext, java.lang.String pServletPath, boolean pCheckForValidPath)
pServletContext
- the current servlet context, if this is null
then no ServletContext will be returned within the
ServletContextInfo object, and no logic will be performed
to determine the welcome file path for the given servlet pathpServletPath
- the servlet pathpCheckForValidPath
- - if true, will check to make sure there is a resource
at the given location before returning the context info. if false, will return the
context info regardless of whether the resource exists. Useful for getting servlets,
which can't be checked against ServletContext.getResourceAsStream()public java.lang.String getRealServletPath(java.lang.String pServletPath)
pServletPath
- the virtual context root servlet pathpublic java.lang.String findContextRootFromServletPath(java.lang.String pServletPath)
public java.lang.String getRealContextRoot(java.lang.String pVirtualContextRoot)
pVirtualContextRoot
- the virtual context rootprotected java.lang.String trimLevel(java.lang.String pURI)
protected Site getSiteForVCRURL(java.lang.String pURL)
pURL
- the virtual context root urlpublic java.lang.String transformRealURLToVirtualURL(java.lang.String pOriginalURL, java.lang.String pRealURL)
pOriginalURL
- the url containing the virtual context rootpRealURL
- the url containing the real context root