Class ChangeDispatcher

    • Constructor Summary

      Constructors 
      Constructor Description
      ChangeDispatcher​(@NotNull NodeState root)
      Create a new instance for dispatching content changes
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.io.Closeable addObserver​(Observer observer)
      Register a new Observer for receiving notifications about changes reported to this change dispatcher.
      void contentChanged​(@NotNull NodeState root, @NotNull CommitInfo info)
      Observes a content change.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChangeDispatcher

        public ChangeDispatcher​(@NotNull
                                @NotNull NodeState root)
        Create a new instance for dispatching content changes
        Parameters:
        root - current root node state
    • Method Detail

      • addObserver

        @NotNull
        public @NotNull java.io.Closeable addObserver​(Observer observer)
        Register a new Observer for receiving notifications about changes reported to this change dispatcher. Changes are reported synchronously and clients need to ensure to no block any length of time (e.g. by relaying through a BackgroundObserver).

        Clients need to call Closeable.close() close} on the returned Closeable instance to stop receiving notifications.

        Specified by:
        addObserver in interface Observable
        Returns:
        a Closeable instance
      • contentChanged

        public void contentChanged​(@NotNull
                                   @NotNull NodeState root,
                                   @NotNull
                                   @NotNull CommitInfo info)
        Description copied from interface: Observer
        Observes a content change. See the Observer class javadocs and relevant repository and observer registration details for more information on when and how this method gets called.
        Specified by:
        contentChanged in interface Observer
        Parameters:
        root - root state of the repository
        info - commit information