Class AbstractChannelPoolMap<K, P extends ChannelPool>
java.lang.Object
io.netty.channel.pool.AbstractChannelPoolMap<K,P>
- All Implemented Interfaces:
ChannelPoolMap<K,P>, Closeable, AutoCloseable, Iterable<Map.Entry<K, P>>
public abstract class AbstractChannelPoolMap<K, P extends ChannelPool>
extends Object
implements ChannelPoolMap<K,P>, Iterable<Map.Entry<K,P>>, Closeable
A skeletal
ChannelPoolMap implementation. To find the right ChannelPool
the Object.hashCode() and Object.equals(Object) is used.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()final booleanfinal PReturn theChannelPoolfor thecode.final booleanisEmpty()iterator()protected abstract PCalled once a newChannelPoolneeds to be created as non exists yet for thekey.final booleanRemove theChannelPoolfrom thisAbstractChannelPoolMap.final intsize()Returns the number ofChannelPools currently in thisAbstractChannelPoolMap.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
AbstractChannelPoolMap
public AbstractChannelPoolMap()
-
-
Method Details
-
get
Description copied from interface:ChannelPoolMapReturn theChannelPoolfor thecode. This will never returnnull, but create a newChannelPoolif non exists for they requestedkey. Please note thatnullkeys are not allowed.- Specified by:
getin interfaceChannelPoolMap<K, P extends ChannelPool>
-
remove
Remove theChannelPoolfrom thisAbstractChannelPoolMap. Returnstrueif removed,falseotherwise. If the removed pool extendsSimpleChannelPoolit will be closed asynchronously to avoid blocking in this method. Please note thatnullkeys are not allowed. -
iterator
-
size
public final int size()Returns the number ofChannelPools currently in thisAbstractChannelPoolMap. -
isEmpty
public final boolean isEmpty() -
contains
Description copied from interface:ChannelPoolMap- Specified by:
containsin interfaceChannelPoolMap<K, P extends ChannelPool>
-
newPool
Called once a newChannelPoolneeds to be created as non exists yet for thekey. -
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-