Package org.apache.sshd.sftp.client.fs
Class SftpFileSystem.SftpClientPool
- java.lang.Object
-
- org.apache.sshd.sftp.client.fs.SftpFileSystem.SftpClientPool
-
- Enclosing class:
- SftpFileSystem
protected class SftpFileSystem.SftpClientPool extends java.lang.ObjectA pool ofSftpClients. The pool has a maximum size and an optional minimum size, and can optionally expire idle channels from the pool.
-
-
Field Summary
Fields Modifier and Type Field Description private intcoreSizeprivate longidleLifeTimeprivate java.util.concurrent.BlockingQueue<SftpFileSystem.SftpClientHandle>poolprivate java.util.concurrent.ScheduledExecutorServicetimeouts
-
Constructor Summary
Constructors Constructor Description SftpClientPool(int maxSize, java.time.Duration idleLifeTime, int coreSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private voidcloseSilently(SftpFileSystem.SftpClientHandle handle)booleanoffer(SftpClient client)SftpClientpoll()
-
-
-
Field Detail
-
timeouts
private final java.util.concurrent.ScheduledExecutorService timeouts
-
pool
private final java.util.concurrent.BlockingQueue<SftpFileSystem.SftpClientHandle> pool
-
idleLifeTime
private final long idleLifeTime
-
coreSize
private final int coreSize
-
-
Method Detail
-
close
public void close()
-
poll
public SftpClient poll()
-
offer
public boolean offer(SftpClient client)
-
closeSilently
private void closeSilently(SftpFileSystem.SftpClientHandle handle)
-
-