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,
ThreadLocal<C> threadLocal,
ThreadLocalRequestContext local) |
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> Callable<T> |
wrapImpl(Callable<T> callable) |
cleanup, context, wrap, wrap
protected ThreadLocalRequestScopePropagator(com.google.inject.Scope scope, ThreadLocal<C> threadLocal, ThreadLocalRequestContext local)
protected final <T> Callable<T> wrapImpl(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.