| | |
| | | import com.gitblit.utils.IdGenerator; |
| | | import com.gitblit.utils.StringUtils; |
| | | import com.gitblit.utils.TimeUtils; |
| | | import com.gitblit.utils.WorkQueue; |
| | | |
| | | /** |
| | | * Services manager manages long-running services/processes that either have no |
| | |
| | | |
| | | private final IGitblit gitblit; |
| | | |
| | | private final IdGenerator idGenerator; |
| | | |
| | | private final WorkQueue workQueue; |
| | | |
| | | private FanoutService fanoutService; |
| | | |
| | | private GitDaemon gitDaemon; |
| | |
| | | public ServicesManager(IGitblit gitblit) { |
| | | this.settings = gitblit.getSettings(); |
| | | this.gitblit = gitblit; |
| | | this.idGenerator = new IdGenerator(); |
| | | this.workQueue = new WorkQueue(idGenerator, 1); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (sshDaemon != null) { |
| | | sshDaemon.stop(); |
| | | } |
| | | workQueue.stop(); |
| | | return this; |
| | | } |
| | | |
| | |
| | | String bindInterface = settings.getString(Keys.git.sshBindInterface, "localhost"); |
| | | if (port > 0) { |
| | | try { |
| | | sshDaemon = new SshDaemon(gitblit, new IdGenerator()); |
| | | sshDaemon = new SshDaemon(gitblit, workQueue); |
| | | sshDaemon.start(); |
| | | } catch (IOException e) { |
| | | sshDaemon = null; |