Class QemuMonitor
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jdrupes.vmoperator.runner.qemu.QemuConnector
org.jdrupes.vmoperator.runner.qemu.QemuMonitor
- All Implemented Interfaces:
Iterable<org.jgrapes.core.ComponentType>,org.jgrapes.core.Channel,org.jgrapes.core.ComponentType,org.jgrapes.core.Eligible,org.jgrapes.core.Manager
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
org.jgrapes.core.Channel.Default -
Field Summary
Fields inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector
mapperFields inherited from class org.jgrapes.core.Component
loggerFields inherited from interface org.jgrapes.core.Channel
BROADCAST, SELF -
Constructor Summary
ConstructorsConstructorDescriptionQemuMonitor(org.jgrapes.core.Channel componentChannel, Path configDir) Instantiates a new QEMU monitor. -
Method Summary
Modifier and TypeMethodDescriptionvoidonClosed(org.jgrapes.io.events.Closed<?> event, org.jgrapes.net.SocketIOChannel channel) On closed.voidonConfigureQemu(ConfigureQemu event) On configure qemu.voidonMonitorCommand(MonitorCommand event) On monitor command.voidonPowerdownEvent(PowerdownEvent event) When the powerdown event is confirmed, wait for termination or timeout.voidonProcessExited(org.jgrapes.io.events.ProcessExited event) On process exited.voidonStop(org.jgrapes.core.events.Stop event) Shutdown the VM.protected voidprocessInput(String line) Process agent input.protected voidWhen the socket is connected, send the capabilities command.Methods inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector
onClientConnected, onConnectError, onFileChanged, onInput, onStart, qemuChannel, rep, sendCommand, writerMethods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setNameMethods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGeneratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.jgrapes.core.Manager
stream
-
Constructor Details
-
QemuMonitor
Instantiates a new QEMU monitor.- Parameters:
componentChannel- the component channelconfigDir- the config dir- Throws:
IOException- Signals that an I/O exception has occurred.
-
-
Method Details
-
socketConnected
When the socket is connected, send the capabilities command.- Overrides:
socketConnectedin classQemuConnector
-
processInput
Description copied from class:QemuConnectorProcess agent input.- Specified by:
processInputin classQemuConnector- Parameters:
line- the line- Throws:
IOException- Signals that an I/O exception has occurred.
-
onClosed
@Handler public void onClosed(org.jgrapes.io.events.Closed<?> event, org.jgrapes.net.SocketIOChannel channel) On closed.- Overrides:
onClosedin classQemuConnector- Parameters:
event- the eventchannel- the channel
-
onMonitorCommand
On monitor command.- Parameters:
event- the event- Throws:
IOException
-
onStop
Shutdown the VM.- Parameters:
event- the event
-
onPowerdownEvent
When the powerdown event is confirmed, wait for termination or timeout.Termination is detected by the qemu process exiting (see
onProcessExited(ProcessExited)).- Parameters:
event- the event
-
onProcessExited
On process exited.- Parameters:
event- the event
-
onConfigureQemu
On configure qemu.- Parameters:
event- the event
-