From 5447cd7cd7e43b74677067312d28d89fa55f1c9f Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Tue, 13 Mar 2012 12:52:45 -0700 Subject: [PATCH] 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 --- .../server/util/ThreadLocalRequestScopePropagator.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java b/gerrit-server/src/main/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java index 403701a44b..581ccc1483 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/util/ThreadLocalRequestScopePropagator.java @@ -74,6 +74,13 @@ public abstract class ThreadLocalRequestScopePropagator /** * Returns a new context object based on the passed in context that has no * request scoped objects initialized. + *

+ * 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.