com.oneandone.iocunitejb.simulators.sftpserver.DelayedSftpSubsystemFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-unit-simulators Show documentation
Show all versions of ioc-unit-simulators Show documentation
Some serversimulators used ejbcdiunit to build an ejb-test-environment.
package com.oneandone.iocunitejb.simulators.sftpserver;
import java.util.function.Consumer;
import org.apache.sshd.common.util.GenericUtils;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.subsystem.sftp.SftpEventListener;
import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;
/**
* Creates {@link DelayedSftpSubsystem}s instead of {@link org.apache.sshd.server.subsystem.sftp.SftpSubsystem}s.
*/
public class DelayedSftpSubsystemFactory extends SftpSubsystemFactory {
@Override
public Command create() {
DelayedSftpSubsystem subsystem = new DelayedSftpSubsystem(getExecutorService(), isShutdownOnExit(), getUnsupportedAttributePolicy());
GenericUtils.forEach(getRegisteredListeners(), new Consumer() {
@Override
public void accept(SftpEventListener sftpEventListener) {
addSftpEventListener(sftpEventListener);
}
});
return subsystem;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy