Interface CalculationListener
-
- All Known Implementing Classes:
AggregatingCalculationListener
,ResultsListener
public interface CalculationListener
Listener that is notified when calculations are performed by aCalculationRunner
.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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
calculationsComplete()
Invoked when all calculations have completed.default void
calculationsStarted(List<CalculationTarget> targets, List<Column> columns)
Invoked when the calculations start; guaranteed to be invoked beforeresultReceived(CalculationTarget, CalculationResult)
andcalculationsComplete()
.void
resultReceived(CalculationTarget target, CalculationResult result)
Invoked when a calculation completes.
-
-
-
Method Detail
-
calculationsStarted
default void calculationsStarted(List<CalculationTarget> targets, List<Column> columns)
Invoked when the calculations start; guaranteed to be invoked beforeresultReceived(CalculationTarget, CalculationResult)
andcalculationsComplete()
.- Parameters:
targets
- the targets for which values are being calculated; these are often tradescolumns
- the columns for which values are being calculated
-
resultReceived
void resultReceived(CalculationTarget target, CalculationResult result)
Invoked when a calculation completes.It is guaranteed that
calculationsStarted(List, List)
will be called before this method and that this method will never be called aftercalculationsComplete()
.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.
- Parameters:
target
- the calculation target, such as a traderesult
- the result of the calculation
-
calculationsComplete
void calculationsComplete()
Invoked when all calculations have completed.This is guaranteed to be called after all results have been passed to
resultReceived(com.opengamma.strata.basics.CalculationTarget, com.opengamma.strata.calc.runner.CalculationResult)
.This method will be called immediately after
calculationsStarted(List, List)
and without any calls toresultReceived(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.
-
-