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 aChannelPool
is 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 void
close()
boolean
contains(K key)
P
get(K key)
boolean
isEmpty()
Returnstrue
if theAbstractChannelPoolMap
is empty, otherwisefalse
.Iterator<Map.Entry<K,P>>
iterator()
protected abstract P
newPool(K key)
Called once a newChannelPool
needs to be created as non exists yet for thekey
.Map<K,P>
pools()
boolean
remove(K key)
Remove theChannelPool
from thisAbstractChannelPoolMap
.int
size()
Returns the number ofChannelPool
s 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 theChannelPool
from thisAbstractChannelPoolMap
. Returnstrue
if removed,false
otherwise. Please note thatnull
keys are not allowed.
-
size
public final int size()
Returns the number ofChannelPool
s currently in thisAbstractChannelPoolMap
.
-
isEmpty
public final boolean isEmpty()
Returnstrue
if theAbstractChannelPoolMap
is empty, otherwisefalse
.
-
contains
public final boolean contains(K key)
-
newPool
protected abstract P newPool(K key)
Called once a newChannelPool
needs to be created as non exists yet for thekey
.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-