Structure documentation.

This commit is contained in:
Michael Lipp 2023-06-06 14:31:38 +02:00
parent f788724881
commit ba7147ba0e
4 changed files with 18 additions and 27 deletions

View file

@ -53,12 +53,15 @@ import org.jgrapes.util.events.WatchFile;
/**
* A component that handles the communication over the Qemu monitor
* socket.
*
* If the log level for this class is set to fine, the messages
* exchanged on the monitor socket are logged.
*/
public class QemuMonitor extends Component {
@SuppressWarnings({ "PMD.FieldNamingConventions",
"PMD.VariableNamingConventions" })
private static final Logger monitorLog
private static final Logger logger
= Logger.getLogger(QemuMonitor.class.getName());
@SuppressWarnings("PMD.UseConcurrentHashMap")
@ -165,7 +168,7 @@ public class QemuMonitor extends Component {
}
private void writeToMonitor(String message) {
monitorLog.fine(() -> "monitor(out): " + message);
logger.fine(() -> "monitor(out): " + message);
monitorChannel.associated(Writer.class).ifPresent(writer -> {
try {
writer.append(message).append('\n').flush();
@ -194,7 +197,7 @@ public class QemuMonitor extends Component {
private void processMonitorInput(String line)
throws IOException {
monitorLog.fine(() -> "monitor(in): " + line);
logger.fine(() -> "monitor(in): " + line);
try {
var response
= ((Runner) channel()).mapper().readValue(line, JsonNode.class);

View file

@ -72,15 +72,12 @@ import org.jgrapes.util.events.InitialConfiguration;
import org.jgrapes.util.events.WatchFile;
/**
* The Runner is responsible for manageing the Qemu process and
* optionally a process that emulates a TPM (software TPM). It
* it's function is best described by a state diagram.
* The Runner is responsible for managing the Qemu process and
* optionally a process that emulates a TPM (software TPM). It's
* main function is best described by the following state diagram.
*
* ![Runner state diagram](RunnerStates.svg)
*
* If the log level for `org.jdrupes.vmoperator.runner.qemu.monitor`
* is set to fine, the messages exchanged on the monitor socket are logged.
*
* @startuml RunnerStates.svg
* [*] --> Initializing
* Initializing -> Initializing: InitialConfiguration/configure Runner