org.jboss.netty.channel.group
Class DefaultChannelGroupFuture

java.lang.Object
  extended by org.jboss.netty.channel.group.DefaultChannelGroupFuture
All Implemented Interfaces:
Iterable<ChannelFuture>, ChannelGroupFuture

public class DefaultChannelGroupFuture
extends Object
implements ChannelGroupFuture

The default ChannelGroupFuture implementation.

Version:
$Rev: 1714 $, $Date: 2009-09-04 13:21:56 +0900 (금, 04 9 2009) $
Author:
The Netty Project (netty-dev@lists.jboss.org), Trustin Lee (tlee@redhat.com)

Constructor Summary
DefaultChannelGroupFuture(ChannelGroup group, Collection<ChannelFuture> futures)
          Creates a new instance.
 
Method Summary
 void addListener(ChannelGroupFutureListener listener)
          Adds the specified listener to this future.
 ChannelGroupFuture await()
          Waits for this future to be completed.
 boolean await(long timeoutMillis)
          Waits for this future to be completed within the specified time limit.
 boolean await(long timeout, TimeUnit unit)
          Waits for this future to be completed within the specified time limit.
 ChannelGroupFuture awaitUninterruptibly()
          Waits for this future to be completed without interruption.
 boolean awaitUninterruptibly(long timeoutMillis)
          Waits for this future to be completed within the specified time limit without interruption.
 boolean awaitUninterruptibly(long timeout, TimeUnit unit)
          Waits for this future to be completed within the specified time limit without interruption.
 ChannelFuture find(Channel channel)
          Returns the ChannelFuture of the individual I/O operation which is associated with the specified Channel.
 ChannelFuture find(Integer channelId)
          Returns the ChannelFuture of the individual I/O operation which is associated with the Channel whose ID matches the specified integer.
 ChannelGroup getGroup()
          Returns the ChannelGroup which is associated with this future.
 boolean isCompleteFailure()
          Returns true if and only if all I/O operations associated with this future have failed without any success.
 boolean isCompleteSuccess()
          Returns true if and only if all I/O operations associated with this future were successful without any failure.
 boolean isDone()
          Returns true if and only if this future is complete, regardless of whether the operation was successful, failed, or canceled.
 boolean isPartialFailure()
          Returns true if and only if the I/O operations associated with this future have failed partially with some success.
 boolean isPartialSuccess()
          Returns true if and only if the I/O operations associated with this future were partially successful with some failure.
 Iterator<ChannelFuture> iterator()
          Returns the Iterator that enumerates all ChannelFutures which are associated with this future.
 void removeListener(ChannelGroupFutureListener listener)
          Removes the specified listener from this future.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultChannelGroupFuture

public DefaultChannelGroupFuture(ChannelGroup group,
                                 Collection<ChannelFuture> futures)
Creates a new instance.

Method Detail

getGroup

public ChannelGroup getGroup()
Description copied from interface: ChannelGroupFuture
Returns the ChannelGroup which is associated with this future.

Specified by:
getGroup in interface ChannelGroupFuture

find

public ChannelFuture find(Integer channelId)
Description copied from interface: ChannelGroupFuture
Returns the ChannelFuture of the individual I/O operation which is associated with the Channel whose ID matches the specified integer.

Specified by:
find in interface ChannelGroupFuture
Returns:
the matching ChannelFuture if found. null otherwise.

find

public ChannelFuture find(Channel channel)
Description copied from interface: ChannelGroupFuture
Returns the ChannelFuture of the individual I/O operation which is associated with the specified Channel.

Specified by:
find in interface ChannelGroupFuture
Returns:
the matching ChannelFuture if found. null otherwise.

iterator

public Iterator<ChannelFuture> iterator()
Description copied from interface: ChannelGroupFuture
Returns the Iterator that enumerates all ChannelFutures which are associated with this future. Please note that the returned Iterator is is unmodifiable, which means a ChannelFuture cannot be removed from this future.

Specified by:
iterator in interface Iterable<ChannelFuture>
Specified by:
iterator in interface ChannelGroupFuture

isDone

public boolean isDone()
Description copied from interface: ChannelGroupFuture
Returns true if and only if this future is complete, regardless of whether the operation was successful, failed, or canceled.

Specified by:
isDone in interface ChannelGroupFuture

isCompleteSuccess

public boolean isCompleteSuccess()
Description copied from interface: ChannelGroupFuture
Returns true if and only if all I/O operations associated with this future were successful without any failure.

Specified by:
isCompleteSuccess in interface ChannelGroupFuture

isPartialSuccess

public boolean isPartialSuccess()
Description copied from interface: ChannelGroupFuture
Returns true if and only if the I/O operations associated with this future were partially successful with some failure.

Specified by:
isPartialSuccess in interface ChannelGroupFuture

isPartialFailure

public boolean isPartialFailure()
Description copied from interface: ChannelGroupFuture
Returns true if and only if the I/O operations associated with this future have failed partially with some success.

Specified by:
isPartialFailure in interface ChannelGroupFuture

isCompleteFailure

public boolean isCompleteFailure()
Description copied from interface: ChannelGroupFuture
Returns true if and only if all I/O operations associated with this future have failed without any success.

Specified by:
isCompleteFailure in interface ChannelGroupFuture

addListener

public void addListener(ChannelGroupFutureListener listener)
Description copied from interface: ChannelGroupFuture
Adds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.

Specified by:
addListener in interface ChannelGroupFuture

removeListener

public void removeListener(ChannelGroupFutureListener listener)
Description copied from interface: ChannelGroupFuture
Removes the specified listener from this future. The specified listener is no longer notified when this future is done. If this future is already completed, this method has no effect and returns silently.

Specified by:
removeListener in interface ChannelGroupFuture

await

public ChannelGroupFuture await()
                         throws InterruptedException
Description copied from interface: ChannelGroupFuture
Waits for this future to be completed.

Specified by:
await in interface ChannelGroupFuture
Throws:
InterruptedException - if the current thread was interrupted

await

public boolean await(long timeout,
                     TimeUnit unit)
              throws InterruptedException
Description copied from interface: ChannelGroupFuture
Waits for this future to be completed within the specified time limit.

Specified by:
await in interface ChannelGroupFuture
Returns:
true if and only if the future was completed within the specified time limit
Throws:
InterruptedException - if the current thread was interrupted

await

public boolean await(long timeoutMillis)
              throws InterruptedException
Description copied from interface: ChannelGroupFuture
Waits for this future to be completed within the specified time limit.

Specified by:
await in interface ChannelGroupFuture
Returns:
true if and only if the future was completed within the specified time limit
Throws:
InterruptedException - if the current thread was interrupted

awaitUninterruptibly

public ChannelGroupFuture awaitUninterruptibly()
Description copied from interface: ChannelGroupFuture
Waits for this future to be completed without interruption. This method catches an InterruptedException and discards it silently.

Specified by:
awaitUninterruptibly in interface ChannelGroupFuture

awaitUninterruptibly

public boolean awaitUninterruptibly(long timeout,
                                    TimeUnit unit)
Description copied from interface: ChannelGroupFuture
Waits for this future to be completed within the specified time limit without interruption. This method catches an InterruptedException and discards it silently.

Specified by:
awaitUninterruptibly in interface ChannelGroupFuture
Returns:
true if and only if the future was completed within the specified time limit

awaitUninterruptibly

public boolean awaitUninterruptibly(long timeoutMillis)
Description copied from interface: ChannelGroupFuture
Waits for this future to be completed within the specified time limit without interruption. This method catches an InterruptedException and discards it silently.

Specified by:
awaitUninterruptibly in interface ChannelGroupFuture
Returns:
true if and only if the future was completed within the specified time limit


Copyright © 2008-2009 JBoss, by Red Hat. All Rights Reserved.