Paul Martin
2016-04-27 c2188a840bc4153ae92112b04b2e06a90d3944aa
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