Caplin Trader 4.7.1

Class: module:caplin/presenter/domain/property/MessageServicePropertyFactory

module:caplin/presenter/domain/property/MessageServicePropertyFactory

Constructor

new module:caplin/presenter/domain/property/MessageServicePropertyFactory(sSubject)

Constructs an instance of MessageServicePropertyFactory. The MessageServicePropertyFactory class allows module:br/presenter/property/Property instances to be created for the fields of records subscribed to from a module:caplin/services/messaging/MessageService.

A MessageService must have been registered with the ServiceRegistry before creating one of these Factories.

Parameters:
Name Type Description
sSubject String The subject of the record this factory will subscribe to (e.g. "/FX/USDGBP")

Methods

dispose()

Disposes the subscription and stops this factory from holding on to the properties. No other method should be called after this method.

getProperties() → {Object}

Allows you to request multiple properties at once, which is more efficient than requesting lots of individual properties.

Pass the names of the properties you wish to retrieve as a variable number of arguments.

Returns:
a map of the name of the property to the property.
Type
Object

getProperty(sFieldName) → {module:br/presenter/property/Property}

Parameters:
Name Type Description
sFieldName the name of a field to subscribe to. May not be null or the empty string.
Returns:
a Property that updates when messages are received from the MessageService.
Type
module:br/presenter/property/Property

getSubject()

Retrieves the subject of the subscription

isPaused()

Retrieves the paused status of the subscription

pause()

Pauses updates so that any properties will not continue to be updated. If this factory is already paused this method does nothing.

resume()

Unpauses this factory so that it will start receiving updates again. If this factory is not already paused, this method does nothing.

setSubject(sSubject)

Changes the subject that this PropertyFactory is subscribed to. Any currently acquired properties will be set to null until new data is received from the MessageService.
Parameters:
Name Type Description
sSubject the name of the subject to subscribe to. Must be a nonempty string.