Top Description Methods
io.netty.channel.pool

public Interface ChannelPool

extends Closeable
Known Direct Implementers
io.netty.channel.pool.SimpleChannelPool
Imports
io.netty.channel.Channel, io.netty.util.concurrent.Future, .Promise, java.io.Closeable

Allows to acquire and release Channel and so act as a pool of these.

Method Summary

Modifier and TypeMethod and Description
public Future<Channel>
acquire()

Acquire a Channel from this ChannelPool.

public Future<Channel>
acquire(Promise<Channel> promise)

Acquire a Channel from this ChannelPool.

public void
close()

Redeclares java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public Future<Void>
release(Channel channel)

Release a Channel back to this ChannelPool.

public Future<Void>
release(Channel channel, Promise<Void> promise)

Release a Channel back to this ChannelPool.

Method Detail

acquireback to summary
public Future<Channel> acquire()

Acquire a Channel from this ChannelPool. The returned Future is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if the Channel is explicitly closed..

acquireback to summary
public Future<Channel> acquire(Promise<Channel> promise)

Acquire a Channel from this ChannelPool. The given Promise is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if the Channel is explicitly closed..

closeback to summary
public void close()

Redeclares java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
releaseback to summary
public Future<Void> release(Channel channel)

Release a Channel back to this ChannelPool. The returned Future is notified once the release is successful and failed otherwise. When failed the Channel will automatically closed.

releaseback to summary
public Future<Void> release(Channel channel, Promise<Void> promise)

Release a Channel back to this ChannelPool. The given Promise is notified once the release is successful and failed otherwise. When failed the Channel will automatically closed.