]> source.dussan.org Git - gitblit.git/commitdiff
Style: changed manager order to reflect dependency chain
authorJames Moger <james.moger@gitblit.com>
Tue, 18 Mar 2014 21:21:47 +0000 (17:21 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 10 Apr 2014 22:58:09 +0000 (18:58 -0400)
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.

src/main/java/com/gitblit/DaggerModule.java
src/main/java/com/gitblit/FederationClient.java
src/main/java/com/gitblit/GitBlit.java
src/main/java/com/gitblit/dagger/DaggerFilter.java
src/main/java/com/gitblit/manager/GitblitManager.java
src/main/java/com/gitblit/manager/IGitblit.java
src/main/java/com/gitblit/servlet/GitblitContext.java
src/main/java/com/gitblit/servlet/SyndicationFilter.java

index 1805c4ec7160a048bc5e355ea11258bc7682124c..e448867a85594c8c90734a962ea905350903a4c2 100644 (file)
@@ -19,17 +19,17 @@ import javax.inject.Singleton;
 
 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;
@@ -57,6 +57,7 @@ import dagger.Provides;
 
                        // core managers
                        IRuntimeManager.class,
+                       IPluginManager.class,
                        INotificationManager.class,
                        IUserManager.class,
                        IAuthenticationManager.class,
@@ -64,7 +65,6 @@ import dagger.Provides;
                        IRepositoryManager.class,
                        IProjectManager.class,
                        IFederationManager.class,
-                       IPluginManager.class,
 
                        // the monolithic manager
                        IGitblit.class,
@@ -83,6 +83,10 @@ public class DaggerModule {
                return new RuntimeManager(settings);
        }
 
+       @Provides @Singleton IPluginManager providePluginManager(IRuntimeManager runtimeManager) {
+               return new PluginManager(runtimeManager);
+       }
+
        @Provides @Singleton INotificationManager provideNotificationManager(IStoredSettings settings) {
                return new NotificationManager(settings);
        }
@@ -91,10 +95,6 @@ public class DaggerModule {
                return new UserManager(runtimeManager);
        }
 
-       @Provides @Singleton IPluginManager providePluginManager(IRuntimeManager runtimeManager) {
-               return new PluginManager(runtimeManager);
-       }
-
        @Provides @Singleton IAuthenticationManager provideAuthenticationManager(
                        IRuntimeManager runtimeManager,
                        IUserManager userManager) {
@@ -162,25 +162,25 @@ public class DaggerModule {
 
        @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(
index 67a6865439cc7dd7da07757e6d3e7592d1bd597b..c3dcd9daf619998367df7ef397d01bc5b30cf808 100644 (file)
@@ -97,7 +97,7 @@ public class FederationClient {
                UserManager users = new UserManager(runtime).start();\r
                RepositoryManager repositories = new RepositoryManager(runtime, users).start();\r
                FederationManager federation = new FederationManager(runtime, notifications, repositories).start();\r
-               IGitblit gitblit = new GitblitManager(runtime, notifications, users, null, null, repositories, null, federation, null);\r
+               IGitblit gitblit = new GitblitManager(runtime, null, notifications, users, null, null, repositories, null, federation);\r
 \r
                FederationPullService puller = new FederationPullService(gitblit, federation.getFederationRegistrations()) {\r
                        @Override\r
index 147b2e1668ef347c420be2f693431cc25c1221ff..fa681ac1f9d03d2913e31cbdbd5e17e992fd466c 100644 (file)
@@ -66,24 +66,24 @@ public class GitBlit extends GitblitManager {
 
        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());
 
index 68fe6058b72a17a7ba5a2efd70574163c1846094..1c73d4b759a8774403b42f4886ca747980af9b7f 100644 (file)
@@ -39,7 +39,7 @@ public abstract class DaggerFilter implements Filter {
                inject(objectGraph);\r
        }\r
 \r
-       protected abstract void inject(ObjectGraph dagger) throws ServletException;\r
+       protected abstract void inject(ObjectGraph dagger);\r
 \r
        @Override\r
        public void destroy() {\r
index 34c101e2f22b44743306669d8c3b416da7fc60d7..cc670ea68c3ff125e0a935706c173f6d1f13923d 100644 (file)
@@ -104,6 +104,8 @@ public class GitblitManager implements IGitblit {
 
        protected final IRuntimeManager runtimeManager;
 
+       protected final IPluginManager pluginManager;
+
        protected final INotificationManager notificationManager;
 
        protected final IUserManager userManager;
@@ -118,21 +120,20 @@ public class GitblitManager implements IGitblit {
 
        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;
@@ -140,7 +141,6 @@ public class GitblitManager implements IGitblit {
                this.repositoryManager = repositoryManager;
                this.projectManager = projectManager;
                this.federationManager = federationManager;
-               this.pluginManager = pluginManager;
        }
 
        @Override
index 7961a06b7b8831e419f0c28ab0743f665c42e0bc..f3202c01367541442d16243a2f55776d82028aaf 100644 (file)
@@ -31,13 +31,13 @@ import com.gitblit.transport.ssh.IPublicKeyManager;
 
 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.
index a98fe192b8fafc57f063d05ec864c79d68c61495..553651da21f7967f0260f7f9e9623214b06aa5f0 100644 (file)
@@ -41,9 +41,9 @@ import com.gitblit.dagger.DaggerContext;
 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;
@@ -177,6 +177,7 @@ public class GitblitContext extends DaggerContext {
                managers.add(runtime);
 
                // start all other managers
+               startManager(injector, IPluginManager.class);
                startManager(injector, INotificationManager.class);
                startManager(injector, IUserManager.class);
                startManager(injector, IAuthenticationManager.class);
@@ -185,7 +186,6 @@ public class GitblitContext extends DaggerContext {
                startManager(injector, IProjectManager.class);
                startManager(injector, IFederationManager.class);
                startManager(injector, IGitblit.class);
-               startManager(injector, IPluginManager.class);
 
                logger.info("");
                logger.info("All managers started.");
index b399588b2010ac70d4b95496bd333b93bee7ab0f..67a845eaf1d883758b34faae9130e3e971b73c61 100644 (file)
@@ -19,7 +19,6 @@ import java.io.IOException;
 import java.text.MessageFormat;\r
 \r
 import javax.servlet.FilterChain;\r
-import javax.servlet.FilterConfig;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.ServletRequest;\r
 import javax.servlet.ServletResponse;\r