Merge "Bind the REST API in an own module"

This commit is contained in:
Edwin Kempin 2018-05-15 08:07:23 +00:00 committed by Gerrit Code Review
commit 85b476e05a
2 changed files with 31 additions and 6 deletions
java/com/google/gerrit/server

@ -169,6 +169,7 @@ import com.google.gerrit.server.query.change.ChangeData;
import com.google.gerrit.server.query.change.ChangeQueryBuilder;
import com.google.gerrit.server.query.change.ChangeQueryProcessor;
import com.google.gerrit.server.query.change.ConflictsCacheImpl;
import com.google.gerrit.server.restapi.RestApiModule;
import com.google.gerrit.server.restapi.change.SuggestReviewers;
import com.google.gerrit.server.restapi.group.GroupModule;
import com.google.gerrit.server.rules.DefaultSubmitRule;
@ -305,12 +306,7 @@ public class GerritGlobalModule extends FactoryModule {
install(new AuditModule());
bind(UiActions.class);
install(new com.google.gerrit.server.restapi.access.Module());
install(new com.google.gerrit.server.restapi.config.Module());
install(new com.google.gerrit.server.restapi.change.Module());
install(new com.google.gerrit.server.restapi.account.Module());
install(new com.google.gerrit.server.restapi.project.Module());
install(new com.google.gerrit.server.restapi.group.Module());
install(new RestApiModule());
bind(GitReferenceUpdated.class);
DynamicMap.mapOf(binder(), new TypeLiteral<Cache<?, ?>>() {});

@ -0,0 +1,29 @@
// Copyright (C) 2018 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.restapi;
import com.google.inject.AbstractModule;
public class RestApiModule extends AbstractModule {
@Override
protected void configure() {
install(new com.google.gerrit.server.restapi.access.Module());
install(new com.google.gerrit.server.restapi.account.Module());
install(new com.google.gerrit.server.restapi.change.Module());
install(new com.google.gerrit.server.restapi.config.Module());
install(new com.google.gerrit.server.restapi.group.Module());
install(new com.google.gerrit.server.restapi.project.Module());
}
}