Caplin Trader 5.1.0

Class: module:ct-trading/testing/InstrumentDataSubscriberStub

module:ct-trading/testing/InstrumentDataSubscriberStub()

new module:ct-trading/testing/InstrumentDataSubscriberStub()

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.

Implements:

Methods

receiveData(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

subscribeTradeLeg(tradeLeg, instrumentName, fieldNames)

Registers a trade leg to receive data for a particular instrument.

Parameters:
Name Type Description
tradeLeg module:ct-trading/trademodel/TradeLeg

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.

Implements:

unsubscribeTradeLeg()

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.

Implements: