public final class NoopJournalSystem extends Object implements JournalSystem
JournalSystem.Builder, JournalSystem.Mode
Constructor and Description |
---|
NoopJournalSystem()
Constructs a new
NoopJournalSystem . |
Modifier and Type | Method and Description |
---|---|
Journal |
createJournal(JournalEntryStateMachine master)
Creates a journal for the given state machine.
|
void |
format()
Formats the journal system.
|
void |
gainPrimacy()
Transitions the journal to primary mode.
|
boolean |
isEmpty()
Returns whether the journal is formatted and has not had any entries written to it yet.
|
boolean |
isFormatted() |
void |
losePrimacy()
Transitions the journal to secondary mode.
|
void |
start()
Starts the journal system.
|
void |
stop()
Stops the journal system.
|
public NoopJournalSystem()
NoopJournalSystem
.public Journal createJournal(JournalEntryStateMachine master)
JournalSystem
JournalEntryStateMachine#processJournalEntry(JournalEntry)
and
JournalEntryStateMachine.resetState()
to keep the state machine's state in sync with
the entries written to the journal.createJournal
in interface JournalSystem
master
- the state machine to create the journal forJournal
public void gainPrimacy()
JournalSystem
gainPrimacy
in interface JournalSystem
public void losePrimacy()
JournalSystem
losePrimacy
in interface JournalSystem
public boolean isFormatted() throws IOException
isFormatted
in interface JournalSystem
IOException
public boolean isEmpty()
JournalSystem
isEmpty
in interface JournalSystem
public void format() throws IOException
JournalSystem
format
in interface JournalSystem
IOException
public void start() throws InterruptedException, IOException
JournalSystem
start
in interface JournalSystem
InterruptedException
IOException
public void stop() throws InterruptedException, IOException
JournalSystem
stop
in interface JournalSystem
InterruptedException
IOException
Copyright © 2023. All Rights Reserved.