Search in sources :

Example 1 with RequestFuture

use of com.sshtools.common.ssh.RequestFuture in project agileway by fangjinuo.

the class SynergySessionedChannel method internalExec.

@Override
protected void internalExec(String command) throws SshException {
    try {
        RequestFuture future = channel.executeCommand(command);
        future.waitForever();
    } catch (Throwable ex) {
        throw new SshException(ex);
    }
}
Also used : RequestFuture(com.sshtools.common.ssh.RequestFuture) SshException(com.jn.agileway.ssh.client.SshException)

Example 2 with RequestFuture

use of com.sshtools.common.ssh.RequestFuture in project agileway by fangjinuo.

the class SynergySessionedChannel method env.

@Override
public void env(String variableName, String variableValue) throws SshException {
    try {
        RequestFuture future = channel.setEnvironmentVariable(variableName, variableValue);
        future.waitForever();
    } catch (Throwable ex) {
        throw new SshException(ex);
    }
}
Also used : RequestFuture(com.sshtools.common.ssh.RequestFuture) SshException(com.jn.agileway.ssh.client.SshException)

Example 3 with RequestFuture

use of com.sshtools.common.ssh.RequestFuture in project agileway by fangjinuo.

the class SynergySessionedChannel method internalSubsystem.

@Override
protected void internalSubsystem(String subsystem) throws SshException {
    try {
        RequestFuture future = channel.startSubsystem(subsystem);
        future.waitForever();
    } catch (Throwable ex) {
        throw new SshException(ex);
    }
}
Also used : RequestFuture(com.sshtools.common.ssh.RequestFuture) SshException(com.jn.agileway.ssh.client.SshException)

Example 4 with RequestFuture

use of com.sshtools.common.ssh.RequestFuture in project agileway by fangjinuo.

the class SynergySessionedChannel method internalShell.

@Override
protected void internalShell() throws SshException {
    try {
        RequestFuture future = channel.startShell();
        future.waitForever();
    } catch (Throwable ex) {
        throw new SshException(ex);
    }
}
Also used : RequestFuture(com.sshtools.common.ssh.RequestFuture) SshException(com.jn.agileway.ssh.client.SshException)

Aggregations

SshException (com.jn.agileway.ssh.client.SshException)4 RequestFuture (com.sshtools.common.ssh.RequestFuture)4