[ 
https://issues.apache.org/jira/browse/SSHD-394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Goldstein Lyor updated SSHD-394:
--------------------------------
    Attachment: 
0006-update1-SSHD-394-Use-an-ExecutorService-to-spawn-SftpSubsyst.patch

Using _ThreadUtils_ instead of _Executors_

> Use an ExecutorService to spawn SftpSubsystem command
> -----------------------------------------------------
>
>                 Key: SSHD-394
>                 URL: https://issues.apache.org/jira/browse/SSHD-394
>             Project: MINA SSHD
>          Issue Type: Improvement
>    Affects Versions: 0.14.0
>            Reporter: Goldstein Lyor
>         Attachments: 
> 0006-update1-SSHD-394-Use-an-ExecutorService-to-spawn-SftpSubsyst.patch
>
>
> The current code simply uses {code:java}new Thread(this).start(){code} 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:
> # The documentation for _Executor#execute()_ clearly states: {panel}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.{panel}
> In our case we want to make sure that a *new* thread is spawned
> # The _ExecutorService#submit()_ call returns a _Future_ object which we can 
> later use to stop the command when the _destroy()_ method is called



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to