In an application that subscribes to MarketPrice instruments using EMA Java, I would like to preserve for a later use the Data I receive via Refresh and Update messages. My current understanding is that the Data I receive for each field is only valid in the context of the onRefresh and onUpdate callback methods. For example if in an onRefresh method I preserve the Data of a FieldEntry by calling fieldData = fieldEntry.load(), I cannot use this fieldData variable later after onRefresh returned.
- Can you please confirm if my understanding is correct?
- If yes, is there an easy way to clone the received data for later reuse, out of the onRefresh/onUpdate callback methods? By easy way I mean something like fieldData = fieldEntry.load().clone(). In order to avoid being too much coupled with the EMA Data types, I would like to avoid a big switch that deals with every possible data type.