class OperationJournal.TransitionIterator extends Object
EntryTransition
s added after the iterator was
created and processed before watcherRegistered
was
called. This call assumes it is only used by a single thread.Modifier and Type | Field and Description |
---|---|
private OperationJournal.JournalNode |
current
Our current position in the journal
|
private OperationJournal.JournalNode |
end
The place to end,
null if
watcherRegistered has not yet
been called. |
Modifier | Constructor and Description |
---|---|
private |
OperationJournal.TransitionIterator(OperationJournal.JournalNode node)
Create a new
TransitionIterator that will
start with the first EntryTransition that
appears in the journal after the passed
JournalNode . |
Modifier and Type | Method and Description |
---|---|
(package private) long |
currentOrdinalAtCreation()
Return the ordinal of the last operation posted
when this iterator was created.
|
(package private) EntryTransition |
next()
Return the next
EntryTransition in the
sequence, or null if the end
of the sequence has been reached. |
(package private) void |
watcherRegistered()
Set the end of the iteration to ensure that
any
EntryTransition added after
this iterator was created will either be returned by
this iterator, or passed to the process() method
of any watcher that was added to the watcher associated
with the OperationJournal before
this method was called. |
private OperationJournal.JournalNode end
null
if
watcherRegistered
has not yet
been called.private OperationJournal.JournalNode current
private OperationJournal.TransitionIterator(OperationJournal.JournalNode node)
TransitionIterator
that will
start with the first EntryTransition
that
appears in the journal after the passed
JournalNode
.node
- Start the iteration with the first
JournalNode
after node
that is for a EntryTransition
.NullPointerException
- if node is null
.EntryTransition next()
EntryTransition
in the
sequence, or null
if the end
of the sequence has been reached.EntryTransition
in the
sequence, or null
if the
end of the sequence has been reached.IllegalStateException
- if
watcherRegistered
has not yet
been called.void watcherRegistered()
EntryTransition
added after
this iterator was created will either be returned by
this iterator, or passed to the process() method
of any watcher that was added to the watcher associated
with the OperationJournal
before
this method was called.IllegalStateException
- if
watcherRegistered
has been called.long currentOrdinalAtCreation()
EntryTransition
s yielded by this
iterator will have higher ordinals.IllegalStateException
- if
watcherRegistered
has been called.Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.