Package io.netty.channel.pool
Interface ChannelPool
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
FixedChannelPool
,SimpleChannelPool
public interface ChannelPool extends java.io.Closeable
Allows to acquire and releaseChannel
and so act as a pool of these.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Future<Channel>
acquire()
Acquire aChannel
from thisChannelPool
.Future<Channel>
acquire(Promise<Channel> promise)
Acquire aChannel
from thisChannelPool
.void
close()
Future<java.lang.Void>
release(Channel channel)
Release aChannel
back to thisChannelPool
.Future<java.lang.Void>
release(Channel channel, Promise<java.lang.Void> promise)
Release aChannel
back to thisChannelPool
.
-
-
-
Method Detail
-
acquire
Future<Channel> acquire()
Acquire aChannel
from thisChannelPool
. The returnedFuture
is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if theChannel
is explicitly closed..
-
acquire
Future<Channel> acquire(Promise<Channel> promise)
Acquire aChannel
from thisChannelPool
. The givenPromise
is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if theChannel
is explicitly closed..
-
release
Future<java.lang.Void> release(Channel channel)
Release aChannel
back to thisChannelPool
. The returnedFuture
is notified once the release is successful and failed otherwise. When failed theChannel
will automatically closed.
-
release
Future<java.lang.Void> release(Channel channel, Promise<java.lang.Void> promise)
Release aChannel
back to thisChannelPool
. The givenPromise
is notified once the release is successful and failed otherwise. When failed theChannel
will automatically closed.
-
close
void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-