Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-394

Use an ExecutorService to spawn SftpSubsystem command

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.14.0
    • 0.14.0
    • None

    Description

      The current code simply uses

      new Thread(this).start()

      This precludes the user from configuring the thread's attributes - name, priority, stack size, thread-group and most important whether it is a daemon or not. By allowing to provide an ExecutorService we enable all these.

      Note: the choice for using an ExecutorService rather than a simple(r) Executor is twofold:

      1. The documentation for Executor#execute() clearly states:

        Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation.


        In our case we want to make sure that a new thread is spawned
      2. The ExecutorService#submit() call returns a Future object which we can later use to stop the command when the destroy() method is called

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            lgoldstein Lyor Goldstein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: