Package io.netty.util.concurrent
Class PromiseNotifier<V,F extends Future<V>>
- java.lang.Object
-
- io.netty.util.concurrent.PromiseNotifier<V,F>
-
- Type Parameters:
V- the type of value returned by the futureF- the type of future
- All Implemented Interfaces:
GenericFutureListener<F>,java.util.EventListener
- Direct Known Subclasses:
ChannelPromiseNotifier
public class PromiseNotifier<V,F extends Future<V>> extends java.lang.Object implements GenericFutureListener<F>
GenericFutureListenerimplementation which takes otherPromises and notifies them on completion.
-
-
Field Summary
Fields Modifier and Type Field Description private static InternalLoggerloggerprivate booleanlogNotifyFailureprivate Promise<? super V>[]promises
-
Constructor Summary
Constructors Constructor Description PromiseNotifier(boolean logNotifyFailure, Promise<? super V>... promises)Create a new instance.PromiseNotifier(Promise<? super V>... promises)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidoperationComplete(F future)Invoked when the operation associated with theFuturehas been completed.
-
-
-
Field Detail
-
logger
private static final InternalLogger logger
-
logNotifyFailure
private final boolean logNotifyFailure
-
-
Constructor Detail
-
PromiseNotifier
@SafeVarargs public PromiseNotifier(Promise<? super V>... promises)
Create a new instance.- Parameters:
promises- thePromises to notify once thisGenericFutureListeneris notified.
-
PromiseNotifier
@SafeVarargs public PromiseNotifier(boolean logNotifyFailure, Promise<? super V>... promises)Create a new instance.- Parameters:
logNotifyFailure-trueif logging should be done in case notification fails.promises- thePromises to notify once thisGenericFutureListeneris notified.
-
-
Method Detail
-
operationComplete
public void operationComplete(F future) throws java.lang.Exception
Description copied from interface:GenericFutureListenerInvoked when the operation associated with theFuturehas been completed.- Specified by:
operationCompletein interfaceGenericFutureListener<V>- Parameters:
future- the sourceFuturewhich called this callback- Throws:
java.lang.Exception
-
-