Class ThreadLocalRequestScopePropagator<C>

java.lang.Object
com.google.gerrit.server.util.RequestScopePropagator
com.google.gerrit.server.util.ThreadLocalRequestScopePropagator<C>
Type Parameters:
C - "context" type stored in the ThreadLocal.
Direct Known Subclasses:
PerThreadRequestScope.Propagator

public abstract class ThreadLocalRequestScopePropagator<C> extends RequestScopePropagator
RequestScopePropagator implementation for request scopes based on a ThreadLocal context.
  • Constructor Details

  • Method Details

    • wrapImpl

      protected final <T> Callable<T> wrapImpl(Callable<T> callable)
      Description copied from class: RequestScopePropagator
      Ensures that the current request state is available when the passed in Callable is invoked

      See RequestScopePropagator.wrap(Callable)

      Specified by:
      wrapImpl in class RequestScopePropagator
      See Also:
    • continuingContext

      protected abstract C continuingContext(C ctx)
      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 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.

      Parameters:
      ctx - the context to continue.
      Returns:
      a new context.