Package com.caplin.datasource.publisher
Interface CachingPublisher
-
public interface CachingPublisher
An instance of
CachingPublisher
publishes messages to remote DataSource peers on behalf of aCachingDataProvider
. It also provides access to aCachedMessageFactory
that creates the messages to be published. Messages once published are internally cached, so requests from additional peers can be serviced without further calls to the provider.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CachedMessageFactory
getCachedMessageFactory()
Gets theCachedMessageFactory
used to create the messages that are published via thisPublisher
.void
publish(Message message)
Publishes the data for a subject to peers that have just requested (subscribed to) that subject.void
publishSubjectErrorEvent(SubjectErrorEvent subjectErrorEvent)
Publishes to all peers subscribed to a subject an event detailing an error in the subscription for that subject.void
publishSubjectStatusEvent(SubjectStatusEvent subjectStatusEvent)
Publishes to all subscribed peers an event about the change in status of a subject.
-
-
-
Method Detail
-
getCachedMessageFactory
CachedMessageFactory getCachedMessageFactory()
Gets theCachedMessageFactory
used to create the messages that are published via thisPublisher
.- Returns:
- The message factory.
-
publish
void publish(Message message)
Publishes the data for a subject to peers that have just requested (subscribed to) that subject.- Parameters:
message
- The message.
-
publishSubjectErrorEvent
void publishSubjectErrorEvent(SubjectErrorEvent subjectErrorEvent)
Publishes to all peers subscribed to a subject an event detailing an error in the subscription for that subject. Typically aCachingDataProvider
will use this to notify the remote peers that the data they are subscribed to is no longer available.- Parameters:
subjectErrorEvent
- The error event to be published.
-
publishSubjectStatusEvent
void publishSubjectStatusEvent(SubjectStatusEvent subjectStatusEvent)
Publishes to all subscribed peers an event about the change in status of a subject.- Parameters:
subjectStatusEvent
- The subject status event to be published.
-
-