public interface CalculationListener
It is guaranteed that the methods of a listener will only be invoked by a single thread at any time. It is not guaranteed to be the same thread invoking a listener each time. The calling code is synchronized to ensure that any changes in the listener state will be visible to every thread used to invoke the listener. Therefore listener implementations are not required to be thread safe.
A listener instance should not be used for multiple sets of calculations.
|Modifier and Type||Method and Description|
Invoked when all calculations have completed.
Invoked when the calculations start; guaranteed to be invoked before
Invoked when a calculation completes.
default void calculationsStarted(List<CalculationTarget> targets, List<Column> columns)
targets- the targets for which values are being calculated; these are often trades
columns- the columns for which values are being calculated
void resultReceived(CalculationTarget target, CalculationResult result)
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.
target- the calculation target, such as a trade
result- the result of the calculation
This is guaranteed to be called after all results have been passed to
This method will be called immediately after
calculationsStarted(List, List) and without any calls
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.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.