Class
caplin.presenter.domain.property

SL4BRecordPropertyFactory

Extends SL4B_AbstractSubscriber.
The SL4BRecordPropertyFactory class allows caplin.presenter.property.Property instances to be created, where the property value contains live data being subscribed to using SL4B.

Constructor Summary

Attributes Name and Description
caplin.presenter.domain.property.SL4BRecordPropertyFactory(String sSubject)

Constructs an instance of SL4BRecordPropertyFactory with a subscription to the given subject.

Method Summary

Attributes Name and Description
Map getAllProperties()

Returns a map (field name to property) containing Property instances for every available field.

caplin.presenter.property.Property getAvailabilityProperty()

Returns a boolean Property that is true when the SL4B subscription is healthy and providing live data, and false otherwise.

caplin.presenter.property.Property getProperty(String sFieldName)

Returns a Property that contains live data for the given field.

void pauseUpdates()

Temporarily suspends data updates from the server.

void resumeUpdates()

Resumes data updates from the server.

void setSubject(String sSubject)

Change the subject that this factory subscribes to.

void startUpdates()

Initializes the subscription to SL4B, causing data updates to start.

void stopUpdates()

Permanently cancels the factory's subscription to SL4B and clears all properties.

Constructor Detail

caplin.presenter.domain.property.SL4BRecordPropertyFactory(String sSubject)

Constructs an instance of SL4BRecordPropertyFactory with a subscription to the given subject.

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

Method Detail

Map getAllProperties()

Returns a map (field name to property) containing Property instances for every available field.

caplin.presenter.property.Property getAvailabilityProperty()

Returns a boolean Property that is true when the SL4B subscription is healthy and providing live data, and false otherwise.

caplin.presenter.property.Property getProperty(String sFieldName)

Returns a Property that contains live data for the given field.

Parameters
String sFieldName The name of the field within the SL4B record that data will be provided for.

void pauseUpdates()

Temporarily suspends data updates from the server.

This method is useful when creating performant components, that pause subscriptions when they are deactivated, or minimized, and resume again once they become reactivated or restored.

See
#resumeUpdates

void resumeUpdates()

Resumes data updates from the server.

See
#pauseUpdates

void setSubject(String sSubject)

Change the subject that this factory subscribes to.

Updating the subject causes all existing properties to be temporarily cleared down, pending the arrival of the new data for the given subject.

Parameters
String sSubject The new subject to subscribe to.

void startUpdates()

Initializes the subscription to SL4B, causing data updates to start.

Properties created using the factory will not contain data until the startUpdates() method is invoked. For performance reasons, it is recommended that all properties that are expected to be needed are created before startUpdates() is invoked.

void stopUpdates()

Permanently cancels the factory's subscription to SL4B and clears all properties.

This method should be invoked during a components destroy() method.