import org.apache.sshd.common.Factory
import org.apache.sshd.server.Environment
import org.apache.sshd.server.ExitCallback
+import org.apache.sshd.server.channel.ChannelSession
import org.apache.sshd.server.command.Command
+import org.apache.sshd.server.shell.ShellFactory
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStream
import java.io.InterruptedIOException
import java.io.OutputStream
-class EchoShellFactory : Factory<Command> {
+class EchoShellFactory : Factory<Command>, ShellFactory {
override fun create(): Command {
return EchoShell()
}
+ override fun createShell(channel: ChannelSession?): Command {
+ return EchoShell()
+ }
+
companion object {
val INSTANCE = EchoShellFactory()
}
@Throws(IOException::class)
- override fun start(env: Environment) {
+ override fun start(channel: ChannelSession?, env: Environment?) {
environment = env
thread = Thread(this, "EchoShell")
thread!!.isDaemon = true
thread!!.start()
}
- override fun destroy() {
+ override fun destroy(channel: ChannelSession?) {
thread!!.interrupt()
}