T- the type of the aggregate result
public abstract class AggregatingCalculationListener<T> extends Object implements CalculationListener
|Constructor and Description|
|Modifier and Type||Method and Description|
Invoked when all calculations have completed.
Invoked to create the aggregate result when the individual calculations are complete.
A future providing asynchronous notification when the results are available.
Returns the aggregate result of the calculations, blocking until it is available.
Invoked when a calculation completes.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public final void calculationsComplete()
This is guaranteed to be called after all results have been passed to
This method will be called immediately after
CalculationListener.calculationsStarted(List, List) and without any calls
CalculationListener.resultReceived(CalculationTarget, CalculationResult) if there are no calculations to be performed.
This can happen if an empty list of targets is passed to the calculation runner.
public T result()
If the thread is interrupted while this method is blocked, then a runtime exception
is thrown, but with the interrupt flag set.
For additional control, use
public CompletableFuture<T> getFuture()
public abstract void resultReceived(CalculationTarget target, CalculationResult result)
It is guaranteed that
CalculationListener.calculationsStarted(List, List) will be called before
this method and that this method will never be called after
It is possible that this method will never be called. This can happen if an empty list of targets is passed to the calculation runner.
protected abstract T createAggregateResult()
This is guaranteed to be invoked after all results have been passed to
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.