Package one.nio.pool
Class SocketPool
java.lang.Object
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,Cloneable,Iterable<Socket>,Collection<Socket>,Deque<Socket>,List<Socket>,Queue<Socket>,SequencedCollection<Socket>,SocketPoolMXBean
- Direct Known Subclasses:
HttpClient,RpcClient
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Stringprotected intprotected Proxyprotected intprotected SslContextprotected intFields inherited from class one.nio.pool.Pool
closed, createdCount, fifo, initialCount, keepEmpty, maxCount, timeout, timeouts, waitingThreadsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroyObject(Socket socket) intintbooleangetFifo()intintgetProxy()intintintintname()voidsetConnectTimeout(int connectTimeout) voidsetFifo(boolean fifo) voidsetMaxCount(int maxCount) protected voidvoidvoidsetReadTimeout(int readTimeout) voidsetSslContext(SslContext sslContext) voidsetTimeout(int timeout) Methods inherited from class one.nio.pool.Pool
borrowObject, close, initialize, invalidateAll, invalidateObject, isClosed, returnObjectMethods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, reversed, set, size, spliterator, toArray, toArrayMethods inherited from class java.util.AbstractSequentialList
iteratorMethods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subListMethods inherited from interface one.nio.pool.SocketPoolMXBean
invalidateAll, isClosed
-
Field Details
-
host
-
port
protected int port -
readTimeout
protected int readTimeout -
connectTimeout
protected int connectTimeout -
tos
protected int tos -
sslContext
-
proxy
-
-
Constructor Details
-
SocketPool
-
-
Method Details
-
setProperties
-
name
-
getTimeouts
public int getTimeouts()- Specified by:
getTimeoutsin interfaceSocketPoolMXBean
-
getWaitingThreads
public int getWaitingThreads()- Specified by:
getWaitingThreadsin interfaceSocketPoolMXBean
-
getBusyCount
public int getBusyCount()- Specified by:
getBusyCountin interfaceSocketPoolMXBean
-
getIdleCount
public int getIdleCount()- Specified by:
getIdleCountin interfaceSocketPoolMXBean
-
getMaxCount
public int getMaxCount()- Specified by:
getMaxCountin interfaceSocketPoolMXBean
-
setMaxCount
public void setMaxCount(int maxCount) - Specified by:
setMaxCountin interfaceSocketPoolMXBean
-
getTimeout
public int getTimeout()- Specified by:
getTimeoutin interfaceSocketPoolMXBean
-
setTimeout
public void setTimeout(int timeout) - Specified by:
setTimeoutin interfaceSocketPoolMXBean
-
getReadTimeout
public int getReadTimeout()- Specified by:
getReadTimeoutin interfaceSocketPoolMXBean
-
setReadTimeout
public void setReadTimeout(int readTimeout) - Specified by:
setReadTimeoutin interfaceSocketPoolMXBean
-
getConnectTimeout
public int getConnectTimeout()- Specified by:
getConnectTimeoutin interfaceSocketPoolMXBean
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout) - Specified by:
setConnectTimeoutin interfaceSocketPoolMXBean
-
getFifo
public boolean getFifo()- Specified by:
getFifoin interfaceSocketPoolMXBean
-
setFifo
public void setFifo(boolean fifo) - Specified by:
setFifoin interfaceSocketPoolMXBean
-
getSslContext
-
setSslContext
-
getProxy
-
setProxy
-
createObject
- Specified by:
createObjectin classPool<Socket>- Throws:
PoolException
-
destroyObject
- Overrides:
destroyObjectin classPool<Socket>
-