public final class Mapper extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Mapper.ContextList |
protected static class |
Mapper.ContextVersion |
protected static class |
Mapper.MapElement<T> |
protected static class |
Mapper.MappedContext |
protected static class |
Mapper.MappedHost |
protected static class |
Mapper.MappedWrapper |
Modifier and Type | Field and Description |
---|---|
protected Map<Context,Mapper.ContextVersion> |
contextObjectToContextVersionMap
Mapping from Context object to Context version to support
RequestDispatcher mappings.
|
protected String |
defaultHostName
Default host name.
|
protected Mapper.MappedHost[] |
hosts
Array containing the virtual hosts definitions.
|
protected static StringManager |
sm |
Constructor and Description |
---|
Mapper() |
Modifier and Type | Method and Description |
---|---|
void |
addContextVersion(String hostName,
Host host,
String path,
String version,
Context context,
String[] welcomeResources,
WebResourceRoot resources)
|
void |
addContextVersion(String hostName,
Host host,
String path,
String version,
Context context,
String[] welcomeResources,
WebResourceRoot resources,
Collection<WrapperMappingInfo> wrappers)
Add a new Context to an existing Host.
|
void |
addHost(String name,
String[] aliases,
Host host)
Add a new host to the mapper.
|
void |
addHostAlias(String name,
String alias)
Add an alias to an existing host.
|
void |
addWelcomeFile(String hostName,
String contextPath,
String version,
String welcomeFile)
Add a welcome file to the given context.
|
protected void |
addWrapper(Mapper.ContextVersion context,
String path,
Wrapper wrapper,
boolean jspWildCard,
boolean resourceOnly)
Adds a wrapper to the given context.
|
void |
addWrapper(String hostName,
String contextPath,
String version,
String path,
Wrapper wrapper,
boolean jspWildCard,
boolean resourceOnly) |
void |
addWrappers(String hostName,
String contextPath,
String version,
Collection<WrapperMappingInfo> wrappers) |
void |
clearWelcomeFiles(String hostName,
String contextPath,
String version)
Clear the welcome files for the given context.
|
void |
map(Context context,
MessageBytes uri,
MappingData mappingData)
Map the specified URI relative to the context,
mutating the given mapping data.
|
void |
map(MessageBytes host,
MessageBytes uri,
String version,
MappingData mappingData)
Map the specified host name and URI, mutating the given mapping data.
|
void |
pauseContextVersion(Context ctxt,
String hostName,
String contextPath,
String version)
Mark a context as being reloaded.
|
void |
removeContextVersion(Context ctxt,
String hostName,
String path,
String version)
Remove a context from an existing host.
|
void |
removeHost(String name)
Remove a host from the mapper.
|
void |
removeHostAlias(String alias)
Remove a host alias
|
void |
removeWelcomeFile(String hostName,
String contextPath,
String version,
String welcomeFile)
Remove a welcome file from the given context.
|
protected void |
removeWrapper(Mapper.ContextVersion context,
String path) |
void |
removeWrapper(String hostName,
String contextPath,
String version,
String path)
Remove a wrapper from an existing context.
|
void |
setDefaultHostName(String defaultHostName)
Set default host.
|
protected static final StringManager sm
protected Mapper.MappedHost[] hosts
protected String defaultHostName
protected Map<Context,Mapper.ContextVersion> contextObjectToContextVersionMap
public void setDefaultHostName(String defaultHostName)
defaultHostName
- Default host namepublic void addHost(String name, String[] aliases, Host host)
name
- Virtual host namealiases
- Alias names for the virtual hosthost
- Host objectpublic void removeHost(String name)
name
- Virtual host namepublic void addHostAlias(String name, String alias)
name
- The name of the hostalias
- The alias to addpublic void removeHostAlias(String alias)
alias
- The alias to remove@Deprecated public void addContextVersion(String hostName, Host host, String path, String version, Context context, String[] welcomeResources, WebResourceRoot resources)
addContextVersion(String, Host, String, String, Context, String[], WebResourceRoot, Collection)
hostName
- Virtual host name this context belongs tohost
- Host objectpath
- Context pathversion
- Context versioncontext
- Context objectwelcomeResources
- Welcome files defined for this contextresources
- Static resources of the contextpublic void addContextVersion(String hostName, Host host, String path, String version, Context context, String[] welcomeResources, WebResourceRoot resources, Collection<WrapperMappingInfo> wrappers)
hostName
- Virtual host name this context belongs tohost
- Host objectpath
- Context pathversion
- Context versioncontext
- Context objectwelcomeResources
- Welcome files defined for this contextresources
- Static resources of the contextwrappers
- Information on wrapper mappingspublic void removeContextVersion(Context ctxt, String hostName, String path, String version)
ctxt
- The actual contexthostName
- Virtual host name this context belongs topath
- Context pathversion
- Context versionpublic void pauseContextVersion(Context ctxt, String hostName, String contextPath, String version)
addContextVersion(...)
when context starts up.ctxt
- The actual contexthostName
- Virtual host name this context belongs tocontextPath
- Context pathversion
- Context versionpublic void addWrapper(String hostName, String contextPath, String version, String path, Wrapper wrapper, boolean jspWildCard, boolean resourceOnly)
public void addWrappers(String hostName, String contextPath, String version, Collection<WrapperMappingInfo> wrappers)
protected void addWrapper(Mapper.ContextVersion context, String path, Wrapper wrapper, boolean jspWildCard, boolean resourceOnly)
context
- The context to which to add the wrapperpath
- Wrapper mappingwrapper
- The Wrapper objectjspWildCard
- true if the wrapper corresponds to the JspServlet
and the mapping path contains a wildcard; false otherwiseresourceOnly
- true if this wrapper always expects a physical
resource to be present (such as a JSP)public void removeWrapper(String hostName, String contextPath, String version, String path)
hostName
- Virtual host name this wrapper belongs tocontextPath
- Context path this wrapper belongs topath
- Wrapper mappingprotected void removeWrapper(Mapper.ContextVersion context, String path)
public void addWelcomeFile(String hostName, String contextPath, String version, String welcomeFile)
hostName
- contextPath
- welcomeFile
- public void removeWelcomeFile(String hostName, String contextPath, String version, String welcomeFile)
hostName
- contextPath
- welcomeFile
- public void clearWelcomeFiles(String hostName, String contextPath, String version)
hostName
- contextPath
- public void map(MessageBytes host, MessageBytes uri, String version, MappingData mappingData) throws Exception
host
- Virtual host nameuri
- URImappingData
- This structure will contain the result of the mapping
operationException
public void map(Context context, MessageBytes uri, MappingData mappingData) throws Exception
context
- The actual contexturi
- URImappingData
- This structure will contain the result of the mapping
operationException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.