Make ReviewDb available in the server on a per-thread basis
Allow types bound in the system injector to access the per-thread ReviewDb if they are invoked from within a request context, without caring about which entry they were invoked from. This allows email sending and some other change update action code to be bound at the global level and work in both SSH and HTTP invocations. Change-Id: I411ded5196ae6920573233fb0cde48f35ce7ad01
This commit is contained in:
@@ -14,7 +14,9 @@
|
||||
|
||||
package com.google.gerrit.server.util;
|
||||
|
||||
import com.google.gerrit.server.config.RequestScopedReviewDbProvider;
|
||||
import com.google.inject.OutOfScopeException;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.Scope;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -31,8 +33,10 @@ public abstract class ThreadLocalRequestScopePropagator<C>
|
||||
private final ThreadLocal<C> threadLocal;
|
||||
|
||||
protected ThreadLocalRequestScopePropagator(Scope scope,
|
||||
ThreadLocal<C> threadLocal, ThreadLocalRequestContext local) {
|
||||
super(scope, local);
|
||||
ThreadLocal<C> threadLocal,
|
||||
ThreadLocalRequestContext local,
|
||||
Provider<RequestScopedReviewDbProvider> dbProviderProvider) {
|
||||
super(scope, local, dbProviderProvider);
|
||||
this.threadLocal = threadLocal;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user