org.jboss.netty.channel
Interface ChannelFutureListener

All Superinterfaces:
EventListener
All Known Subinterfaces:
ChannelFutureProgressListener

public interface ChannelFutureListener
extends EventListener

Listens to the result of a ChannelFuture. The result of the asynchronous Channel I/O operation is notified once this listener is added by calling ChannelFuture.addListener(ChannelFutureListener).

Return the control to the caller quickly

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.

Version:
$Rev: 2185 $, $Date: 2010-02-19 14:13:48 +0900 (Fri, 19 Feb 2010) $
Author:
The Netty Project, Trustin Lee

Field Summary
static ChannelFutureListener CLOSE
          A ChannelFutureListener that closes the Channel which is associated with the specified ChannelFuture.
static ChannelFutureListener CLOSE_ON_FAILURE
          A ChannelFutureListener that closes the Channel when the operation ended up with a failure or cancellation rather than a success.
 
Method Summary
 void operationComplete(ChannelFuture future)
          Invoked when the I/O operation associated with the ChannelFuture has been completed.
 

Field Detail

CLOSE

static final ChannelFutureListener CLOSE
A ChannelFutureListener that closes the Channel which is associated with the specified ChannelFuture.


CLOSE_ON_FAILURE

static final ChannelFutureListener CLOSE_ON_FAILURE
A ChannelFutureListener that closes the Channel when the operation ended up with a failure or cancellation rather than a success.

Method Detail

operationComplete

void operationComplete(ChannelFuture future)
                       throws Exception
Invoked when the I/O operation associated with the ChannelFuture has been completed.

Parameters:
future - the source ChannelFuture which called this callback
Throws:
Exception


Copyright © 2008-2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.