Package com.caplin.datasource.publisher
Interface CachingDataProvider
-
public interface CachingDataProvider
Interface that must be implemented in order to provide data updates to DataSource peers for cached objects. It contains callbacks that handle subscription and discard requests.
Note: the
CachingDataProvider
methods are not called on a dedicated worker thread. Therefore, if any of these methods are likely take a relatively long time to execute, they should be coded to run in a separate thread.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onDiscard(java.lang.String subject)
Callback that informs the DataProvider that an earlier requested subject has now been discarded.void
onRequest(java.lang.String subject)
Callback that informs theCachingDataProvider
that a new request has been received and it should start sending data.
-
-
-
Method Detail
-
onRequest
void onRequest(java.lang.String subject)
Callback that informs the
CachingDataProvider
that a new request has been received and it should start sending data.The
CachingDataProvider
should perform the following tasks when this method is called:- If that DataSource is not already subscribed to the back end system that supplies the data for this subject, the DataSource should make a subscription for the subject.
- When data is received from the back end system for the subject, the
CachingDataProvider
should callCachingPublisher.publish(com.caplin.datasource.messaging.Message)
to publish the current image of the data.
- Parameters:
subject
- The subject for this request.
-
onDiscard
void onDiscard(java.lang.String subject)
Callback that informs the DataProvider that an earlier requested subject has now been discarded.
- Parameters:
subject
- The subject that has been discarded.
-
-