Class
caplin.presenter.domain.property

MessageServicePropertyFactory

The MessageServicePropertyFactory class allows caplin.presenter.property.Property instances to be created for the fields of records subscribed to from a caplin.services.messaging.MessageService.

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

Constructor Summary

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

Constructs an instance of MessageServicePropertyFactory.

Method Summary

Attributes Name and Description
void dispose()

Disposes the subscription and stops this factory from holding on to the properties.

{} getProperties()

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

caplin.presenter.property.Property getProperty( sFieldName)

void pause()

Pauses updates so that any properties will not continue to be updated.

void resume()

Unpauses this factory so that it will start receiving updates again.

void setSubject( sSubject)

Changes the subject that this PropertyFactory is subscribed to.

Constructor Detail

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

Constructs an instance of MessageServicePropertyFactory.

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

Method Detail

void dispose()

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

{} getProperties()

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.

caplin.presenter.property.Property getProperty( sFieldName)

Parameters
sFieldName the name of a field to subscribe to. May not be null or the empty string.
Returns
{caplin.presenter.property.Property} a Property that updates when messages are received from the MessageService.

void pause()

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

void resume()

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

void 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
sSubject the name of the subject to subscribe to. Must be a nonempty string.