Line data Source code
1 : // Copyright (C) 2016 The Android Open Source Project
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 :
15 : package com.google.gerrit.server.config;
16 :
17 : import static com.google.inject.Scopes.SINGLETON;
18 :
19 : import com.google.common.base.Ticker;
20 : import com.google.common.cache.Cache;
21 : import com.google.gerrit.entities.SubmitRequirement;
22 : import com.google.gerrit.extensions.annotations.Exports;
23 : import com.google.gerrit.extensions.api.changes.ActionVisitor;
24 : import com.google.gerrit.extensions.api.projects.CommentLinkInfo;
25 : import com.google.gerrit.extensions.auth.oauth.OAuthLoginProvider;
26 : import com.google.gerrit.extensions.auth.oauth.OAuthTokenEncrypter;
27 : import com.google.gerrit.extensions.common.AccountDefaultDisplayName;
28 : import com.google.gerrit.extensions.common.AccountVisibility;
29 : import com.google.gerrit.extensions.config.CapabilityDefinition;
30 : import com.google.gerrit.extensions.config.CloneCommand;
31 : import com.google.gerrit.extensions.config.DownloadCommand;
32 : import com.google.gerrit.extensions.config.DownloadScheme;
33 : import com.google.gerrit.extensions.config.ExternalIncludedIn;
34 : import com.google.gerrit.extensions.config.FactoryModule;
35 : import com.google.gerrit.extensions.config.PluginProjectPermissionDefinition;
36 : import com.google.gerrit.extensions.events.AccountActivationListener;
37 : import com.google.gerrit.extensions.events.AccountIndexedListener;
38 : import com.google.gerrit.extensions.events.AgreementSignupListener;
39 : import com.google.gerrit.extensions.events.AssigneeChangedListener;
40 : import com.google.gerrit.extensions.events.AttentionSetListener;
41 : import com.google.gerrit.extensions.events.ChangeAbandonedListener;
42 : import com.google.gerrit.extensions.events.ChangeDeletedListener;
43 : import com.google.gerrit.extensions.events.ChangeIndexedListener;
44 : import com.google.gerrit.extensions.events.ChangeMergedListener;
45 : import com.google.gerrit.extensions.events.ChangeRestoredListener;
46 : import com.google.gerrit.extensions.events.ChangeRevertedListener;
47 : import com.google.gerrit.extensions.events.CommentAddedListener;
48 : import com.google.gerrit.extensions.events.GarbageCollectorListener;
49 : import com.google.gerrit.extensions.events.GitBatchRefUpdateListener;
50 : import com.google.gerrit.extensions.events.GitReferenceUpdatedListener;
51 : import com.google.gerrit.extensions.events.GroupIndexedListener;
52 : import com.google.gerrit.extensions.events.HashtagsEditedListener;
53 : import com.google.gerrit.extensions.events.HeadUpdatedListener;
54 : import com.google.gerrit.extensions.events.LifecycleListener;
55 : import com.google.gerrit.extensions.events.NewProjectCreatedListener;
56 : import com.google.gerrit.extensions.events.PluginEventListener;
57 : import com.google.gerrit.extensions.events.PrivateStateChangedListener;
58 : import com.google.gerrit.extensions.events.ProjectDeletedListener;
59 : import com.google.gerrit.extensions.events.ProjectIndexedListener;
60 : import com.google.gerrit.extensions.events.ReviewerAddedListener;
61 : import com.google.gerrit.extensions.events.ReviewerDeletedListener;
62 : import com.google.gerrit.extensions.events.RevisionCreatedListener;
63 : import com.google.gerrit.extensions.events.TopicEditedListener;
64 : import com.google.gerrit.extensions.events.UsageDataPublishedListener;
65 : import com.google.gerrit.extensions.events.VoteDeletedListener;
66 : import com.google.gerrit.extensions.events.WorkInProgressStateChangedListener;
67 : import com.google.gerrit.extensions.registration.DynamicItem;
68 : import com.google.gerrit.extensions.registration.DynamicMap;
69 : import com.google.gerrit.extensions.registration.DynamicSet;
70 : import com.google.gerrit.extensions.validators.CommentValidator;
71 : import com.google.gerrit.extensions.webui.BranchWebLink;
72 : import com.google.gerrit.extensions.webui.DiffWebLink;
73 : import com.google.gerrit.extensions.webui.EditWebLink;
74 : import com.google.gerrit.extensions.webui.FileHistoryWebLink;
75 : import com.google.gerrit.extensions.webui.FileWebLink;
76 : import com.google.gerrit.extensions.webui.ParentWebLink;
77 : import com.google.gerrit.extensions.webui.PatchSetWebLink;
78 : import com.google.gerrit.extensions.webui.ProjectWebLink;
79 : import com.google.gerrit.extensions.webui.ResolveConflictsWebLink;
80 : import com.google.gerrit.extensions.webui.TagWebLink;
81 : import com.google.gerrit.extensions.webui.TopMenu;
82 : import com.google.gerrit.extensions.webui.WebUiPlugin;
83 : import com.google.gerrit.server.AnonymousUser;
84 : import com.google.gerrit.server.CmdLineParserModule;
85 : import com.google.gerrit.server.CreateGroupPermissionSyncer;
86 : import com.google.gerrit.server.DeadlineChecker;
87 : import com.google.gerrit.server.DynamicOptions;
88 : import com.google.gerrit.server.ExceptionHook;
89 : import com.google.gerrit.server.ExceptionHookImpl;
90 : import com.google.gerrit.server.ExternalUser;
91 : import com.google.gerrit.server.IdentifiedUser;
92 : import com.google.gerrit.server.PerformanceMetrics;
93 : import com.google.gerrit.server.RequestListener;
94 : import com.google.gerrit.server.TraceRequestListener;
95 : import com.google.gerrit.server.account.AccountCacheImpl;
96 : import com.google.gerrit.server.account.AccountControl;
97 : import com.google.gerrit.server.account.AccountDeactivator;
98 : import com.google.gerrit.server.account.AccountExternalIdCreator;
99 : import com.google.gerrit.server.account.AccountManager;
100 : import com.google.gerrit.server.account.AccountModule;
101 : import com.google.gerrit.server.account.AccountTagProvider;
102 : import com.google.gerrit.server.account.AccountVisibilityProvider;
103 : import com.google.gerrit.server.account.CapabilityCollection;
104 : import com.google.gerrit.server.account.EmailExpander;
105 : import com.google.gerrit.server.account.GroupCacheImpl;
106 : import com.google.gerrit.server.account.GroupControl;
107 : import com.google.gerrit.server.account.GroupIncludeCacheImpl;
108 : import com.google.gerrit.server.account.ServiceUserClassifierImpl;
109 : import com.google.gerrit.server.account.VersionedAuthorizedKeys;
110 : import com.google.gerrit.server.account.externalids.ExternalIdCacheModule;
111 : import com.google.gerrit.server.account.externalids.ExternalIdModule;
112 : import com.google.gerrit.server.account.externalids.ExternalIdUpsertPreprocessor;
113 : import com.google.gerrit.server.approval.ApprovalsUtil;
114 : import com.google.gerrit.server.auth.AuthBackend;
115 : import com.google.gerrit.server.auth.UniversalAuthBackend;
116 : import com.google.gerrit.server.avatar.AvatarProvider;
117 : import com.google.gerrit.server.cache.CacheRemovalListener;
118 : import com.google.gerrit.server.change.AbandonOp;
119 : import com.google.gerrit.server.change.AccountPatchReviewStore;
120 : import com.google.gerrit.server.change.ChangeETagComputation;
121 : import com.google.gerrit.server.change.ChangeFinder;
122 : import com.google.gerrit.server.change.ChangeJson;
123 : import com.google.gerrit.server.change.ChangeKindCacheImpl;
124 : import com.google.gerrit.server.change.ChangePluginDefinedInfoFactory;
125 : import com.google.gerrit.server.change.EmailNewPatchSet;
126 : import com.google.gerrit.server.change.FileInfoJsonModule;
127 : import com.google.gerrit.server.change.MergeabilityCacheImpl;
128 : import com.google.gerrit.server.change.ReviewerSuggestion;
129 : import com.google.gerrit.server.change.RevisionJson;
130 : import com.google.gerrit.server.comment.CommentContextCacheImpl;
131 : import com.google.gerrit.server.events.EventFactory;
132 : import com.google.gerrit.server.events.EventListener;
133 : import com.google.gerrit.server.events.EventsMetrics;
134 : import com.google.gerrit.server.events.UserScopedEventListener;
135 : import com.google.gerrit.server.extensions.events.AttentionSetObserver;
136 : import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
137 : import com.google.gerrit.server.extensions.webui.UiActions;
138 : import com.google.gerrit.server.git.ChangeMessageModifier;
139 : import com.google.gerrit.server.git.GitModule;
140 : import com.google.gerrit.server.git.MergedByPushOp;
141 : import com.google.gerrit.server.git.MultiProgressMonitor;
142 : import com.google.gerrit.server.git.NotesBranchUtil;
143 : import com.google.gerrit.server.git.PureRevertCache;
144 : import com.google.gerrit.server.git.ReceivePackInitializer;
145 : import com.google.gerrit.server.git.TagCache;
146 : import com.google.gerrit.server.git.TransferConfig;
147 : import com.google.gerrit.server.git.receive.PluginPushOption;
148 : import com.google.gerrit.server.git.receive.ReceiveCommitsModule;
149 : import com.google.gerrit.server.git.validators.CommentCountValidator;
150 : import com.google.gerrit.server.git.validators.CommentCumulativeSizeValidator;
151 : import com.google.gerrit.server.git.validators.CommentSizeValidator;
152 : import com.google.gerrit.server.git.validators.CommitValidationListener;
153 : import com.google.gerrit.server.git.validators.MergeValidationListener;
154 : import com.google.gerrit.server.git.validators.MergeValidators;
155 : import com.google.gerrit.server.git.validators.MergeValidators.AccountMergeValidator;
156 : import com.google.gerrit.server.git.validators.MergeValidators.GroupMergeValidator;
157 : import com.google.gerrit.server.git.validators.MergeValidators.ProjectConfigValidator;
158 : import com.google.gerrit.server.git.validators.OnSubmitValidationListener;
159 : import com.google.gerrit.server.git.validators.OnSubmitValidators;
160 : import com.google.gerrit.server.git.validators.RefOperationValidationListener;
161 : import com.google.gerrit.server.git.validators.RefOperationValidators;
162 : import com.google.gerrit.server.git.validators.UploadValidationListener;
163 : import com.google.gerrit.server.git.validators.UploadValidators;
164 : import com.google.gerrit.server.group.db.GroupDbModule;
165 : import com.google.gerrit.server.index.change.ReindexAfterRefUpdate;
166 : import com.google.gerrit.server.logging.PerformanceLogger;
167 : import com.google.gerrit.server.mail.AutoReplyMailFilter;
168 : import com.google.gerrit.server.mail.EmailModule;
169 : import com.google.gerrit.server.mail.ListMailFilter;
170 : import com.google.gerrit.server.mail.MailFilter;
171 : import com.google.gerrit.server.mail.send.FromAddressGenerator;
172 : import com.google.gerrit.server.mail.send.FromAddressGeneratorProvider;
173 : import com.google.gerrit.server.mail.send.InboundEmailRejectionSender;
174 : import com.google.gerrit.server.mail.send.MailSoySauceModule;
175 : import com.google.gerrit.server.mail.send.MailSoyTemplateProvider;
176 : import com.google.gerrit.server.mime.FileTypeRegistry;
177 : import com.google.gerrit.server.mime.MimeUtilFileTypeRegistry;
178 : import com.google.gerrit.server.notedb.DeleteZombieCommentsRefs;
179 : import com.google.gerrit.server.notedb.NoteDbModule;
180 : import com.google.gerrit.server.notedb.StoreSubmitRequirementsOp;
181 : import com.google.gerrit.server.patch.DiffOperationsImpl;
182 : import com.google.gerrit.server.patch.PatchListCacheImpl;
183 : import com.google.gerrit.server.patch.PatchScriptFactory;
184 : import com.google.gerrit.server.patch.PatchScriptFactoryForAutoFix;
185 : import com.google.gerrit.server.patch.PatchSetInfoFactory;
186 : import com.google.gerrit.server.permissions.PermissionCollection;
187 : import com.google.gerrit.server.permissions.SectionSortCache;
188 : import com.google.gerrit.server.plugins.ReloadPluginListener;
189 : import com.google.gerrit.server.project.AccessControlModule;
190 : import com.google.gerrit.server.project.CommentLinkProvider;
191 : import com.google.gerrit.server.project.ProjectCacheImpl;
192 : import com.google.gerrit.server.project.ProjectNameLockManager;
193 : import com.google.gerrit.server.project.ProjectState;
194 : import com.google.gerrit.server.project.SubmitRequirementConfigValidator;
195 : import com.google.gerrit.server.project.SubmitRequirementsEvaluatorImpl;
196 : import com.google.gerrit.server.project.SubmitRuleEvaluator;
197 : import com.google.gerrit.server.query.FileEditsPredicate;
198 : import com.google.gerrit.server.query.approval.ApprovalModule;
199 : import com.google.gerrit.server.query.change.ChangeData;
200 : import com.google.gerrit.server.query.change.ChangeIsVisibleToPredicate;
201 : import com.google.gerrit.server.query.change.ChangeQueryBuilder;
202 : import com.google.gerrit.server.query.change.ConflictsCacheImpl;
203 : import com.google.gerrit.server.query.change.DistinctVotersPredicate;
204 : import com.google.gerrit.server.query.change.HasSubmoduleUpdatePredicate;
205 : import com.google.gerrit.server.quota.QuotaEnforcer;
206 : import com.google.gerrit.server.restapi.change.OnPostReview;
207 : import com.google.gerrit.server.restapi.change.SuggestReviewers;
208 : import com.google.gerrit.server.restapi.group.GroupModule;
209 : import com.google.gerrit.server.rules.DefaultSubmitRule.DefaultSubmitRuleModule;
210 : import com.google.gerrit.server.rules.IgnoreSelfApprovalRule.IgnoreSelfApprovalRuleModule;
211 : import com.google.gerrit.server.rules.PrologModule;
212 : import com.google.gerrit.server.rules.RulesCache;
213 : import com.google.gerrit.server.rules.SubmitRule;
214 : import com.google.gerrit.server.ssh.SshAddressesModule;
215 : import com.google.gerrit.server.submit.ConfiguredSubscriptionGraphFactory;
216 : import com.google.gerrit.server.submit.GitModules;
217 : import com.google.gerrit.server.submit.MergeSuperSetComputation;
218 : import com.google.gerrit.server.submit.SubmitStrategy;
219 : import com.google.gerrit.server.submit.SubscriptionGraph;
220 : import com.google.gerrit.server.tools.ToolsCatalog;
221 : import com.google.gerrit.server.update.BatchUpdate;
222 : import com.google.gerrit.server.util.IdGenerator;
223 : import com.google.gerrit.server.util.ThreadLocalRequestContext;
224 : import com.google.gerrit.server.validators.AccountActivationValidationListener;
225 : import com.google.gerrit.server.validators.AssigneeValidationListener;
226 : import com.google.gerrit.server.validators.GroupCreationValidationListener;
227 : import com.google.gerrit.server.validators.HashtagValidationListener;
228 : import com.google.gerrit.server.validators.OutgoingEmailValidationListener;
229 : import com.google.gerrit.server.validators.ProjectCreationValidationListener;
230 : import com.google.gitiles.blame.cache.BlameCache;
231 : import com.google.gitiles.blame.cache.BlameCacheImpl;
232 : import com.google.inject.Inject;
233 : import com.google.inject.TypeLiteral;
234 : import com.google.inject.internal.UniqueAnnotations;
235 : import com.google.inject.multibindings.OptionalBinder;
236 : import java.util.List;
237 : import org.eclipse.jgit.lib.Config;
238 : import org.eclipse.jgit.transport.PostReceiveHook;
239 : import org.eclipse.jgit.transport.PostUploadHook;
240 : import org.eclipse.jgit.transport.PreUploadHook;
241 :
242 : /** Starts global state with standard dependencies. */
243 : public class GerritGlobalModule extends FactoryModule {
244 : private final Config cfg;
245 :
246 : @Inject
247 152 : GerritGlobalModule(@GerritServerConfig Config cfg) {
248 152 : this.cfg = cfg;
249 152 : }
250 :
251 : @Override
252 : protected void configure() {
253 152 : bind(EmailExpander.class).toProvider(EmailExpanderProvider.class).in(SINGLETON);
254 :
255 152 : bind(IdGenerator.class);
256 152 : bind(RulesCache.class);
257 152 : bind(BlameCache.class).to(BlameCacheImpl.class);
258 152 : install(AccountCacheImpl.module());
259 152 : install(BatchUpdate.module());
260 152 : install(ChangeKindCacheImpl.module());
261 152 : install(ChangeFinder.module());
262 152 : install(ConflictsCacheImpl.module());
263 152 : install(DefaultPreferencesCacheImpl.module());
264 152 : install(GroupCacheImpl.module());
265 152 : install(GroupIncludeCacheImpl.module());
266 152 : install(MergeabilityCacheImpl.module());
267 152 : install(ServiceUserClassifierImpl.module());
268 152 : install(PatchListCacheImpl.module());
269 152 : install(ProjectCacheImpl.module());
270 152 : install(DiffOperationsImpl.module());
271 152 : install(SectionSortCache.module());
272 152 : install(SubmitStrategy.module());
273 152 : install(TagCache.module());
274 152 : install(PureRevertCache.module());
275 152 : install(CommentContextCacheImpl.module());
276 152 : install(SubmitRequirementsEvaluatorImpl.module());
277 :
278 152 : install(new AccessControlModule());
279 152 : install(new AccountModule());
280 152 : install(new CmdLineParserModule());
281 152 : install(new EmailModule());
282 152 : install(new ExternalIdCacheModule());
283 152 : install(new ExternalIdModule());
284 152 : install(new GitModule());
285 152 : install(new GroupDbModule());
286 152 : install(new GroupModule());
287 152 : install(new NoteDbModule());
288 152 : install(new PrologModule(cfg));
289 152 : install(new DefaultSubmitRuleModule());
290 152 : install(new IgnoreSelfApprovalRuleModule());
291 152 : install(new ReceiveCommitsModule());
292 152 : install(new SshAddressesModule());
293 152 : install(new FileInfoJsonModule());
294 152 : install(ThreadLocalRequestContext.module());
295 152 : install(new ApprovalModule());
296 152 : install(new MailSoySauceModule());
297 :
298 152 : factory(CapabilityCollection.Factory.class);
299 152 : factory(ChangeData.AssistedFactory.class);
300 152 : factory(ChangeJson.AssistedFactory.class);
301 152 : factory(ChangeIsVisibleToPredicate.Factory.class);
302 152 : factory(DistinctVotersPredicate.Factory.class);
303 152 : factory(HasSubmoduleUpdatePredicate.Factory.class);
304 152 : factory(DeadlineChecker.Factory.class);
305 152 : factory(EmailNewPatchSet.Factory.class);
306 152 : factory(MultiProgressMonitor.Factory.class);
307 152 : factory(PatchScriptFactory.Factory.class);
308 152 : factory(PatchScriptFactoryForAutoFix.Factory.class);
309 152 : factory(ProjectState.Factory.class);
310 152 : factory(RevisionJson.Factory.class);
311 152 : factory(InboundEmailRejectionSender.Factory.class);
312 152 : factory(ExternalUser.Factory.class);
313 152 : bind(PermissionCollection.Factory.class);
314 152 : bind(AccountVisibility.class).toProvider(AccountVisibilityProvider.class).in(SINGLETON);
315 152 : AccountDefaultDisplayName accountDefaultDisplayName =
316 152 : cfg.getEnum("accounts", null, "defaultDisplayName", AccountDefaultDisplayName.FULL_NAME);
317 152 : bind(AccountDefaultDisplayName.class).toInstance(accountDefaultDisplayName);
318 152 : factory(ProjectOwnerGroupsProvider.Factory.class);
319 152 : factory(SubmitRuleEvaluator.Factory.class);
320 152 : factory(DeleteZombieCommentsRefs.Factory.class);
321 :
322 152 : bind(AuthBackend.class).to(UniversalAuthBackend.class).in(SINGLETON);
323 152 : DynamicSet.setOf(binder(), AuthBackend.class);
324 :
325 152 : bind(GroupControl.Factory.class).in(SINGLETON);
326 152 : bind(GroupControl.GenericFactory.class).in(SINGLETON);
327 :
328 152 : bind(FileTypeRegistry.class).to(MimeUtilFileTypeRegistry.class);
329 152 : bind(ToolsCatalog.class);
330 152 : bind(EventFactory.class);
331 152 : bind(TransferConfig.class);
332 :
333 152 : bind(GcConfig.class);
334 152 : DynamicSet.setOf(binder(), GerritConfigListener.class);
335 :
336 152 : bind(ChangeCleanupConfig.class);
337 152 : bind(AccountDeactivator.class);
338 :
339 152 : bind(ApprovalsUtil.class);
340 :
341 152 : bind(FromAddressGenerator.class).toProvider(FromAddressGeneratorProvider.class).in(SINGLETON);
342 152 : bind(Boolean.class)
343 152 : .annotatedWith(EnablePeerIPInReflogRecord.class)
344 152 : .toProvider(EnablePeerIPInReflogRecordProvider.class)
345 152 : .in(SINGLETON);
346 :
347 152 : bind(PatchSetInfoFactory.class);
348 152 : bind(IdentifiedUser.GenericFactory.class).in(SINGLETON);
349 152 : bind(AccountControl.Factory.class);
350 152 : OptionalBinder.newOptionalBinder(binder(), Ticker.class)
351 152 : .setDefault()
352 152 : .toInstance(Ticker.systemTicker());
353 :
354 152 : bind(UiActions.class);
355 :
356 152 : bind(GitReferenceUpdated.class);
357 152 : DynamicMap.mapOf(binder(), new TypeLiteral<Cache<?, ?>>() {});
358 152 : DynamicSet.setOf(binder(), CacheRemovalListener.class);
359 152 : DynamicMap.mapOf(binder(), CapabilityDefinition.class);
360 152 : DynamicMap.mapOf(binder(), PluginProjectPermissionDefinition.class);
361 152 : DynamicSet.setOf(binder(), GitReferenceUpdatedListener.class);
362 152 : DynamicSet.setOf(binder(), GitBatchRefUpdateListener.class);
363 152 : DynamicSet.setOf(binder(), AssigneeChangedListener.class);
364 152 : DynamicSet.setOf(binder(), ChangeAbandonedListener.class);
365 152 : DynamicSet.setOf(binder(), ChangeDeletedListener.class);
366 152 : DynamicSet.setOf(binder(), CommentAddedListener.class);
367 152 : DynamicSet.setOf(binder(), HashtagsEditedListener.class);
368 152 : DynamicSet.setOf(binder(), ChangeMergedListener.class);
369 152 : bind(ChangeMergedListener.class)
370 152 : .annotatedWith(Exports.named("CreateGroupPermissionSyncer"))
371 152 : .to(CreateGroupPermissionSyncer.class);
372 :
373 152 : DynamicSet.setOf(binder(), ChangeRestoredListener.class);
374 152 : DynamicSet.setOf(binder(), ChangeRevertedListener.class);
375 152 : DynamicSet.setOf(binder(), PrivateStateChangedListener.class);
376 152 : DynamicSet.setOf(binder(), ReviewerAddedListener.class);
377 152 : DynamicSet.setOf(binder(), ReviewerDeletedListener.class);
378 152 : DynamicSet.setOf(binder(), VoteDeletedListener.class);
379 152 : DynamicSet.setOf(binder(), WorkInProgressStateChangedListener.class);
380 152 : DynamicSet.setOf(binder(), RevisionCreatedListener.class);
381 152 : DynamicSet.setOf(binder(), TopicEditedListener.class);
382 152 : DynamicSet.setOf(binder(), AgreementSignupListener.class);
383 152 : DynamicSet.setOf(binder(), PluginEventListener.class);
384 152 : DynamicSet.setOf(binder(), ReceivePackInitializer.class);
385 152 : DynamicSet.setOf(binder(), PostReceiveHook.class);
386 152 : DynamicSet.setOf(binder(), PreUploadHook.class);
387 152 : DynamicSet.setOf(binder(), PostUploadHook.class);
388 152 : DynamicSet.setOf(binder(), AccountActivationListener.class);
389 152 : DynamicSet.setOf(binder(), AccountIndexedListener.class);
390 152 : DynamicSet.setOf(binder(), ChangeIndexedListener.class);
391 152 : DynamicSet.setOf(binder(), GroupIndexedListener.class);
392 152 : DynamicSet.setOf(binder(), ProjectIndexedListener.class);
393 152 : DynamicSet.setOf(binder(), NewProjectCreatedListener.class);
394 152 : DynamicSet.setOf(binder(), ProjectDeletedListener.class);
395 152 : DynamicSet.setOf(binder(), GarbageCollectorListener.class);
396 152 : DynamicSet.setOf(binder(), HeadUpdatedListener.class);
397 152 : DynamicSet.setOf(binder(), UsageDataPublishedListener.class);
398 152 : DynamicSet.bind(binder(), GitBatchRefUpdateListener.class).to(ReindexAfterRefUpdate.class);
399 152 : DynamicSet.bind(binder(), GitReferenceUpdatedListener.class)
400 152 : .to(ProjectConfigEntry.UpdateChecker.class);
401 152 : DynamicSet.setOf(binder(), EventListener.class);
402 152 : DynamicSet.bind(binder(), EventListener.class).to(EventsMetrics.class);
403 152 : DynamicSet.setOf(binder(), UserScopedEventListener.class);
404 152 : DynamicSet.setOf(binder(), CommitValidationListener.class);
405 152 : DynamicSet.bind(binder(), CommitValidationListener.class)
406 152 : .to(SubmitRequirementConfigValidator.class);
407 152 : DynamicSet.setOf(binder(), CommentValidator.class);
408 152 : DynamicSet.setOf(binder(), ChangeMessageModifier.class);
409 152 : DynamicSet.setOf(binder(), RefOperationValidationListener.class);
410 152 : DynamicSet.setOf(binder(), OnSubmitValidationListener.class);
411 152 : DynamicSet.setOf(binder(), MergeValidationListener.class);
412 152 : DynamicSet.setOf(binder(), ProjectCreationValidationListener.class);
413 152 : DynamicSet.setOf(binder(), GroupCreationValidationListener.class);
414 152 : DynamicSet.setOf(binder(), HashtagValidationListener.class);
415 152 : DynamicSet.setOf(binder(), OutgoingEmailValidationListener.class);
416 152 : DynamicSet.setOf(binder(), AccountActivationValidationListener.class);
417 152 : DynamicItem.itemOf(binder(), AvatarProvider.class);
418 152 : DynamicSet.setOf(binder(), LifecycleListener.class);
419 152 : DynamicSet.setOf(binder(), TopMenu.class);
420 152 : DynamicMap.mapOf(binder(), DownloadScheme.class);
421 152 : DynamicMap.mapOf(binder(), DownloadCommand.class);
422 152 : DynamicMap.mapOf(binder(), CloneCommand.class);
423 152 : DynamicMap.mapOf(binder(), ReviewerSuggestion.class);
424 152 : DynamicSet.bind(binder(), GerritConfigListener.class)
425 152 : .toInstance(SuggestReviewers.configListener());
426 152 : DynamicSet.setOf(binder(), ExternalIncludedIn.class);
427 152 : DynamicMap.mapOf(binder(), ProjectConfigEntry.class);
428 152 : DynamicSet.setOf(binder(), PluginPushOption.class);
429 152 : DynamicSet.setOf(binder(), PatchSetWebLink.class);
430 152 : DynamicSet.setOf(binder(), ResolveConflictsWebLink.class);
431 152 : DynamicSet.setOf(binder(), ParentWebLink.class);
432 152 : DynamicSet.setOf(binder(), FileWebLink.class);
433 152 : DynamicSet.setOf(binder(), FileHistoryWebLink.class);
434 152 : DynamicSet.setOf(binder(), DiffWebLink.class);
435 152 : DynamicSet.setOf(binder(), EditWebLink.class);
436 152 : DynamicSet.setOf(binder(), ProjectWebLink.class);
437 152 : DynamicSet.setOf(binder(), BranchWebLink.class);
438 152 : DynamicSet.setOf(binder(), TagWebLink.class);
439 152 : DynamicMap.mapOf(binder(), OAuthLoginProvider.class);
440 152 : DynamicItem.itemOf(binder(), OAuthTokenEncrypter.class);
441 152 : DynamicSet.setOf(binder(), AccountExternalIdCreator.class);
442 152 : DynamicSet.setOf(binder(), WebUiPlugin.class);
443 152 : DynamicItem.itemOf(binder(), AccountPatchReviewStore.class);
444 152 : DynamicSet.setOf(binder(), AssigneeValidationListener.class);
445 152 : DynamicSet.setOf(binder(), ActionVisitor.class);
446 152 : DynamicItem.itemOf(binder(), MergeSuperSetComputation.class);
447 152 : DynamicItem.itemOf(binder(), ProjectNameLockManager.class);
448 152 : DynamicSet.setOf(binder(), SubmitRule.class);
449 152 : DynamicSet.setOf(binder(), SubmitRequirement.class);
450 152 : DynamicSet.setOf(binder(), QuotaEnforcer.class);
451 152 : DynamicSet.setOf(binder(), PerformanceLogger.class);
452 152 : if (cfg.getBoolean("tracing", "exportPerformanceMetrics", false)) {
453 0 : DynamicSet.bind(binder(), PerformanceLogger.class).to(PerformanceMetrics.class);
454 : }
455 152 : DynamicSet.setOf(binder(), RequestListener.class);
456 152 : DynamicSet.bind(binder(), RequestListener.class).to(TraceRequestListener.class);
457 152 : DynamicSet.setOf(binder(), ChangeETagComputation.class);
458 152 : DynamicSet.setOf(binder(), ExceptionHook.class);
459 152 : DynamicSet.bind(binder(), ExceptionHook.class).to(ExceptionHookImpl.class);
460 152 : DynamicSet.setOf(binder(), MailSoyTemplateProvider.class);
461 152 : DynamicSet.setOf(binder(), OnPostReview.class);
462 152 : DynamicMap.mapOf(binder(), AccountTagProvider.class);
463 152 : DynamicSet.setOf(binder(), AttentionSetListener.class);
464 :
465 152 : DynamicMap.mapOf(binder(), MailFilter.class);
466 152 : bind(MailFilter.class).annotatedWith(Exports.named("ListMailFilter")).to(ListMailFilter.class);
467 152 : bind(AutoReplyMailFilter.class)
468 152 : .annotatedWith(Exports.named("AutoReplyMailFilter"))
469 152 : .to(AutoReplyMailFilter.class);
470 :
471 152 : factory(UploadValidators.Factory.class);
472 152 : DynamicSet.setOf(binder(), UploadValidationListener.class);
473 :
474 152 : bind(CommentValidator.class)
475 152 : .annotatedWith(Exports.named(CommentCountValidator.class.getSimpleName()))
476 152 : .to(CommentCountValidator.class);
477 152 : bind(CommentValidator.class)
478 152 : .annotatedWith(Exports.named(CommentSizeValidator.class.getSimpleName()))
479 152 : .to(CommentSizeValidator.class);
480 152 : bind(CommentValidator.class)
481 152 : .annotatedWith(Exports.named(CommentCumulativeSizeValidator.class.getSimpleName()))
482 152 : .to(CommentCumulativeSizeValidator.class);
483 :
484 152 : DynamicMap.mapOf(binder(), DynamicOptions.DynamicBean.class);
485 152 : DynamicMap.mapOf(binder(), ChangeQueryBuilder.ChangeOperatorFactory.class);
486 152 : DynamicMap.mapOf(binder(), ChangeQueryBuilder.ChangeHasOperandFactory.class);
487 152 : DynamicMap.mapOf(binder(), ChangeQueryBuilder.ChangeIsOperandFactory.class);
488 152 : DynamicSet.setOf(binder(), ChangePluginDefinedInfoFactory.class);
489 :
490 152 : install(new GitwebConfig.LegacyModule(cfg));
491 :
492 152 : bind(AnonymousUser.class);
493 :
494 152 : factory(AbandonOp.Factory.class);
495 152 : factory(AccountMergeValidator.Factory.class);
496 152 : factory(GroupMergeValidator.Factory.class);
497 152 : factory(RefOperationValidators.Factory.class);
498 152 : factory(OnSubmitValidators.Factory.class);
499 152 : factory(MergeValidators.Factory.class);
500 152 : factory(ProjectConfigValidator.Factory.class);
501 152 : factory(NotesBranchUtil.Factory.class);
502 152 : factory(MergedByPushOp.Factory.class);
503 152 : factory(GitModules.Factory.class);
504 152 : factory(VersionedAuthorizedKeys.Factory.class);
505 152 : factory(StoreSubmitRequirementsOp.Factory.class);
506 152 : factory(FileEditsPredicate.Factory.class);
507 :
508 152 : bind(AccountManager.class);
509 152 : bind(SubscriptionGraph.Factory.class).to(ConfiguredSubscriptionGraphFactory.class);
510 :
511 152 : bind(new TypeLiteral<List<CommentLinkInfo>>() {}).toProvider(CommentLinkProvider.class);
512 152 : DynamicSet.bind(binder(), GerritConfigListener.class).to(CommentLinkProvider.class);
513 :
514 152 : bind(ReloadPluginListener.class)
515 152 : .annotatedWith(UniqueAnnotations.create())
516 152 : .to(PluginConfigFactory.class);
517 152 : DynamicMap.mapOf(binder(), ExternalIdUpsertPreprocessor.class);
518 :
519 152 : bind(AttentionSetObserver.class);
520 152 : }
521 : }
|