| | |
| | | import javax.naming.InitialContext; |
| | | import javax.naming.NamingException; |
| | | import javax.servlet.ServletContext; |
| | | import javax.servlet.ServletContextEvent; |
| | | import javax.servlet.annotation.WebListener; |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | import com.gitblit.Constants.FederationToken; |
| | | import com.gitblit.Constants.PermissionType; |
| | | import com.gitblit.Constants.RegistrantType; |
| | | import com.gitblit.dagger.DaggerContextListener; |
| | | import com.gitblit.fanout.FanoutNioService; |
| | | import com.gitblit.fanout.FanoutService; |
| | | import com.gitblit.fanout.FanoutSocketService; |
| | |
| | | * |
| | | */ |
| | | @WebListener |
| | | public class GitBlit extends InjectionContextListener |
| | | public class GitBlit extends DaggerContextListener |
| | | implements IRuntimeManager, |
| | | INotificationManager, |
| | | IUserManager, |
| | |
| | | |
| | | // prepare service executors |
| | | mailExecutor = new MailExecutor(settings); |
| | | luceneExecutor = new LuceneExecutor(settings, repositoriesFolder); |
| | | gcExecutor = new GCExecutor(settings); |
| | | mirrorExecutor = new MirrorExecutor(settings); |
| | | luceneExecutor = new LuceneExecutor(settings, getManager(IRepositoryManager.class)); |
| | | gcExecutor = new GCExecutor(settings, getManager(IRepositoryManager.class)); |
| | | mirrorExecutor = new MirrorExecutor(settings, getManager(IRepositoryManager.class)); |
| | | |
| | | // initialize utilities |
| | | String prefix = settings.getString(Keys.git.userRepositoryPrefix, "~"); |
| | |
| | | String bindInterface = settings.getString(Keys.git.daemonBindInterface, "localhost"); |
| | | if (port > 0) { |
| | | try { |
| | | gitDaemon = new GitDaemon(bindInterface, port, getRepositoriesFolder()); |
| | | gitDaemon = new GitDaemon(this, this, this, this); |
| | | gitDaemon.start(); |
| | | } catch (IOException e) { |
| | | gitDaemon = null; |
| | |
| | | * shutting down or because the servlet container is re-deploying Gitblit. |
| | | */ |
| | | @Override |
| | | public void contextDestroyed(ServletContextEvent contextEvent) { |
| | | protected void destroyContext(ServletContext context) { |
| | | logger.info("Gitblit context destroyed by servlet container."); |
| | | scheduledExecutor.shutdownNow(); |
| | | luceneExecutor.close(); |
| | |
| | | userService.logout(user); |
| | | } |
| | | |
| | | @Override |
| | | protected Object [] getModules() { |
| | | return new Object [] { new DaggerModule(this) }; |
| | | } |
| | | |
| | | /** |
| | | * Instantiate and inject all filters and servlets into the container using |
| | | * the servlet 3 specification. |