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.Object
A pool ofSftpClient
s. 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 int
coreSize
private long
idleLifeTime
private java.util.concurrent.BlockingQueue<SftpFileSystem.SftpClientHandle>
pool
private java.util.concurrent.ScheduledExecutorService
timeouts
-
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 void
close()
private void
closeSilently(SftpFileSystem.SftpClientHandle handle)
boolean
offer(SftpClient client)
SftpClient
poll()
-
-
-
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)
-
-