Package org.jboss.netty.channel.group
Class DefaultChannelGroupFuture
- java.lang.Object
-
- org.jboss.netty.channel.group.DefaultChannelGroupFuture
-
- All Implemented Interfaces:
Iterable<ChannelFuture>,ChannelGroupFuture
public class DefaultChannelGroupFuture extends Object implements ChannelGroupFuture
The defaultChannelGroupFutureimplementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultChannelGroupFuture(ChannelGroup group, Collection<ChannelFuture> futures)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(ChannelGroupFutureListener listener)Adds the specified listener to this future.ChannelGroupFutureawait()Waits for this future to be completed.booleanawait(long timeoutMillis)Waits for this future to be completed within the specified time limit.booleanawait(long timeout, TimeUnit unit)Waits for this future to be completed within the specified time limit.ChannelGroupFutureawaitUninterruptibly()Waits for this future to be completed without interruption.booleanawaitUninterruptibly(long timeoutMillis)Waits for this future to be completed within the specified time limit without interruption.booleanawaitUninterruptibly(long timeout, TimeUnit unit)Waits for this future to be completed within the specified time limit without interruption.ChannelFuturefind(Integer channelId)Returns theChannelFutureof the individual I/O operation which is associated with theChannelwhose ID matches the specified integer.ChannelFuturefind(Channel channel)Returns theChannelFutureof the individual I/O operation which is associated with the specifiedChannel.ChannelGroupgetGroup()Returns theChannelGroupwhich is associated with this future.booleanisCompleteFailure()Returnstrueif and only if all I/O operations associated with this future have failed without any success.booleanisCompleteSuccess()Returnstrueif and only if all I/O operations associated with this future were successful without any failure.booleanisDone()Returnstrueif and only if this future is complete, regardless of whether the operation was successful, failed, or canceled.booleanisPartialFailure()Returnstrueif and only if the I/O operations associated with this future have failed partially with some success.booleanisPartialSuccess()Returnstrueif and only if the I/O operations associated with this future were partially successful with some failure.Iterator<ChannelFuture>iterator()Returns theIteratorthat enumerates allChannelFutures which are associated with this future.voidremoveListener(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
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DefaultChannelGroupFuture
public DefaultChannelGroupFuture(ChannelGroup group, Collection<ChannelFuture> futures)
Creates a new instance.
-
-
Method Detail
-
getGroup
public ChannelGroup getGroup()
Description copied from interface:ChannelGroupFutureReturns theChannelGroupwhich is associated with this future.- Specified by:
getGroupin interfaceChannelGroupFuture
-
find
public ChannelFuture find(Integer channelId)
Description copied from interface:ChannelGroupFutureReturns theChannelFutureof the individual I/O operation which is associated with theChannelwhose ID matches the specified integer.- Specified by:
findin interfaceChannelGroupFuture- Returns:
- the matching
ChannelFutureif found.nullotherwise.
-
find
public ChannelFuture find(Channel channel)
Description copied from interface:ChannelGroupFutureReturns theChannelFutureof the individual I/O operation which is associated with the specifiedChannel.- Specified by:
findin interfaceChannelGroupFuture- Returns:
- the matching
ChannelFutureif found.nullotherwise.
-
iterator
public Iterator<ChannelFuture> iterator()
Description copied from interface:ChannelGroupFutureReturns theIteratorthat enumerates allChannelFutures which are associated with this future. Please note that the returnedIteratoris is unmodifiable, which means aChannelFuturecannot be removed from this future.- Specified by:
iteratorin interfaceChannelGroupFuture- Specified by:
iteratorin interfaceIterable<ChannelFuture>
-
isDone
public boolean isDone()
Description copied from interface:ChannelGroupFutureReturnstrueif and only if this future is complete, regardless of whether the operation was successful, failed, or canceled.- Specified by:
isDonein interfaceChannelGroupFuture
-
isCompleteSuccess
public boolean isCompleteSuccess()
Description copied from interface:ChannelGroupFutureReturnstrueif and only if all I/O operations associated with this future were successful without any failure.- Specified by:
isCompleteSuccessin interfaceChannelGroupFuture
-
isPartialSuccess
public boolean isPartialSuccess()
Description copied from interface:ChannelGroupFutureReturnstrueif and only if the I/O operations associated with this future were partially successful with some failure.- Specified by:
isPartialSuccessin interfaceChannelGroupFuture
-
isPartialFailure
public boolean isPartialFailure()
Description copied from interface:ChannelGroupFutureReturnstrueif and only if the I/O operations associated with this future have failed partially with some success.- Specified by:
isPartialFailurein interfaceChannelGroupFuture
-
isCompleteFailure
public boolean isCompleteFailure()
Description copied from interface:ChannelGroupFutureReturnstrueif and only if all I/O operations associated with this future have failed without any success.- Specified by:
isCompleteFailurein interfaceChannelGroupFuture
-
addListener
public void addListener(ChannelGroupFutureListener listener)
Description copied from interface:ChannelGroupFutureAdds 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:
addListenerin interfaceChannelGroupFuture
-
removeListener
public void removeListener(ChannelGroupFutureListener listener)
Description copied from interface:ChannelGroupFutureRemoves 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:
removeListenerin interfaceChannelGroupFuture
-
await
public ChannelGroupFuture await() throws InterruptedException
Description copied from interface:ChannelGroupFutureWaits for this future to be completed.- Specified by:
awaitin interfaceChannelGroupFuture- Throws:
InterruptedException- if the current thread was interrupted
-
await
public boolean await(long timeout, TimeUnit unit) throws InterruptedExceptionDescription copied from interface:ChannelGroupFutureWaits for this future to be completed within the specified time limit.- Specified by:
awaitin interfaceChannelGroupFuture- Returns:
trueif 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 InterruptedExceptionDescription copied from interface:ChannelGroupFutureWaits for this future to be completed within the specified time limit.- Specified by:
awaitin interfaceChannelGroupFuture- Returns:
trueif 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:ChannelGroupFutureWaits for this future to be completed without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceChannelGroupFuture
-
awaitUninterruptibly
public boolean awaitUninterruptibly(long timeout, TimeUnit unit)Description copied from interface:ChannelGroupFutureWaits for this future to be completed within the specified time limit without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceChannelGroupFuture- Returns:
trueif and only if the future was completed within the specified time limit
-
awaitUninterruptibly
public boolean awaitUninterruptibly(long timeoutMillis)
Description copied from interface:ChannelGroupFutureWaits for this future to be completed within the specified time limit without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceChannelGroupFuture- Returns:
trueif and only if the future was completed within the specified time limit
-
-