Package com.caplin.motif.datasource
Interface CachedDataProvider<T extends SubjectInfo>
- Type Parameters:
T
- The type of subject info that will be provided with requests and discards.
- All Known Subinterfaces:
CachedMessageProvider<T>
- All Known Implementing Classes:
SingleValueProviderWrapper
,StrategyDetailsProvider
public interface CachedDataProvider<T extends SubjectInfo>
A DataProvider which receives a single onRequest(SubjectInfo)
and a single onDiscard(SubjectInfo)
, even if requests are made from
multiple peers. A cache is kept for subscriptions and also records so that any
subsequent peer request after an initial request will receive the current state
of the message before another update is sent.
In conjunction with a SubjectParser
, each request and discard will be
provided a parsed object that represents the subject.
-
Method Summary
-
Method Details
-
onRequest
Called on the initial request when the first peer makes a request.- Parameters:
subject
- The subject that was requested.
-
onDiscard
Called when the last peer subscribed discards the subject.- Parameters:
subject
- The subject that was discarded.
-