From 51740339142c4b00a59cea29babd6af69e7bf067 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 10 Jun 2014 11:51:43 -0400
Subject: [PATCH] Merge pull request #189 from yin8086/release-v1.6.0-Chinese
---
src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java b/src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java
index 55090fc..fa4b916 100644
--- a/src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java
+++ b/src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2009 The Android Open Source Project
* Copyright 2014 gitblit.com.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -39,28 +40,23 @@
import com.gitblit.Keys;
import com.gitblit.manager.IGitblit;
import com.gitblit.transport.ssh.SshDaemonClient;
-import com.gitblit.utils.IdGenerator;
import com.gitblit.utils.WorkQueue;
import com.google.common.util.concurrent.Atomics;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
-/**
- *
- * @author Eric Myhre
- *
- */
public class SshCommandFactory implements CommandFactory {
private static final Logger logger = LoggerFactory.getLogger(SshCommandFactory.class);
+ private final WorkQueue workQueue;
private final IGitblit gitblit;
private final ScheduledExecutorService startExecutor;
private final ExecutorService destroyExecutor;
- public SshCommandFactory(IGitblit gitblit, IdGenerator idGenerator) {
+ public SshCommandFactory(IGitblit gitblit, WorkQueue workQueue) {
this.gitblit = gitblit;
+ this.workQueue = workQueue;
int threads = gitblit.getSettings().getInteger(Keys.git.sshCommandStartThreads, 2);
- WorkQueue workQueue = new WorkQueue(idGenerator);
startExecutor = workQueue.createQueue(threads, "SshCommandStart");
destroyExecutor = Executors.newSingleThreadExecutor(
new ThreadFactoryBuilder()
@@ -74,7 +70,7 @@
}
public RootDispatcher createRootDispatcher(SshDaemonClient client, String commandLine) {
- return new RootDispatcher(gitblit, client, commandLine);
+ return new RootDispatcher(gitblit, client, commandLine, workQueue);
}
@Override
--
Gitblit v1.9.1