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);
}
return new UserManager(runtimeManager);
}
- @Provides @Singleton IPluginManager providePluginManager(IRuntimeManager runtimeManager) {
- return new PluginManager(runtimeManager);
- }
-
@Provides @Singleton IAuthenticationManager provideAuthenticationManager(
IRuntimeManager runtimeManager,
IUserManager userManager) {
@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();\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
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);\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
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;\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