On Dec 3, 5:47 pm, Daniel Pitts
<newsgroup.spamfil...@virtualinfinity.net> wrote:
> bugbear wrote:
> > Daniel Pitts wrote:
> >> I've looked at JSch, and it seems like a working candidate, but it
> >> doesn't seem to be written in a thread safe manner, and it hasn't been
> >> javadocced at all. Trilead looks promising as well.
>
> >> Does anyone have experience with these (or any other) SSH library in
> >> Java? The primary use case is in an automation system, running remote
> >> commands in batch on multiple hosts. The existing system uses
> >> ProcessBuilders and executes "ssh" locally. It is a highly concurrent
> >> application, so any solution we choose *must* be thread safe.
>
> > On a slight tangent strongly multi-threaded applications shell out
> > VERY poorly, since all the threads are stopped to perform
> > the fork(), then restarted.
....
> That is exactly one of the reasons I wish to use a Java native SSH
> library
I don't know if this could help you but in my case I solved this
problem by creating a (non-portable) script that takes care
of consuming "ssh orders" and warning the Java app every time an
order has been correctly executed.
If I have, say, 3000 scp commands to run, I can launch ten times
the script from Java and give 300 orders to each script.
That way I only ever call ten scripts, when the Java app starts up
and then just communicate with them.
Not native Java but it worked for us.