]> source.dussan.org Git - gitblit.git/commitdiff
Allows starting an already instantiated manager
authorLuca Milanesio <luca.milanesio@gmail.com>
Sat, 29 Nov 2014 16:18:19 +0000 (16:18 +0000)
committerLuca Milanesio <luca.milanesio@gmail.com>
Sat, 29 Nov 2014 16:19:20 +0000 (16:19 +0000)
When a manager is injected through other means, (e.g. using a different
GuiceModule and injector in Gerrit) we need a way to start it without
having to necessarily passing through the injection process again.

src/main/java/com/gitblit/servlet/GitblitContext.java

index fa0534db5d0f71b1c1c71e9db2a065714fa1fd3d..85b472051a922c8110d1dcba9e3654edf7ee448a 100644 (file)
@@ -266,6 +266,12 @@ public class GitblitContext extends GuiceServletContextListener {
                return x;
        }
 
+       protected <X extends IManager> X startManager(X x) {
+           x.start();
+           managers.add(x);
+           return x;
+       }
+
        protected void logManager(Class<? extends IManager> clazz) {
                logger.info("");
                logger.info("----[{}]----", clazz.getName());