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<ComponentType>,Channel,ComponentType,Eligible,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
Channel.Default -
Field Summary
Fields inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector
mapper -
Constructor Summary
ConstructorsConstructorDescriptionQemuMonitor(Channel componentChannel, Path configDir) Instantiates a new QEMU monitor. -
Method Summary
Modifier and TypeMethodDescription(package private) voidAs the initial configuration of this component depends on the configuration of theRunner, it doesn’t have a handler for theConfigurationUpdateevent.voidonClosed(Closed<?> event, 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(ProcessExited event) On process exited.voidShutdown 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
configure, 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, spliterator
-
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
-
configure
As the initial configuration of this component depends on the configuration of theRunner, it doesn’t have a handler for theConfigurationUpdateevent.The values are forwarded from the
Runnerinstead.- Parameters:
socketPath- the socket pathpowerdownTimeout-
-
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
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
-