public abstract class AbstractChannelPoolMap<K,P extends ChannelPool> extends java.lang.Object implements ChannelPoolMap<K,P>, java.lang.Iterable<java.util.Map.Entry<K,P>>, java.io.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()
|
java.util.Iterator<java.util.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. |
public 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.
Please note that null keys are not allowed.public final java.util.Iterator<java.util.Map.Entry<K,P>> iterator()
iterator in interface java.lang.Iterable<java.util.Map.Entry<K,P extends ChannelPool>>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 java.io.Closeableclose in interface java.lang.AutoCloseableCopyright © 2008–2018 The Netty Project. All rights reserved.