Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: observation
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      352

      Description

      The observation section in the specification already talks about event bundles
      when it means the events that are accessible through an EventIterator. With the
      introduction of journaled observation where EventIterators are iterated it would
      be much more intuitive to actually have an EventBundle interface.

      PROPOSAL:

      Introduce a new interface EventBundle with the following method:

      // Returns an iterator over the events in this bundle.
      EventIterator getEvents()

      // Returns the date when the change was persisted, which caused
      // the events in this bundle. This date may be used by a client
      // to later skip to the appropriate position in the journal to
      // continue reading through the journal.
      Calendar getDate()

      Change EventJournal to not extend from EventIterator anymore but from
      java.util.Iterator. This also removes some awkward behavior for getPosition()
      and getSize() on EventJournal.

      Specify the following methods on EventJournal:

      void skipTo(Calendar date) // as already specified

      // Returns the next event bundle in the journal.
      // Throws a NoSuchElementException if the journal contain
      // no more bundles.
      EventBundle nextEventBundle()

      Should we add a blocking variant with a timeout?

      // Returns the next event bundle in the journal. If the journal
      // contains no more bundles, the method blocks for at most
      // timeout milliseconds.
      // Throws a NoSuchElementException if the journal contain
      // no more bundles and the timeout elapsed.
      EventBundle nextEventBundle(long timeout)

      With these changes the synthetic event PERSIST is redundant. This makes the spec
      much easier to read and implementations easier to use, because PERSIST is
      specified as optional.

        Issue Links

          Activity

          Hide
          mreutegg added a comment -

          On the last f2f in Basel we decided to keep the optional persist event and not
          add an EventBundle interface.

          Show
          mreutegg added a comment - On the last f2f in Basel we decided to keep the optional persist event and not add an EventBundle interface.

            People

            • Assignee:
              jsr-283-issues
              Reporter:
              mreutegg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: