Class SdkChannelPoolMap<K,P extends io.netty.channel.pool.ChannelPool>
- java.lang.Object
-
- software.amazon.awssdk.http.nio.netty.internal.SdkChannelPoolMap<K,P>
-
- All Implemented Interfaces:
io.netty.channel.pool.ChannelPoolMap<K,P>,Closeable,AutoCloseable,Iterable<Map.Entry<K,P>>
- Direct Known Subclasses:
AwaitCloseChannelPoolMap
public abstract class SdkChannelPoolMap<K,P extends io.netty.channel.pool.ChannelPool> extends Object implements io.netty.channel.pool.ChannelPoolMap<K,P>, Iterable<Map.Entry<K,P>>, Closeable
Replacement forAbstractChannelPoolMap. This implementation guarantees only one instance of aChannelPoolis created for each key.
-
-
Constructor Summary
Constructors Constructor Description SdkChannelPoolMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()booleancontains(K key)Pget(K key)booleanisEmpty()Returnstrueif theAbstractChannelPoolMapis empty, otherwisefalse.Iterator<Map.Entry<K,P>>iterator()protected abstract PnewPool(K key)Called once a newChannelPoolneeds to be created as non exists yet for thekey.Map<K,P>pools()booleanremove(K key)Remove theChannelPoolfrom thisAbstractChannelPoolMap.intsize()Returns the number ofChannelPools currently in thisAbstractChannelPoolMap.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
remove
public final boolean remove(K key)
Remove theChannelPoolfrom thisAbstractChannelPoolMap. Returnstrueif removed,falseotherwise. Please note thatnullkeys are not allowed.
-
size
public final int size()
Returns the number ofChannelPools currently in thisAbstractChannelPoolMap.
-
isEmpty
public final boolean isEmpty()
Returnstrueif theAbstractChannelPoolMapis empty, otherwisefalse.
-
contains
public final boolean contains(K key)
-
newPool
protected abstract P newPool(K key)
Called once a newChannelPoolneeds to be created as non exists yet for thekey.
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-