Package org.apache.mina.core.future
Class CompositeIoFuture<E extends IoFuture>
- java.lang.Object
-
- org.apache.mina.core.future.DefaultIoFuture
-
- org.apache.mina.core.future.CompositeIoFuture<E>
-
- Type Parameters:
E- the type of the child futures.
- All Implemented Interfaces:
IoFuture
public class CompositeIoFuture<E extends IoFuture> extends DefaultIoFuture
AnIoFutureofIoFutures. It is useful when you want to get notified when allIoFutures are complete. It is not recommended to useCompositeIoFutureif you just want to wait for all futures. In that case, please useIoUtil.await(Iterable)instead for better performance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classCompositeIoFuture.NotifyingListener
-
Field Summary
Fields Modifier and Type Field Description private booleanconstructionFinishedA flag set to TRUE when all the future have been added to the listprivate CompositeIoFuture.NotifyingListenerlistenerA listenerprivate java.util.concurrent.atomic.AtomicIntegerunnotifiedA thread safe counter that is used to keep a track of the notified futures
-
Constructor Summary
Constructors Constructor Description CompositeIoFuture(java.lang.Iterable<E> children)Creates a new CompositeIoFuture instance
-
Method Summary
-
Methods inherited from class org.apache.mina.core.future.DefaultIoFuture
addListener, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getSession, getValue, isDone, join, join, removeListener, setValue
-
-
-
-
Field Detail
-
listener
private final CompositeIoFuture.NotifyingListener listener
A listener
-
unnotified
private final java.util.concurrent.atomic.AtomicInteger unnotified
A thread safe counter that is used to keep a track of the notified futures
-
constructionFinished
private volatile boolean constructionFinished
A flag set to TRUE when all the future have been added to the list
-
-
Constructor Detail
-
CompositeIoFuture
public CompositeIoFuture(java.lang.Iterable<E> children)
Creates a new CompositeIoFuture instance- Parameters:
children- The list of internal futures
-
-