mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goldstein Lyor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SSHD-394) Use an ExecutorService to spawn SftpSubsystem command
Date Wed, 14 Jan 2015 05:34:34 GMT

    [ https://issues.apache.org/jira/browse/SSHD-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14276509#comment-14276509
] 

Goldstein Lyor commented on SSHD-394:
-------------------------------------

Agreed - would you like me to make the necessary changes and re-submit a patch ? (also for
SSHD-395) ?

> 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)

Mime
View raw message