Style: changed manager order to reflect dependency chain
Managers are mostly declared in dependency order. Managers with fewer dependencies are first. They are likely to be components of other managers. Also eliminated import artifacts from the cherry-pick.
| | |
| | | |
| | | import com.gitblit.manager.AuthenticationManager; |
| | | import com.gitblit.manager.FederationManager; |
| | | import com.gitblit.manager.PluginManager; |
| | | import com.gitblit.manager.IAuthenticationManager; |
| | | import com.gitblit.manager.IFederationManager; |
| | | import com.gitblit.manager.IGitblit; |
| | | import com.gitblit.manager.IPluginManager; |
| | | import com.gitblit.manager.INotificationManager; |
| | | import com.gitblit.manager.IPluginManager; |
| | | import com.gitblit.manager.IProjectManager; |
| | | import com.gitblit.manager.IRepositoryManager; |
| | | import com.gitblit.manager.IRuntimeManager; |
| | | import com.gitblit.manager.IUserManager; |
| | | import com.gitblit.manager.NotificationManager; |
| | | import com.gitblit.manager.PluginManager; |
| | | import com.gitblit.manager.ProjectManager; |
| | | import com.gitblit.manager.RepositoryManager; |
| | | import com.gitblit.manager.RuntimeManager; |
| | |
| | | |
| | | // core managers |
| | | IRuntimeManager.class, |
| | | IPluginManager.class, |
| | | INotificationManager.class, |
| | | IUserManager.class, |
| | | IAuthenticationManager.class, |
| | |
| | | IRepositoryManager.class, |
| | | IProjectManager.class, |
| | | IFederationManager.class, |
| | | IPluginManager.class, |
| | | |
| | | // the monolithic manager |
| | | IGitblit.class, |
| | |
| | | return new RuntimeManager(settings); |
| | | } |
| | | |
| | | @Provides @Singleton IPluginManager providePluginManager(IRuntimeManager runtimeManager) { |
| | | return new PluginManager(runtimeManager); |
| | | } |
| | | |
| | | @Provides @Singleton INotificationManager provideNotificationManager(IStoredSettings settings) { |
| | | return new NotificationManager(settings); |
| | | } |
| | | |
| | | @Provides @Singleton IUserManager provideUserManager(IRuntimeManager runtimeManager) { |
| | | return new UserManager(runtimeManager); |
| | | } |
| | | |
| | | @Provides @Singleton IPluginManager providePluginManager(IRuntimeManager runtimeManager) { |
| | | return new PluginManager(runtimeManager); |
| | | } |
| | | |
| | | @Provides @Singleton IAuthenticationManager provideAuthenticationManager( |
| | |
| | | |
| | | @Provides @Singleton IGitblit provideGitblit( |
| | | IRuntimeManager runtimeManager, |
| | | IPluginManager pluginManager, |
| | | INotificationManager notificationManager, |
| | | IUserManager userManager, |
| | | IAuthenticationManager authenticationManager, |
| | | IPublicKeyManager publicKeyManager, |
| | | IRepositoryManager repositoryManager, |
| | | IProjectManager projectManager, |
| | | IFederationManager federationManager, |
| | | IPluginManager pluginManager) { |
| | | IFederationManager federationManager) { |
| | | |
| | | return new GitBlit( |
| | | runtimeManager, |
| | | pluginManager, |
| | | notificationManager, |
| | | userManager, |
| | | authenticationManager, |
| | | publicKeyManager, |
| | | repositoryManager, |
| | | projectManager, |
| | | federationManager, |
| | | pluginManager); |
| | | federationManager); |
| | | } |
| | | |
| | | @Provides @Singleton GitBlitWebApp provideWebApplication( |
| | |
| | | UserManager users = new UserManager(runtime).start();
|
| | | RepositoryManager repositories = new RepositoryManager(runtime, users).start();
|
| | | FederationManager federation = new FederationManager(runtime, notifications, repositories).start();
|
| | | IGitblit gitblit = new GitblitManager(runtime, notifications, users, null, null, repositories, null, federation, null);
|
| | | IGitblit gitblit = new GitblitManager(runtime, null, notifications, users, null, null, repositories, null, federation);
|
| | |
|
| | | FederationPullService puller = new FederationPullService(gitblit, federation.getFederationRegistrations()) {
|
| | | @Override
|
| | |
| | | |
| | | public GitBlit( |
| | | IRuntimeManager runtimeManager, |
| | | IPluginManager pluginManager, |
| | | INotificationManager notificationManager, |
| | | IUserManager userManager, |
| | | IAuthenticationManager authenticationManager, |
| | | IPublicKeyManager publicKeyManager, |
| | | IRepositoryManager repositoryManager, |
| | | IProjectManager projectManager, |
| | | IFederationManager federationManager, |
| | | IPluginManager pluginManager) { |
| | | IFederationManager federationManager) { |
| | | |
| | | super(runtimeManager, |
| | | pluginManager, |
| | | notificationManager, |
| | | userManager, |
| | | authenticationManager, |
| | | publicKeyManager, |
| | | repositoryManager, |
| | | projectManager, |
| | | federationManager, |
| | | pluginManager); |
| | | federationManager); |
| | | |
| | | this.injector = ObjectGraph.create(getModules()); |
| | | |
| | |
| | | inject(objectGraph);
|
| | | }
|
| | |
|
| | | protected abstract void inject(ObjectGraph dagger) throws ServletException;
|
| | | protected abstract void inject(ObjectGraph dagger);
|
| | |
|
| | | @Override
|
| | | public void destroy() {
|
| | |
| | | |
| | | protected final IRuntimeManager runtimeManager; |
| | | |
| | | protected final IPluginManager pluginManager; |
| | | |
| | | protected final INotificationManager notificationManager; |
| | | |
| | | protected final IUserManager userManager; |
| | |
| | | |
| | | protected final IFederationManager federationManager; |
| | | |
| | | protected final IPluginManager pluginManager; |
| | | |
| | | public GitblitManager( |
| | | IRuntimeManager runtimeManager, |
| | | IPluginManager pluginManager, |
| | | INotificationManager notificationManager, |
| | | IUserManager userManager, |
| | | IAuthenticationManager authenticationManager, |
| | | IPublicKeyManager publicKeyManager, |
| | | IRepositoryManager repositoryManager, |
| | | IProjectManager projectManager, |
| | | IFederationManager federationManager, |
| | | IPluginManager pluginManager) { |
| | | IFederationManager federationManager) { |
| | | |
| | | this.settings = runtimeManager.getSettings(); |
| | | this.runtimeManager = runtimeManager; |
| | | this.pluginManager = pluginManager; |
| | | this.notificationManager = notificationManager; |
| | | this.userManager = userManager; |
| | | this.authenticationManager = authenticationManager; |
| | |
| | | this.repositoryManager = repositoryManager; |
| | | this.projectManager = projectManager; |
| | | this.federationManager = federationManager; |
| | | this.pluginManager = pluginManager; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | public interface IGitblit extends IManager, |
| | | IRuntimeManager, |
| | | IPluginManager, |
| | | INotificationManager, |
| | | IUserManager, |
| | | IAuthenticationManager, |
| | | IRepositoryManager, |
| | | IProjectManager, |
| | | IFederationManager, |
| | | IPluginManager { |
| | | IFederationManager { |
| | | |
| | | /** |
| | | * Returns a list of repository URLs and the user access permission. |
| | |
| | | import com.gitblit.manager.IAuthenticationManager; |
| | | import com.gitblit.manager.IFederationManager; |
| | | import com.gitblit.manager.IGitblit; |
| | | import com.gitblit.manager.IPluginManager; |
| | | import com.gitblit.manager.IManager; |
| | | import com.gitblit.manager.INotificationManager; |
| | | import com.gitblit.manager.IPluginManager; |
| | | import com.gitblit.manager.IProjectManager; |
| | | import com.gitblit.manager.IRepositoryManager; |
| | | import com.gitblit.manager.IRuntimeManager; |
| | |
| | | managers.add(runtime); |
| | | |
| | | // start all other managers |
| | | startManager(injector, IPluginManager.class); |
| | | startManager(injector, INotificationManager.class); |
| | | startManager(injector, IUserManager.class); |
| | | startManager(injector, IAuthenticationManager.class); |
| | |
| | | startManager(injector, IProjectManager.class); |
| | | startManager(injector, IFederationManager.class); |
| | | startManager(injector, IGitblit.class); |
| | | startManager(injector, IPluginManager.class); |
| | | |
| | | logger.info(""); |
| | | logger.info("All managers started."); |
| | |
| | | import java.text.MessageFormat;
|
| | |
|
| | | import javax.servlet.FilterChain;
|
| | | import javax.servlet.FilterConfig;
|
| | | import javax.servlet.ServletException;
|
| | | import javax.servlet.ServletRequest;
|
| | | import javax.servlet.ServletResponse;
|