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.构造器和说明 |
---|
AbstractChannelPoolMap() |
限定符和类型 | 方法和说明 |
---|---|
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
ChannelPool s currently in this AbstractChannelPoolMap . |
public final P get(K key)
ChannelPoolMap
ChannelPool
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
在接口中 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 java.util.Iterator<java.util.Map.Entry<K,P>> iterator()
iterator
在接口中 java.lang.Iterable<java.util.Map.Entry<K,P extends ChannelPool>>
public final int size()
ChannelPool
s currently in this AbstractChannelPoolMap
.public final boolean isEmpty()
public final boolean contains(K key)
ChannelPoolMap
contains
在接口中 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
在接口中 java.io.Closeable
close
在接口中 java.lang.AutoCloseable