Interface CachingPublisher

All Known Subinterfaces:
TransformerCachingPublisher

public interface CachingPublisher

An instance of CachingPublisher publishes messages to remote DataSource peers on behalf of a CachingDataProvider. It also provides access to a CachedMessageFactory 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 Details

    • getCachedMessageFactory

      CachedMessageFactory getCachedMessageFactory()
      Gets the CachedMessageFactory used to create the messages that are published via this Publisher.
      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, a CachingDataProvider 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.