- Implementations:
- module:caplin/services/testing/MessageServiceStub
- module:caplin/sl4badapter/providers/SL4BMessageService
- module:caplin/sljsadapter/providers/StreamLinkMessageService
Methods
-
dispose()
-
Disposes of any listeners and resources that were used by the service.
- Implementations:
- module:caplin/services/testing/MessageServiceStub#dispose
- module:caplin/sl4badapter/providers/SL4BMessageService#dispose
- module:caplin/sljsadapter/providers/StreamLinkMessageService#dispose
-
onSubscriptionDisposed() → {module:caplin/services/messaging/Subscription}
-
Notifies this MessageService that a subscription has been disposed of.
- Implementations:
- module:caplin/services/testing/MessageServiceStub#onSubscriptionDisposed
- module:caplin/sl4badapter/providers/SL4BMessageService#onSubscriptionDisposed
- module:caplin/sljsadapter/providers/StreamLinkMessageService#onSubscriptionDisposed
Returns:
The subscription that's been disposed of -
publish(sSubject, mUpdateData, oListener, mHints)
-
Publishes data to a record.
Parameters:
Name Type Description sSubject
String The subject of the record being published to. mUpdateData
Map The data to be published to the record. oListener
module:caplin/services/messaging/PublishListener The listener that will receive the publish events. mHints
Map Any hints that might be used by the concrete implementation of the message service. - Implementations:
- module:caplin/services/testing/MessageServiceStub#publish
- module:caplin/sl4badapter/providers/SL4BMessageService#publish
- module:caplin/sljsadapter/providers/StreamLinkMessageService#publish
- See:
-
publishSessionMessage(sSubject, mUpdateData, oListener, mHints)
-
Publishes some session data to a record.
Whereas
module:caplin/services/messaging/MessageService#publish
allows you to publish a one-time message for consumption by the server (trade messages are sent like this for example),module:caplin/services/messaging/MessageService#publishSessionMessage
allows you to publish a message for the duration of your session (the trade-on-behalf-of user is specified like this for example). Session messages are keyed on the subject name, so that if a new message is published on the same subject then we can consider that this replaces the previous message published on that subject.Message services that support clustering will need to either indicate that these are session messages to the server (for servers that support session replication), or will need to manually republish session messages after fail-over. Message services may also need to republish session messages after reconnection if the server doesn't support session persistence.
Parameters:
Name Type Description sSubject
String The subject of the record being published to. mUpdateData
Map The data to be published to the record. oListener
module:caplin/services/messaging/PublishListener The listener that will receive the publish events. mHints
Map Any hints that might be used by the concrete implementation of the message service. - Implementations:
- module:caplin/services/testing/MessageServiceStub#publishSessionMessage
- module:caplin/sl4badapter/providers/SL4BMessageService#publishSessionMessage
- module:caplin/sljsadapter/providers/StreamLinkMessageService#publishSessionMessage
- See:
-
subscribe(sSubject, oListener, mHints) → {module:caplin/services/messaging/Subscription}
-
Creates a subscription to a record.
Since hints may or may not be supported by the underlying message service, hints must only used for progressive enhancement. The 'fields' hint, which allows client code to indicate which fields are actually required, is a good example of this. It enables message services that support the hint to reduce the number of fields they subscribe to, yet it wouldn't be disastrous if a message service chose not to support it.
Parameters:
Name Type Description sSubject
String The subject of the record being subscribed to. oListener
module:caplin/services/messaging/SubscriptionListener The listener for the subscription. mHints
Map Any hints that might be used by the concrete implementation of the message service. - Implementations:
- module:caplin/services/testing/MessageServiceStub#subscribe
- module:caplin/sl4badapter/providers/SL4BMessageService#subscribe
- module:caplin/sljsadapter/providers/StreamLinkMessageService#subscribe
Returns:
The subscription to the record.