Clarify the behavior of continuingRequest()

It's not exactly true to say that ThreadLocalRequestScopePropagator
doesn't propagate *any* request-specific information, since the
context implementation type typically does contain some request-
specific information, which can in turn be used to derive the
necessary RequestScoped objects in the new thread.

Clarify this behavior in the javadoc, and give an example. This is a
fairly technical description, but the target audience is someone
implementing a new RequestScopePropagator, so they already need to
understand the request scope internals pretty well.

Change-Id: I3326444c76d305fa4b067288ab2a3c7e4ad32997
This commit is contained in:
Dave Borowitz
2012-03-13 12:52:45 -07:00
parent 0f13eb2fe7
commit 5447cd7cd7

View File

@@ -74,6 +74,13 @@ public abstract class ThreadLocalRequestScopePropagator<C>
/**
* Returns a new context object based on the passed in context that has no
* request scoped objects initialized.
* <p>
* Note that some code paths expect request-scoped objects like
* {@code CurrentUser} to be constructible starting from just the context
* object returned by this method. For example, in the SSH scope, the context
* includes the {@code SshSession}, which is used by
* {@code SshCurrentUserProvider} to construct a new {@code CurrentUser} in
* the new thread.
*
* @param ctx the context to continue.
* @return a new context.