| Modifier and Type | Class and Description |
|---|---|
| public static enum | |
| public static interface | ContextHandler.ContextScopeListener
Listener for all threads entering context scope, including async IO callbacks |
| private static enum | ContextHandler.ProtectedTargetType
The type of protected target match |
| public class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final ThreadLocal | |
| private final List | |
| private boolean | |
| private final AtomicReference | |
| private Resource | |
| private ClassLoader | |
| private final ContextHandler. | |
| private final List | |
| private String | |
| private String | |
| private Request. | |
| private final MimeTypes. | |
| private final Attributes | |
| private Index | |
| private boolean | |
| private File | |
| private boolean | |
| private boolean | |
| private final List | |
| private static final Logger | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAliasCheck(AliasCheck
The alias checker check)Add an AliasCheck instance to possibly permit aliased resources |
| public boolean | Returns: true if the listener was addedthe event listener to add listener)Overrides org. Implements org. |
| public void | addVirtualHosts(String...
Array of virtual hosts that this context responds to. A null/empty array means any hostname is acceptable. Host names may be String
representation of IP addresses. Host names may start with '*.' to wildcard one level of names. Hosts and wildcard hosts may be followed with
virtualHosts)"@connectorname", in which case they will match only if the Connector#getName() for the request also matches. If an entry is just
"@connectorname" it will match any host if that connector was used. Note - In previous versions if one or more connectorname only entries existed
and none of the connectors matched the handler would not match regardless of any hostname entries. If there is one or more connectorname only
entries and one or more host only entries but no hostname and connector entries we assume the old behavior and will log a warning. The warning
can be removed by removing the host entries that were previously being ignored, or modifying to include a hostname and connectorname entry.Either set virtual hosts or add to an existing set of virtual hosts. |
| public boolean | checkAlias(String
The path the aliased resource was created for. pathInContext, Resource The aliased resourced. resource)Implements org. |
| public boolean | |
| public void | |
| public void | clearAttributes()
Overrides default org. |
| protected void | |
| public void | destroy()
Overrides org. Implements org. |
| protected void | doStart()
Overrides org. |
| protected void | doStop()
Stops the managed lifecycle beans in the reverse order they were added.
|
| public void | dump(Appendable
The appendable to dump to out, String The indent to apply after any new lines. indent)Overrides org. Implements org. |
| protected ClassLoader | |
| protected void | |
| public List | |
| public boolean | Returns: the allowNullPathInfo true if /context is not redirected to /context/
|
| public Object | getAttribute(String
the attribute to get name)Implements org. |
| public Set | getAttributeNameSet()
Implements org. |
| public Resource | |
| public ClassLoader | |
| public String | Returns: Returns the classLoader.Make best effort to extract a file classpath from the context classloader |
| public ContextHandler. | |
| public static ContextHandler | |
| public String | |
| public static Context | Returns: TheContext from a ContextHandler;
or null if the current Thread is not scoped to a ContextHandler.Get the current Context if any. |
| public static Context | Returns: TheContext from a ContextHandler;
or Server#getContext() if the current Thread is not scoped to a ContextHandler.The server. server)Get the current Context if any, or else server context if any. |
| public static ContextHandler | |
| public String | |
| public Request. | |
| public MimeTypes. | Returns: A mutable MimeTypes that wraps theServer#getMimeTypes()
once ContextHandler#setServer(Server) has been called.
|
| public String[] | |
| public File | Returns: The temporary directory configured for the context, or null if none configured.
|
| public List | Returns: list of virtual hosts that this context responds to. A null/empty array means any hostname is acceptable. Host names may be String representation of IP addresses. Host names may start with '*.' to wildcard one level of names. Hosts and wildcard hosts may be followed with"@connectorname", in which case they will match only if the Connector#getName() for the request also matches. If an entry is just
"@connectorname" it will match any host if that connector was used. Note - In previous versions if one or more connectorname only entries existed
and none of the connectors matched the handler would not match regardless of any hostname entries. If there is one or more connectorname only
entries and one or more host only entries but no hostname and connector entries we assume the old behavior and will log a warning. The warning
can be removed by removing the host entries that were previously being ignored, or modifying to include a hostname and connectorname entry.Get the virtual hosts for the context. |
| public boolean | handle(Request
the HTTP request to handle request, Response the HTTP response to handle response, Callback the callback to complete when the handling is complete callback)Overrides org. Implements org. Invoked to handle the passed HTTP request and response. |
| protected boolean | handleByContextHandler(String pathInContext, ContextRequest request, Response response, Callback callback)
|
| protected void | |
| protected void | |
| public boolean | |
| public boolean | Returns: true if target is a protected targetthe target to test target)Check the target when a target within a context is determined. |
| public boolean | Returns: true if tmp directory will persist between startups of the context
|
| protected ContextHandler. | |
| private static String | |
| protected void | |
| protected void | |
| public Object | removeAttribute(String
the attribute to remove name)Implements org. |
| public boolean | removeEventListener(EventListener
the listener to remove listener)Overrides org. Implements org. |
| public void | removeVirtualHosts(String...
Array of virtual hosts that this context responds to. A null/empty array means any hostname is acceptable. Host names may be String
representation of IP addresses. Host names may start with '*.' to wildcard one level of names. Hosts and wildcard hosts may be followed with
virtualHosts)"@connectorname", in which case they will match only if the Connector#getName() for the request also matches. If an entry is just
"@connectorname" it will match any host if that connector was used. Note - In previous versions if one or more connectorname only entries existed
and none of the connectors matched the handler would not match regardless of any hostname entries. If there is one or more connectorname only
entries and one or more host only entries but no hostname and connector entries we assume the old behavior and will log a warning. The warning
can be removed by removing the host entries that were previously being ignored, or modifying to include a hostname and connectorname entry.Removes an array of virtual host entries, if this removes all entries the _vhosts will be set to null |
| public void | setAliasChecks(List<AliasCheck>
list of AliasCheck instances checks)Set list of AliasCheck instances. |
| public void | setAllowNullPathInContext(boolean
true if /context is not redirected to /context/ allowNullPathInContext)Set true if /context is not redirected to /context/. |
| public Object | setAttribute(String
the attribute to set name, Object the value to set. A null value is equivalent to removing the attribute. attribute)Implements org. |
| public void | |
| public void | setBaseResource(Resource
The base resource for the context. resourceBase)Set the base resource to serve content from for this context, which must exist and be readable when the context is started. |
| public void | setBaseResourceAsPath(Path
The path to create a base resource from. path)Set the base resource to serve content from. |
| public void | setBaseResourceAsString(String
The path to create a base resource from. base)Set the base resource to serve content from. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setProtectedTargets(String[]
Array of URL prefix. Each prefix is in the form /path and will match either /path exactly or /path/anything targets)
|
| public void | setServer(Server
the server)Server to associate to this HandlerOverrides org. Implements org. Server to associate to this Handler.
|
| public void | setTempDirectory(File
A directory. If it does not exist, it must be able to be created during start. tempDirectory)Set the temporary directory returned by |
| public void | setTempDirectoryPersistent(boolean
true to persist the temp directory on shutdown / exit of the context persist)Set if the temp directory for this context will be kept over a stop and start cycle. |
| public void | setVirtualHosts(List<String>
List of virtual hosts that this context responds to. A null/empty list means any hostname is acceptable. Host names may be String
representation of IP addresses. Host names may start with vhosts)"*." to wildcard one level of names. Hosts and wildcard hosts may be followed with
"@connectorname" (eg: "*.example.org@connectorname"), in which case they will match only if the Connector#getName()
for the request also matches. If an entry is just "@connectorname" it will match any host if that connector was used.Set the virtual hosts for the context. |
| public String | toString()
Overrides org. |
| protected ContextRequest | |
| protected ContextResponse |