Move REST endpoints to singleton scope
The majority of REST endpoints don't maintain state and don't need to be created each time they are used. Exceptions are endpoints with @Option annotation and therefore must stay in default scope. Change-Id: Ia2ac8cfccf41966daa48334cedcb7a20101474d2
This commit is contained in:
committed by
Shawn Pearce
parent
f10c28adc7
commit
75f1583de0
@@ -44,6 +44,7 @@ import com.google.gerrit.server.git.TransferConfig;
|
||||
import com.google.gerrit.server.project.PutConfig.Input;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import org.eclipse.jgit.errors.ConfigInvalidException;
|
||||
import org.eclipse.jgit.errors.RepositoryNotFoundException;
|
||||
@@ -57,6 +58,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@Singleton
|
||||
public class PutConfig implements RestModifyView<ProjectResource, Input> {
|
||||
private static final Logger log = LoggerFactory.getLogger(PutConfig.class);
|
||||
public static class Input {
|
||||
|
||||
Reference in New Issue
Block a user