Fix JavaDoc comment

This commit is contained in:
Simon Willnauer 2016-01-20 09:46:36 +01:00
parent 5374bd8e34
commit 0ddbfb25a6
1 changed files with 2 additions and 4 deletions

View File

@ -43,13 +43,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
* and directly added as the headers of the threads {@link ThreadContext} (see {@link #readHeaders(StreamInput)}. In order to not modify the context that is currently
* active on this thread the network code uses a try/with pattern to stash it's current context, read headers into a fresh one and once the request is handled or a handler thread
* is forked (which in turn inherits the context) it restores the previous context. For instance:
*
* </p>
* <pre>
* // current context is stashed and replaced with a default context
* try (StoredContext context = threadContext.stashContext()) {
* threadContext.readHeaders(in); // read headers into current context
* if (fork) {
* threadPool.execute(() -> request.handle()); // inherits context
* threadPool.execute(() -&gt; request.handle()); // inherits context
* } else {
* request.handle();
* }
@ -57,8 +57,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
* // previous context is restored on StoredContext#close()
* </pre>
*
* </p>
*
*/
public final class ThreadContext implements Closeable, Writeable<ThreadContext.ThreadContextStruct>{