/** * <p>Sets the promise to be notified when all combined futures have finished. If all combined futures succeed, * then the aggregate promise will succeed. If one or more combined futures fails, then the aggregate promise will * fail with the cause of one of the failed futures. If more than one combined future fails, then exactly which * failure will be assigned to the aggregate promise is undefined.</p> * * <p>After this method is called, no more futures may be added via the {@link PromiseCombiner#add(Future)} or * {@link PromiseCombiner#addAll(Future[])} methods.</p> * * @param aggregatePromise the promise to notify when all combined futures have finished */ public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }
/** * <p>Sets the promise to be notified when all combined futures have finished. If all combined futures succeed, * then the aggregate promise will succeed. If one or more combined futures fails, then the aggregate promise will * fail with the cause of one of the failed futures. If more than one combined future fails, then exactly which * failure will be assigned to the aggregate promise is undefined.</p> * * <p>After this method is called, no more futures may be added via the {@link PromiseCombiner#add(Future)} or * {@link PromiseCombiner#addAll(Future[])} methods.</p> * * @param aggregatePromise the promise to notify when all combined futures have finished */ public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }
/** * <p>Sets the promise to be notified when all combined futures have finished. If all combined futures succeed, * then the aggregate promise will succeed. If one or more combined futures fails, then the aggregate promise will * fail with the cause of one of the failed futures. If more than one combined future fails, then exactly which * failure will be assigned to the aggregate promise is undefined.</p> * * <p>After this method is called, no more futures may be added via the {@link PromiseCombiner#add(Future)} or * {@link PromiseCombiner#addAll(Future[])} methods.</p> * * @param aggregatePromise the promise to notify when all combined futures have finished */ public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }
/** * <p>Sets the promise to be notified when all combined futures have finished. If all combined futures succeed, * then the aggregate promise will succeed. If one or more combined futures fails, then the aggregate promise will * fail with the cause of one of the failed futures. If more than one combined future fails, then exactly which * failure will be assigned to the aggregate promise is undefined.</p> * * <p>After this method is called, no more futures may be added via the {@link PromiseCombiner#add(Future)} or * {@link PromiseCombiner#addAll(Future[])} methods.</p> * * @param aggregatePromise the promise to notify when all combined futures have finished */ public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }
/** * <p>Sets the promise to be notified when all combined futures have finished. If all combined futures succeed, * then the aggregate promise will succeed. If one or more combined futures fails, then the aggregate promise will * fail with the cause of one of the failed futures. If more than one combined future fails, then exactly which * failure will be assigned to the aggregate promise is undefined.</p> * * <p>After this method is called, no more futures may be added via the {@link PromiseCombiner#add(Future)} or * {@link PromiseCombiner#addAll(Future[])} methods.</p> * * @param aggregatePromise the promise to notify when all combined futures have finished */ public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }
/** * <p>Sets the promise to be notified when all combined futures have finished. If all combined futures succeed, * then the aggregate promise will succeed. If one or more combined futures fails, then the aggregate promise will * fail with the cause of one of the failed futures. If more than one combined future fails, then exactly which * failure will be assigned to the aggregate promise is undefined.</p> * * <p>After this method is called, no more futures may be added via the {@link PromiseCombiner#add(Future)} or * {@link PromiseCombiner#addAll(Future[])} methods.</p> * * @param aggregatePromise the promise to notify when all combined futures have finished */ public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }
/** * <p>Sets the promise to be notified when all combined futures have finished. If all combined futures succeed, * then the aggregate promise will succeed. If one or more combined futures fails, then the aggregate promise will * fail with the cause of one of the failed futures. If more than one combined future fails, then exactly which * failure will be assigned to the aggregate promise is undefined.</p> * * <p>After this method is called, no more futures may be added via the {@link PromiseCombiner#add(Future)} or * {@link PromiseCombiner#addAll(Future[])} methods.</p> * * @param aggregatePromise the promise to notify when all combined futures have finished */ public void finish(Promise<Void> aggregatePromise) { if (doneAdding) { throw new IllegalStateException("Already finished"); } doneAdding = true; this.aggregatePromise = ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise"); if (doneCount == expectedCount) { tryPromise(); } }