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
AbstractChannelPoolMap
. This implementation guarantees
only one instance of a ChannelPool
is created for each key.Constructor and Description |
---|
SdkChannelPoolMap() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
contains(K key) |
P |
get(K key) |
boolean |
isEmpty()
Returns
true if the AbstractChannelPoolMap is empty, otherwise false . |
Iterator<Map.Entry<K,P>> |
iterator() |
protected abstract P |
newPool(K key)
Called once a new
ChannelPool needs to be created as non exists yet for the key . |
Map<K,P> |
pools() |
boolean |
remove(K key)
Remove the
ChannelPool from this AbstractChannelPoolMap . |
int |
size()
Returns the number of
ChannelPool s currently in this AbstractChannelPoolMap . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public final boolean remove(K key)
ChannelPool
from this AbstractChannelPoolMap
. Returns true
if
removed, false
otherwise.
Please note that null
keys are not allowed.public final int size()
ChannelPool
s currently in this AbstractChannelPoolMap
.public final boolean isEmpty()
true
if the AbstractChannelPoolMap
is empty, otherwise false
.public final boolean contains(K key)
protected abstract P newPool(K key)
ChannelPool
needs to be created as non exists yet for the key
.public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2019. All rights reserved.