public interface CalculationListener
CalculationRunner.
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 |
|---|---|
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
before
resultReceived(CalculationTarget, CalculationResult) and
calculationsComplete(). |
void |
resultReceived(CalculationTarget target,
CalculationResult result)
Invoked when a calculation completes.
|
default void calculationsStarted(List<CalculationTarget> targets, List<Column> columns)
resultReceived(CalculationTarget, CalculationResult) and
calculationsComplete().targets - the targets for which values are being calculated; these are often tradescolumns - the columns for which values are being calculatedvoid resultReceived(CalculationTarget target, CalculationResult result)
It is guaranteed that calculationsStarted(List, List) will be called before
this method and that this method will never be called after calculationsComplete().
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 traderesult - the result of the calculationvoid calculationsComplete()
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
to 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.