C
- "context" type stored in the ThreadLocal
.public abstract class ThreadLocalRequestScopePropagator<C> extends RequestScopePropagator
RequestScopePropagator
implementation for request scopes based on a ThreadLocal
context.Modifier | Constructor and Description |
---|---|
protected |
ThreadLocalRequestScopePropagator(com.google.inject.Scope scope,
java.lang.ThreadLocal<C> threadLocal,
ThreadLocalRequestContext local,
com.google.inject.Provider<RequestScopedReviewDbProvider> dbProviderProvider) |
Modifier and Type | Method and Description |
---|---|
protected abstract C |
continuingContext(C ctx)
Returns a new context object based on the passed in context that has no request scoped objects
initialized.
|
protected <T> java.util.concurrent.Callable<T> |
wrapImpl(java.util.concurrent.Callable<T> callable) |
cleanup, context, wrap, wrap
protected ThreadLocalRequestScopePropagator(com.google.inject.Scope scope, java.lang.ThreadLocal<C> threadLocal, ThreadLocalRequestContext local, com.google.inject.Provider<RequestScopedReviewDbProvider> dbProviderProvider)
protected final <T> java.util.concurrent.Callable<T> wrapImpl(java.util.concurrent.Callable<T> callable)
wrapImpl
in class RequestScopePropagator
RequestScopePropagator.wrap(Callable)
protected abstract C continuingContext(C ctx)
Note that some code paths expect request-scoped objects like CurrentUser
to be
constructible starting from just the context object returned by this method. For example, in
the SSH scope, the context includes the SshSession
, which is used by SshCurrentUserProvider
to construct a new CurrentUser
in the new thread.
ctx
- the context to continue.