public final class ThreadLocalHttpContext extends Object implements HttpContext
HttpContext
using ThreadLocal
to store HttpRequestContext
and HttpResponseContext
instances
associated with threads.Constructor and Description |
---|
ThreadLocalHttpContext() |
Modifier and Type | Method and Description |
---|---|
HttpContext |
get() |
Map<String,Object> |
getProperties()
Get the mutable properties.
|
HttpRequestContext |
getRequest()
Get the HTTP request information.
|
HttpResponseContext |
getResponse()
Get the HTTP response information.
|
ExtendedUriInfo |
getUriInfo()
Get the extended URI information.
|
boolean |
isTracingEnabled()
Check if tracing is enabled.
|
void |
set(HttpContext context)
Set the
HttpContext for the current thread. |
void |
trace(String message)
Add a trace message.
|
public void set(HttpContext context)
HttpContext
for the current thread.public HttpContext get()
public ExtendedUriInfo getUriInfo()
HttpContext
getUriInfo
in interface HttpContext
public HttpRequestContext getRequest()
HttpContext
getRequest
in interface HttpContext
public HttpResponseContext getResponse()
HttpContext
getResponse
in interface HttpContext
public Map<String,Object> getProperties()
HttpContext
Care should be taken not to clear the properties or remove properties that are unknown otherwise unspecified behaviour may result.
getProperties
in interface HttpContext
public boolean isTracingEnabled()
Traceable
isTracingEnabled
in interface Traceable
public void trace(String message)
Traceable
A trace message will be added if Traceable.isTracingEnabled()
returns
true and tracing contraints are satisfied.
Copyright © 2013 Oracle Corporation. All rights reserved.