public abstract class AbstractChannelPoolMap<K,P extends ChannelPool> extends Object implements ChannelPoolMap<K,P>, Iterable<Map.Entry<K,P>>, Closeable
ChannelPoolMap implementation. To find the right ChannelPool
the Object.hashCode() and Object.equals(Object) is used.| Constructor and Description |
|---|
AbstractChannelPoolMap() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
contains(K key)
|
P |
get(K key)
Return the
ChannelPool for the code. |
boolean |
isEmpty()
|
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. |
boolean |
remove(K key)
Remove the
ChannelPool from this AbstractChannelPoolMap. |
int |
size()
Returns the number of
ChannelPools currently in this AbstractChannelPoolMap. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic final P get(K key)
ChannelPoolMapChannelPool for the code. This will never return null,
but create a new ChannelPool if non exists for they requested key.
Please note that null keys are not allowed.get in interface ChannelPoolMap<K,P extends ChannelPool>public final boolean remove(K key)
ChannelPool from this AbstractChannelPoolMap. Returns true if removed,
false otherwise.
If the removed pool extends SimpleChannelPool it will be closed asynchronously to avoid blocking in
this method.
Please note that null keys are not allowed.public final int size()
ChannelPools currently in this AbstractChannelPoolMap.public final boolean isEmpty()
public final boolean contains(K key)
ChannelPoolMapcontains in interface ChannelPoolMap<K,P extends ChannelPool>protected abstract P newPool(K key)
ChannelPool needs to be created as non exists yet for the key.public final void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2008–2025 The Netty Project. All rights reserved.