Search in sources :

Example 1 with CacheRemovalListener

use of com.google.gerrit.server.cache.CacheRemovalListener in project gerrit by GerritCodeReview.

the class BatchProgramModule method configure.

@SuppressWarnings("rawtypes")
@Override
protected void configure() {
    install(reviewDbModule);
    install(new DiffExecutorModule());
    install(new ReceiveCommitsExecutorModule());
    install(BatchUpdate.module());
    install(PatchListCacheImpl.module());
    // Plugins are not loaded and we're just running through each change
    // once, so don't worry about cache removal.
    bind(new TypeLiteral<DynamicSet<CacheRemovalListener>>() {
    }).toInstance(DynamicSet.<CacheRemovalListener>emptySet());
    bind(new TypeLiteral<DynamicMap<Cache<?, ?>>>() {
    }).toInstance(DynamicMap.<Cache<?, ?>>emptyMap());
    bind(new TypeLiteral<List<CommentLinkInfo>>() {
    }).toProvider(CommentLinkProvider.class).in(SINGLETON);
    bind(new TypeLiteral<DynamicMap<ChangeQueryProcessor.ChangeAttributeFactory>>() {
    }).toInstance(DynamicMap.<ChangeQueryProcessor.ChangeAttributeFactory>emptyMap());
    bind(String.class).annotatedWith(CanonicalWebUrl.class).toProvider(CanonicalWebUrlProvider.class);
    bind(Boolean.class).annotatedWith(DisableReverseDnsLookup.class).toProvider(DisableReverseDnsLookupProvider.class).in(SINGLETON);
    bind(Realm.class).to(FakeRealm.class);
    bind(IdentifiedUser.class).toProvider(Providers.<IdentifiedUser>of(null));
    bind(ReplacePatchSetSender.Factory.class).toProvider(Providers.<ReplacePatchSetSender.Factory>of(null));
    bind(CurrentUser.class).to(IdentifiedUser.class);
    factory(MergeUtil.Factory.class);
    factory(PatchSetInserter.Factory.class);
    factory(RebaseChangeOp.Factory.class);
    // As Reindex is a batch program, don't assume the index is available for
    // the change cache.
    bind(SearchingChangeCacheImpl.class).toProvider(Providers.<SearchingChangeCacheImpl>of(null));
    bind(new TypeLiteral<ImmutableSet<GroupReference>>() {
    }).annotatedWith(AdministrateServerGroups.class).toInstance(ImmutableSet.<GroupReference>of());
    bind(new TypeLiteral<Set<AccountGroup.UUID>>() {
    }).annotatedWith(GitUploadPackGroups.class).toInstance(Collections.<AccountGroup.UUID>emptySet());
    bind(new TypeLiteral<Set<AccountGroup.UUID>>() {
    }).annotatedWith(GitReceivePackGroups.class).toInstance(Collections.<AccountGroup.UUID>emptySet());
    install(new BatchGitModule());
    install(new DefaultPermissionBackendModule());
    install(new DefaultCacheFactory.Module());
    install(new ExternalIdModule());
    install(new GroupModule());
    install(new NoteDbModule(cfg));
    install(new PrologModule());
    install(AccountByEmailCacheImpl.module());
    install(AccountCacheImpl.module());
    install(GroupCacheImpl.module());
    install(GroupIncludeCacheImpl.module());
    install(ProjectCacheImpl.module());
    install(SectionSortCache.module());
    install(ChangeKindCacheImpl.module());
    install(MergeabilityCacheImpl.module());
    install(TagCache.module());
    factory(CapabilityCollection.Factory.class);
    factory(CapabilityControl.Factory.class);
    factory(ChangeData.Factory.class);
    factory(ProjectState.Factory.class);
    bind(ChangeJson.Factory.class).toProvider(Providers.<ChangeJson.Factory>of(null));
    bind(AccountVisibility.class).toProvider(AccountVisibilityProvider.class).in(SINGLETON);
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) DynamicSet(com.google.gerrit.extensions.registration.DynamicSet) CurrentUser(com.google.gerrit.server.CurrentUser) CapabilityControl(com.google.gerrit.server.account.CapabilityControl) NoteDbModule(com.google.gerrit.server.notedb.NoteDbModule) DefaultCacheFactory(com.google.gerrit.server.cache.h2.DefaultCacheFactory) AdministrateServerGroups(com.google.gerrit.server.config.AdministrateServerGroups) GroupModule(com.google.gerrit.server.group.GroupModule) CacheRemovalListener(com.google.gerrit.server.cache.CacheRemovalListener) TypeLiteral(com.google.inject.TypeLiteral) ImmutableSet(com.google.common.collect.ImmutableSet) GitUploadPackGroups(com.google.gerrit.server.config.GitUploadPackGroups) MergeUtil(com.google.gerrit.server.git.MergeUtil) List(java.util.List) DefaultPermissionBackendModule(com.google.gerrit.server.project.DefaultPermissionBackendModule) FakeRealm(com.google.gerrit.server.account.FakeRealm) Realm(com.google.gerrit.server.account.Realm) CommentLinkProvider(com.google.gerrit.server.project.CommentLinkProvider) SearchingChangeCacheImpl(com.google.gerrit.server.git.SearchingChangeCacheImpl) ChangeJson(com.google.gerrit.server.change.ChangeJson) GitReceivePackGroups(com.google.gerrit.server.config.GitReceivePackGroups) DisableReverseDnsLookupProvider(com.google.gerrit.server.config.DisableReverseDnsLookupProvider) PrologModule(com.google.gerrit.rules.PrologModule) CanonicalWebUrl(com.google.gerrit.server.config.CanonicalWebUrl) ChangeQueryProcessor(com.google.gerrit.server.query.change.ChangeQueryProcessor) DefaultCacheFactory(com.google.gerrit.server.cache.h2.DefaultCacheFactory) RebaseChangeOp(com.google.gerrit.server.change.RebaseChangeOp) CapabilityCollection(com.google.gerrit.server.account.CapabilityCollection) IdentifiedUser(com.google.gerrit.server.IdentifiedUser) ChangeData(com.google.gerrit.server.query.change.ChangeData) AccountVisibilityProvider(com.google.gerrit.server.account.AccountVisibilityProvider) AccountGroup(com.google.gerrit.reviewdb.client.AccountGroup) PatchSetInserter(com.google.gerrit.server.change.PatchSetInserter) ExternalIdModule(com.google.gerrit.server.account.externalids.ExternalIdModule) DiffExecutorModule(com.google.gerrit.server.patch.DiffExecutorModule) ProjectState(com.google.gerrit.server.project.ProjectState) ReceiveCommitsExecutorModule(com.google.gerrit.server.git.ReceiveCommitsExecutorModule) ReplacePatchSetSender(com.google.gerrit.server.mail.send.ReplacePatchSetSender) TagCache(com.google.gerrit.server.git.TagCache) SectionSortCache(com.google.gerrit.server.project.SectionSortCache) Cache(com.google.common.cache.Cache)

Aggregations

Cache (com.google.common.cache.Cache)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 DynamicSet (com.google.gerrit.extensions.registration.DynamicSet)1 AccountGroup (com.google.gerrit.reviewdb.client.AccountGroup)1 PrologModule (com.google.gerrit.rules.PrologModule)1 CurrentUser (com.google.gerrit.server.CurrentUser)1 IdentifiedUser (com.google.gerrit.server.IdentifiedUser)1 AccountVisibilityProvider (com.google.gerrit.server.account.AccountVisibilityProvider)1 CapabilityCollection (com.google.gerrit.server.account.CapabilityCollection)1 CapabilityControl (com.google.gerrit.server.account.CapabilityControl)1 FakeRealm (com.google.gerrit.server.account.FakeRealm)1 Realm (com.google.gerrit.server.account.Realm)1 ExternalIdModule (com.google.gerrit.server.account.externalids.ExternalIdModule)1 CacheRemovalListener (com.google.gerrit.server.cache.CacheRemovalListener)1 DefaultCacheFactory (com.google.gerrit.server.cache.h2.DefaultCacheFactory)1 ChangeJson (com.google.gerrit.server.change.ChangeJson)1 PatchSetInserter (com.google.gerrit.server.change.PatchSetInserter)1 RebaseChangeOp (com.google.gerrit.server.change.RebaseChangeOp)1 AdministrateServerGroups (com.google.gerrit.server.config.AdministrateServerGroups)1 CanonicalWebUrl (com.google.gerrit.server.config.CanonicalWebUrl)1