Package org.jboss.netty.channel
Interface ChannelFutureProgressListener
-
- All Superinterfaces:
ChannelFutureListener
,java.util.EventListener
public interface ChannelFutureProgressListener extends ChannelFutureListener
Listens to the progress of a time-consuming I/O operation such as a large file transfer. If this listener is added to aChannelFuture
of an I/O operation that supports progress notification, the listener'soperationProgressed(ChannelFuture, long, long, long)
method will be called back by an I/O thread. If the operation does not support progress notification,operationProgressed(ChannelFuture, long, long, long)
will not be invoked. Like a usualChannelFutureListener
that this interface extends,ChannelFutureListener.operationComplete(ChannelFuture)
will be called when the future is marked as complete.Return the control to the caller quickly
operationProgressed(ChannelFuture, long, long, long)
andChannelFutureListener.operationComplete(ChannelFuture)
is directly called by an I/O thread. Therefore, performing a time consuming task or a blocking operation in the handler method can cause an unexpected pause during I/O. If you need to perform a blocking operation on I/O completion, try to execute the operation in a different thread using a thread pool.
-
-
Field Summary
-
Fields inherited from interface org.jboss.netty.channel.ChannelFutureListener
CLOSE, CLOSE_ON_FAILURE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
operationProgressed(ChannelFuture future, long amount, long current, long total)
Invoked when the I/O operation associated with theChannelFuture
has been progressed.-
Methods inherited from interface org.jboss.netty.channel.ChannelFutureListener
operationComplete
-
-
-
-
Method Detail
-
operationProgressed
void operationProgressed(ChannelFuture future, long amount, long current, long total) throws java.lang.Exception
Invoked when the I/O operation associated with theChannelFuture
has been progressed.- Parameters:
future
- the sourceChannelFuture
which called this callback- Throws:
java.lang.Exception
-
-