new module:ct-trading /testing /Instrument Data Subscriber Stub()
Constructs an instance of InstrumentDataSubscriberStub
.
A InstrumentDataSubscriberStub replaces the module:ct-trading/trademodel/SL4BInstrumentDataSubscriber
for the purpose of testing ESP trades and trading components in acceptance tests and workbenches by propagating instrument data
sent from a mock server component to the subscribed trade leg.
Methods
receive Data(mData)
This method is called by a mock trade server to simulate the receipt of instrument data from Liberator via SL4B. The event is propagated to the subscribed trade leg. This stub will print out the message to a logger if one has been defined.
Parameters:
Name | Type | Description |
---|---|---|
mData |
Map | the instrument data being received |
subscribe Trade Leg(trade Leg, instrument Name, field Names)
Registers a trade leg to receive data for a particular instrument.
Parameters:
Name | Type | Description |
---|---|---|
tradeLeg |
module:ct-trading |
The trade leg that will receive the data. |
instrumentName |
String | The name of the financial instrument for which the leg requires data. |
fieldNames |
Array | The list of fields for which the leg requires data. |
unsubscribe Trade Leg()
Deallocates any resources used by the subscriber.
Correctly implementing this method is important, since if users are not un-subscribed for instruments they are no longer viewing, then serious performance problems are likely to occur.