mirror of
https://github.com/jetty/jetty.project.git
synced 2025-03-04 04:49:12 +00:00
434009 Improved javadoc for accessing HttpChannel and HttpConnection
This commit is contained in:
parent
871b330ba8
commit
c6f394ab14
@ -73,6 +73,11 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable, H
|
|||||||
private static final Logger LOG = Log.getLogger(HttpChannel.class);
|
private static final Logger LOG = Log.getLogger(HttpChannel.class);
|
||||||
private static final ThreadLocal<HttpChannel<?>> __currentChannel = new ThreadLocal<>();
|
private static final ThreadLocal<HttpChannel<?>> __currentChannel = new ThreadLocal<>();
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
/** Get the current channel that this thread is dispatched to.
|
||||||
|
* @see Request#getAttribute(String) for a more general way to access the HttpChannel
|
||||||
|
* @return the current HttpChannel or null
|
||||||
|
*/
|
||||||
public static HttpChannel<?> getCurrentHttpChannel()
|
public static HttpChannel<?> getCurrentHttpChannel()
|
||||||
{
|
{
|
||||||
return __currentChannel.get();
|
return __currentChannel.get();
|
||||||
|
@ -62,6 +62,13 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
|||||||
private volatile ByteBuffer _chunk = null;
|
private volatile ByteBuffer _chunk = null;
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------ */
|
||||||
|
/** Get the current connection that this thread is dispatched to.
|
||||||
|
* Note that a thread may be processing a request asynchronously and
|
||||||
|
* thus not be dispatched to the connection.
|
||||||
|
* @see Request#getAttribute(String) for a more general way to access the HttpConnection
|
||||||
|
* @return the current HttpConnection or null
|
||||||
|
*/
|
||||||
public static HttpConnection getCurrentConnection()
|
public static HttpConnection getCurrentConnection()
|
||||||
{
|
{
|
||||||
return __currentConnection.get();
|
return __currentConnection.get();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user