Line data Source code
1 : // Copyright (C) 2012 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.plugins; 16 : 17 : import com.google.gerrit.extensions.registration.DynamicSet; 18 : import com.google.gerrit.extensions.systemstatus.ServerInformation; 19 : import com.google.gerrit.lifecycle.LifecycleModule; 20 : import com.google.gerrit.server.PluginUser; 21 : import com.google.gerrit.server.config.GerritRuntime; 22 : 23 138 : public class PluginModule extends LifecycleModule { 24 : @Override 25 : protected void configure() { 26 138 : requireBinding(GerritRuntime.class); 27 : 28 138 : factory(PluginUser.Factory.class); 29 138 : bind(ServerInformationImpl.class); 30 138 : bind(ServerInformation.class).to(ServerInformationImpl.class); 31 : 32 138 : bind(PluginCleanerTask.class); 33 138 : bind(PluginGuiceEnvironment.class); 34 138 : bind(PluginLoader.class); 35 138 : bind(CopyConfigModule.class); 36 138 : listener().to(PluginLoader.class); 37 138 : bind(MandatoryPluginsCollection.class); 38 : 39 138 : DynamicSet.setOf(binder(), ServerPluginProvider.class); 40 138 : DynamicSet.bind(binder(), ServerPluginProvider.class).to(JarPluginProvider.class); 41 138 : bind(UniversalServerPluginProvider.class); 42 138 : } 43 : }